You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/PULL_REQUEST_TEMPLATE.md
+2
Original file line number
Diff line number
Diff line change
@@ -19,13 +19,15 @@ If your pull request is a documentation fix or a trivial typo, feel free to dele
19
19
-[ ] New features have been added to our [Hypothesis testing strategy](https://github.com/python-attrs/attrs/blob/main/tests/strategies.py).
20
20
-[ ] Changes or additions to public APIs are reflected in our type stubs (files ending in ``.pyi``).
21
21
-[ ] ...and used in the stub test file `tests/typing_example.py`.
22
+
-[ ] If they've been added to `attr/__init__.pyi`, they've *also* been re-imported in `attrs/__init__.pyi`.
22
23
-[ ] Updated **documentation** for changed code.
23
24
-[ ] New functions/classes have to be added to `docs/api.rst` by hand.
24
25
-[ ] Changes to the signature of `@attr.s()` have to be added by hand too.
25
26
-[ ] Changed/added classes/methods/functions have appropriate `versionadded`, `versionchanged`, or `deprecated`[directives](http://www.sphinx-doc.org/en/stable/markup/para.html#directive-versionadded).
26
27
Find the appropriate next version in our [``__init__.py``](https://github.com/python-attrs/attrs/blob/main/src/attr/__init__.py) file.
27
28
-[ ] Documentation in `.rst` files is written using [semantic newlines](https://rhodesmill.org/brandon/2012/one-sentence-per-line/).
28
29
-[ ] Changes (and possible deprecations) have news fragments in [`changelog.d`](https://github.com/python-attrs/attrs/blob/main/changelog.d).
30
+
-[ ] Consider granting [push permissions to the PR branch](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/allowing-changes-to-a-pull-request-branch-created-from-a-fork), so maintainers can fix minor issues themselves without pestering you.
29
31
30
32
<!--
31
33
If you have *any* questions to *any* of the points above, just **submit and ask**!
Copy file name to clipboardExpand all lines: CHANGELOG.rst
+94-9
Original file line number
Diff line number
Diff line change
@@ -3,16 +3,16 @@ Changelog
3
3
4
4
Versions follow `CalVer <https://calver.org>`_ with a strict backwards-compatibility policy.
5
5
6
-
The **first digit** of the version is the year.
7
-
The **second digit** is incremented with each release, starting at 1 for each year.
8
-
The **third digit** is when we need to start branches for older releases (only for emergencies).
6
+
The **first number** of the version is the year.
7
+
The **second number** is incremented with each release, starting at 1 for each year.
8
+
The **third number** is when we need to start branches for older releases (only for emergencies).
9
9
10
10
Put simply, you shouldn't ever be afraid to upgrade ``attrs`` if you're only using its public APIs.
11
11
Whenever there is a need to break compatibility, it is announced here in the changelog, and raises a ``DeprecationWarning`` for a year (if possible) before it's finally really broken.
12
12
13
13
.. warning::
14
14
15
-
The structure of the `attr.Attribute` class is exempt from this rule.
15
+
The structure of the `attrs.Attribute` class is exempt from this rule.
16
16
It *will* change in the future, but since it should be considered read-only, that shouldn't matter.
17
17
18
18
However if you intend to build extensions on top of ``attrs`` you have to anticipate that.
@@ -28,6 +28,91 @@ Changes for the upcoming release can be found in the `"changelog.d" directory <h
28
28
29
29
.. towncrier release notes start
30
30
31
+
21.4.0 (2021-12-29)
32
+
-------------------
33
+
34
+
Changes
35
+
^^^^^^^
36
+
37
+
- Fixed the test suite on PyPy3.8 where ``cloudpickle`` does not work.
- When using ``@define``, converters are now run by default when setting an attribute on an instance -- additionally to validators.
54
+
I.e. the new default is ``on_setattr=[attrs.setters.convert, attrs.setters.validate]``.
55
+
56
+
This is unfortunately a breaking change, but it was an oversight, impossible to raise a ``DeprecationWarning`` about, and it's better to fix it now while the APIs are very fresh with few users.
- If the class-level *on_setattr* is set to ``attrs.setters.validate`` (default in ``@define`` and ``@mutable``) but no field defines a validator, pretend that it's not set.
- ``attrs`` classes are now fully compatible with `cloudpickle <https://github.com/cloudpipe/cloudpickle>`_ (no need to disable ``repr`` anymore).
- Added **provisional** support for static typing in ``pyright`` via the `dataclass_transforms specification <https://github.com/microsoft/pyright/blob/master/specs/dataclass_transforms.md>`_.
203
+
- Added **provisional** support for static typing in ``pyright`` via the `dataclass_transforms specification <https://github.com/microsoft/pyright/blob/main/specs/dataclass_transforms.md>`_.
119
204
Both the ``pyright`` specification and ``attrs`` implementation may change in future versions of both projects.
120
205
121
206
Your constructive feedback is welcome in both `attrs#795 <https://github.com/python-attrs/attrs/issues/795>`_ and `pyright#1782 <https://github.com/microsoft/pyright/discussions/1782>`_.
@@ -234,7 +319,7 @@ Deprecations
234
319
Please check out the linked issue for more details.
235
320
236
321
These new APIs have been added *provisionally* as part of #666 so you can try them out today and provide feedback.
237
-
Learn more in the `API docs <https://www.attrs.org/en/stable/api.html#provisional-apis>`_.
322
+
Learn more in the `API docs <https://www.attrs.org/en/stable/api.html>`_.
- The order of attributes that are passed into ``attr.make_class()`` or the *these* argument of ``@attr.s()`` is now retained if the dictionary is ordered (i.e. ``dict`` on Python 3.6 and later, ``collections.OrderedDict`` otherwise).
513
598
514
-
Before, the order was always determined by the order in which the attributes have been defined which may not be desirable when creating classes programatically.
599
+
Before, the order was always determined by the order in which the attributes have been defined which may not be desirable when creating classes programmatically.
0 commit comments