Skip to content

Commit 556ca7c

Browse files
committed
Prepare 24.1.0
1 parent 95238e7 commit 556ca7c

16 files changed

+55
-35
lines changed

CHANGELOG.md

+55-6
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,64 @@ You can find our backwards-compatibility policy [here](https://github.com/python
1010

1111
Changes for the upcoming release can be found in the [`changelog.d` directory](https://github.com/python-attrs/attrs/tree/main/changelog.d) in our repository.
1212

13-
<!--
14-
Do *NOT* add changelog entries here!
13+
<!-- towncrier release notes start -->
1514

16-
This changelog is managed by towncrier and is compiled at release time.
15+
## [24.1.0](https://github.com/python-attrs/attrs/tree/24.1.0) - 2024-08-03
1716

18-
See https://github.com/python-attrs/attrs/blob/main/.github/CONTRIBUTING.md#changelog for details.
19-
-->
17+
### Backwards-incompatible Changes
2018

21-
<!-- towncrier release notes start -->
19+
- `attrs.evolve()` doesn't accept the *inst* argument as a keyword argument anymore.
20+
Pass it as the first positional argument instead.
21+
[#1264](https://github.com/python-attrs/attrs/issues/1264)
22+
- `attrs.validators.provides()` has been removed.
23+
The removed code is available as a [gist](https://gist.github.com/hynek/9eaaaeb659808f3519870dfa16d2b6b2) for convenient copy and pasting.
24+
[#1265](https://github.com/python-attrs/attrs/issues/1265)
25+
- All packaging metadata except from `__version__` and `__version_info__` has been removed from the `attr` and `attrs` modules (for example, `attrs.__url__`).
26+
27+
Please use [`importlib.metadata`](https://docs.python.org/3/library/importlib.metadata.html) or [*importlib_metadata*](https://pypi.org/project/importlib-metadata/) instead.
28+
[#1268](https://github.com/python-attrs/attrs/issues/1268)
29+
- Speed up the generated `__eq__` methods significantly by generating a chain of attribute comparisons instead of constructing and comparing tuples.
30+
This change arguably makes the behavior more correct,
31+
but changes it if an attribute compares equal by identity but not value, like `float('nan')`.
32+
[#1310](https://github.com/python-attrs/attrs/issues/1310)
33+
34+
35+
### Deprecations
36+
37+
- The *repr_ns* argument to `attr.s` is now deprecated.
38+
It was a workaround for nested classes in Python 2 and is pointless in Python 3.
39+
[#1263](https://github.com/python-attrs/attrs/issues/1263)
40+
- The *hash* argument to `@attr.s`, `@attrs.define`, and `make_class()` is now deprecated in favor of *unsafe_hash*, as defined by PEP 681.
41+
[#1323](https://github.com/python-attrs/attrs/issues/1323)
42+
43+
44+
### Changes
45+
46+
- Allow original slotted `functools.cached_property` classes to be cleaned by garbage collection.
47+
Allow `super()` calls in slotted cached properties.
48+
[#1221](https://github.com/python-attrs/attrs/issues/1221)
49+
- Our type stubs now use modern type notation and are organized such that VS Code's quick-fix prefers the `attrs` namespace.
50+
[#1234](https://github.com/python-attrs/attrs/issues/1234)
51+
- Preserve `AttributeError` raised by properties of slotted classes with `functools.cached_properties`.
52+
[#1253](https://github.com/python-attrs/attrs/issues/1253)
53+
- It is now possible to wrap a converter into an `attrs.Converter` and get the current instance and/or the current field definition passed into the converter callable.
54+
55+
Note that this is not supported by any type checker, yet.
56+
[#1267](https://github.com/python-attrs/attrs/issues/1267)
57+
- `attrs.make_class()` now populates the `__annotations__` dict of the generated class, so that `attrs.resolve_types()` can resolve them.
58+
[#1285](https://github.com/python-attrs/attrs/issues/1285)
59+
- Added the `attrs.validators.or_()` validator.
60+
[#1303](https://github.com/python-attrs/attrs/issues/1303)
61+
- The combination of a `__attrs_pre_init__` that takes arguments, a kw-only field, and a default on that field does not crash anymore.
62+
[#1319](https://github.com/python-attrs/attrs/issues/1319)
63+
- `attrs.validators.in_()` now transforms certain unhashable options to tuples to keep the field hashable.
64+
65+
This allows fields that use this validator to be used with, for example, `attrs.filters.include()`.
66+
[#1320](https://github.com/python-attrs/attrs/issues/1320)
67+
- If a class has an *inherited* method called `__attrs_init_subclass__`, it is now called once the class is done assembling.
68+
69+
This is a replacement for Python's `__init_subclass__` and useful for registering classes, and similar.
70+
[#1321](https://github.com/python-attrs/attrs/issues/1321)
2271

2372

2473
## [23.2.0](https://github.com/python-attrs/attrs/tree/23.2.0) - 2023-12-31

changelog.d/1221.change.md

-2
This file was deleted.

changelog.d/1234.change.md

-1
This file was deleted.

changelog.d/1253.change.md

-1
This file was deleted.

changelog.d/1263.deprecation.md

-2
This file was deleted.

changelog.d/1264.breaking.md

-2
This file was deleted.

changelog.d/1265.breaking.md

-2
This file was deleted.

changelog.d/1267.change.md

-3
This file was deleted.

changelog.d/1268.breaking.md

-3
This file was deleted.

changelog.d/1285.change.md

-1
This file was deleted.

changelog.d/1303.change.md

-1
This file was deleted.

changelog.d/1310.breaking.md

-3
This file was deleted.

changelog.d/1319.change.md

-1
This file was deleted.

changelog.d/1320.change.md

-3
This file was deleted.

changelog.d/1321.change.md

-3
This file was deleted.

changelog.d/1323.deprecation.md

-1
This file was deleted.

0 commit comments

Comments
 (0)