From 19bb29555fcebde11dd3177973a3d38df8bd4c8a Mon Sep 17 00:00:00 2001 From: Hynek Schlawack Date: Wed, 8 Nov 2017 18:43:25 +0100 Subject: [PATCH] Prepare 17.3.0 --- CHANGELOG.rst | 48 ++++++++++++++++++++++++++++++++++++-------- src/attr/__init__.py | 2 +- 2 files changed, 41 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 13e52174..0c9c73b1 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,17 +4,49 @@ Changelog Versions follow `CalVer `_ with a strict backwards compatibility policy. The third digit is only for regressions. -Changes for the upcoming release can be found in the `"changelog.d" directory `_ in our repository. - -.. - Do *NOT* add changelog entries here! - - This changelog is managed by towncrier and is compiled at release time. - - See http://www.attrs.org/en/latest/contributing.html#changelog for details. .. towncrier release notes start +17.3.0 (2017-11-08) +------------------- + +Backward-incompatible Changes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +- Attributes are not defined on the class body anymore. + + This means that if you define a class ``C`` with an attribute ``x``, the class will *not* have an attribute ``x`` for introspection anymore. + Instead of ``C.x``, use ``attr.fields(C).x`` or look at ``C.__attrs_attrs__``. + The old behavior has been deprecated since version 16.1. + (`#253 `_) + + +Changes +^^^^^^^ + +- ``super()`` and ``__class__`` now work on Python 3 when ``slots=True``. + (`#102 `_, `#226 `_, `#269 `_, `#270 `_, `#272 `_) +- Added ``type`` argument to ``attr.ib()`` and corresponding ``type`` attribute to ``attr.Attribute``. + + This change paves the way for automatic type checking and serialization (though as of this release ``attrs`` does not make use of it). + In Python 3.6 or higher, the value of ``attr.Attribute.type`` can alternately be set using variable type annotations + (see `PEP 526 `_). (`#151 `_, `#214 `_, `#215 `_, `#239 `_) +- The combination of ``str=True`` and ``slots=True`` now works on Python 2. + (`#198 `_) +- ``attr.Factory`` is hashable again. (`#204 + `_) +- Subclasses now can overwrite attribute definitions of their superclass. + + That means that you can -- for example -- change the default value for an attribute by redefining it. + (`#221 `_, `#229 `_) +- Added new option ``auto_attribs`` to ``@attr.s`` that allows to collect annotated fields without setting them to ``attr.ib()``. + + Setting a field to an ``attr.ib()`` is still possible to supply options like validators. + Setting it to any other value is treated like it was passed as ``attr.ib(default=value)`` -- passing an instance of ``attr.Factory`` also works as expected. + (`#262 `_, `#277 `_) +- Instances of classes created using ``attr.make_class()`` can now be pickled. + (`#282 `_) + ---- diff --git a/src/attr/__init__.py b/src/attr/__init__.py index 351b32cb..dddfad58 100644 --- a/src/attr/__init__.py +++ b/src/attr/__init__.py @@ -29,7 +29,7 @@ from . import converters from . import validators -__version__ = "17.3.0.dev0" +__version__ = "17.3.0" __title__ = "attrs" __description__ = "Classes Without Boilerplate"