Skip to content
This repository has been archived by the owner on Aug 4, 2018. It is now read-only.

Update attrs to 17.3.0 #118

Merged
merged 1 commit into from
Nov 17, 2017
Merged

Conversation

pyup-bot
Copy link
Contributor

@pyup-bot pyup-bot commented Nov 8, 2017

There's a new version of attrs available.
You are currently using 17.2.0. I have updated it to 17.3.0

These links might come in handy: PyPI | Changelog | Homepage

Changelog

17.3.0


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 <https://github.com/python-attrs/attrs/issues/253>_)

Changes
^^^^^^^

  • super() and __class__ now work on Python 3 when slots=True.
    (102 <https://github.com/python-attrs/attrs/issues/102>, 226 <https://github.com/python-attrs/attrs/issues/226>, 269 <https://github.com/python-attrs/attrs/issues/269>, 270 <https://github.com/python-attrs/attrs/issues/270>, 272 <https://github.com/python-attrs/attrs/issues/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 <https://www.python.org/dev/peps/pep-0526/>). (151 <https://github.com/python-attrs/attrs/issues/151>, 214 <https://github.com/python-attrs/attrs/issues/214>, 215 <https://github.com/python-attrs/attrs/issues/215>, 239 <https://github.com/python-attrs/attrs/issues/239>_)

  • The combination of str=True and slots=True now works on Python 2.
    (198 <https://github.com/python-attrs/attrs/issues/198>_)
  • attr.Factory is hashable again. (204 <https://github.com/python-attrs/attrs/issues/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 <https://github.com/python-attrs/attrs/issues/221>, 229 <https://github.com/python-attrs/attrs/issues/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 <https://github.com/python-attrs/attrs/issues/262>, 277 <https://github.com/python-attrs/attrs/issues/277>)

  • Instances of classes created using attr.make_class() can now be pickled.
    (282 <https://github.com/python-attrs/attrs/issues/282>_)

Got merge conflicts? Close this PR and delete the branch. I'll create a new PR for you.

Happy merging! 🤖


This change is Reviewable

@mithrandi
Copy link
Member

bors r+


Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

bors-fusion bot added a commit that referenced this pull request Nov 17, 2017
118: Update attrs to 17.3.0 r=mithrandi


There's a new version of [attrs](https://pypi.python.org/pypi/attrs) available.
You are currently using **17.2.0**. I have updated it to **17.3.0**



These links might come in handy:  <a href="https://pypi.python.org/pypi/attrs">PyPI</a> | <a href="https://pyup.io/changelogs/attrs/">Changelog</a> | <a href="http://www.attrs.org/">Homepage</a> 



### Changelog
> 
>### 17.3.0

>-------------------

>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 &lt;https://github.com/python-attrs/attrs/issues/253&gt;`_)


>Changes
>^^^^^^^

>- ``super()`` and ``__class__`` now work on Python 3 when ``slots=True``.
>  (`102 &lt;https://github.com/python-attrs/attrs/issues/102&gt;`_, `226 &lt;https://github.com/python-attrs/attrs/issues/226&gt;`_, `269 &lt;https://github.com/python-attrs/attrs/issues/269&gt;`_, `270 &lt;https://github.com/python-attrs/attrs/issues/270&gt;`_, `272 &lt;https://github.com/python-attrs/attrs/issues/272&gt;`_)
>- 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 &lt;https://www.python.org/dev/peps/pep-0526/&gt;`_). (`151 &lt;https://github.com/python-attrs/attrs/issues/151&gt;`_, `214 &lt;https://github.com/python-attrs/attrs/issues/214&gt;`_, `215 &lt;https://github.com/python-attrs/attrs/issues/215&gt;`_, `239 &lt;https://github.com/python-attrs/attrs/issues/239&gt;`_)
>- The combination of ``str=True`` and ``slots=True`` now works on Python 2.
>  (`198 &lt;https://github.com/python-attrs/attrs/issues/198&gt;`_)
>- ``attr.Factory`` is hashable again. (`204
>  &lt;https://github.com/python-attrs/attrs/issues/204&gt;`_)
>- 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 &lt;https://github.com/python-attrs/attrs/issues/221&gt;`_, `229 &lt;https://github.com/python-attrs/attrs/issues/229&gt;`_)
>- 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 &lt;https://github.com/python-attrs/attrs/issues/262&gt;`_, `277 &lt;https://github.com/python-attrs/attrs/issues/277&gt;`_)
>- Instances of classes created using ``attr.make_class()`` can now be pickled.
>  (`282 &lt;https://github.com/python-attrs/attrs/issues/282&gt;`_)


>----








*Got merge conflicts? Close this PR and delete the branch. I'll create a new PR for you.*

Happy merging! 🤖
@bors-fusion
Copy link
Contributor

bors-fusion bot commented Nov 17, 2017

@bors-fusion bors-fusion bot merged commit a8c2bcb into master Nov 17, 2017
@bors-fusion bors-fusion bot deleted the pyup-update-attrs-17.2.0-to-17.3.0 branch November 17, 2017 06:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants