Skip to content

Commit a9960de

Browse files
committed
Prepare 22.2.0
1 parent 566248a commit a9960de

16 files changed

+49
-29
lines changed

CHANGELOG.md

+48-6
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,57 @@ Whenever there is a need to break compatibility, it is announced here in the cha
1818

1919
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.
2020

21-
<!--
22-
Do *NOT* add changelog entries here!
21+
<!-- towncrier release notes start -->
2322

24-
This changelog is managed by towncrier and is compiled at release time.
23+
## [22.2.0](https://github.com/python-attrs/attrs/tree/22.2.0) - 2022-12-21
2524

26-
See https://github.com/python-attrs/attrs/blob/main/.github/CONTRIBUTING.md#changelog for details.
27-
-->
25+
### Backwards-incompatible Changes
26+
27+
- Python 3.5 is not supported anymore.
28+
[#988](https://github.com/python-attrs/attrs/issues/988)
29+
30+
31+
### Deprecations
32+
33+
- Python 3.6 is now deprecated and support will be removed in the next release.
34+
[#1017](https://github.com/python-attrs/attrs/issues/1017)
35+
36+
37+
### Changes
38+
39+
- `attrs.field()` now supports an *alias* option for explicit `__init__` argument names.
40+
41+
Get `__init__` signatures matching any taste, peculiar or plain!
42+
The [PEP 681 compatible](https://peps.python.org/pep-0681/#field-specifier-parameters) *alias* option can be use to override private attribute name mangling, or add other arbitrary field argument name overrides.
43+
[#950](https://github.com/python-attrs/attrs/issues/950)
44+
- `attrs.NOTHING` is now an enum value, making it possible to use with e.g. [`typing.Literal`](https://docs.python.org/3/library/typing.html#typing.Literal).
45+
[#983](https://github.com/python-attrs/attrs/issues/983)
46+
- Added missing re-import of `attr.AttrsInstance` to the `attrs` namespace.
47+
[#987](https://github.com/python-attrs/attrs/issues/987)
48+
- Fix slight performance regression in classes with custom `__setattr__` and speedup even more.
49+
[#991](https://github.com/python-attrs/attrs/issues/991)
50+
- Class-creation performance improvements by switching performance-sensitive templating operations to f-strings.
51+
52+
You can expect an improvement of about 5% -- even for very simple classes.
53+
[#995](https://github.com/python-attrs/attrs/issues/995)
54+
- `attrs.has()` is now a [`TypeGuard`](https://docs.python.org/3/library/typing.html#typing.TypeGuard) for `AttrsInstance`.
55+
That means that type checkers know a class is an instance of an `attrs` class if you check it using `attrs.has()` (or `attr.has()`) first.
56+
[#997](https://github.com/python-attrs/attrs/issues/997)
57+
- Made `attrs.AttrsInstance` stub available at runtime and fixed type errors related to the usage of `attrs.AttrsInstance` in *Pyright*.
58+
[#999](https://github.com/python-attrs/attrs/issues/999)
59+
- On Python 3.10 and later, call [`abc.update_abstractmethods()`](https://docs.python.org/3/library/abc.html#abc.update_abstractmethods) on dict classes after creation.
60+
This improves the detection of abstractness.
61+
[#1001](https://github.com/python-attrs/attrs/issues/1001)
62+
- *attrs*'s pickling methods now use dicts instead of tuples.
63+
That is safer and more robust across different versions of a class.
64+
[#1009](https://github.com/python-attrs/attrs/issues/1009)
65+
- Added `attrs.validators.not_(wrapped_validator)` to logically invert *wrapped_validator* by accepting only values where *wrapped_validator* rejects the value with a `ValueError` or `TypeError` (by default, exception types configurable).
66+
[#1010](https://github.com/python-attrs/attrs/issues/1010)
67+
- The type stubs for `attrs.cmp_using()` now have default values.
68+
[#1027](https://github.com/python-attrs/attrs/issues/1027)
69+
- To conform with [PEP 681](https://peps.python.org/pep-0681/), `attr.s()` and `attrs.define()` now accept *unsafe_hash* in addition to *hash*.
70+
[#1065](https://github.com/python-attrs/attrs/issues/1065)
2871

29-
<!-- towncrier release notes start -->
3072

3173
## [22.1.0](https://github.com/python-attrs/attrs/tree/22.1.0) - 2022-07-28
3274

changelog.d/1001.change.md

-2
This file was deleted.

changelog.d/1009.change.md

-2
This file was deleted.

changelog.d/1010.change.md

-1
This file was deleted.

changelog.d/1017.deprecation.md

-1
This file was deleted.

changelog.d/1027.change.md

-1
This file was deleted.

changelog.d/1065.change.md

-1
This file was deleted.

changelog.d/950.change.md

-4
This file was deleted.

changelog.d/983.change.md

-1
This file was deleted.

changelog.d/987.change.md

-1
This file was deleted.

changelog.d/988.breaking.md

-1
This file was deleted.

changelog.d/991.change.md

-1
This file was deleted.

changelog.d/995.change.md

-3
This file was deleted.

changelog.d/997.change.md

-2
This file was deleted.

changelog.d/999.change.md

-1
This file was deleted.

src/attr/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
DeprecationWarning,
3333
)
3434

35-
__version__ = "22.2.0.dev0"
35+
__version__ = "22.2.0"
3636
__version_info__ = VersionInfo._from_version_string(__version__)
3737

3838
__title__ = "attrs"

0 commit comments

Comments
 (0)