Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update dependency attrs to v20 - autoclosed #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
renovate wants to merge 1 commit into master from renovate/attrs-20.x

Conversation

Copy link
Contributor

@renovate renovate bot commented Aug 23, 2020

This PR contains the following updates:

Package Update Change
attrs (source) major ==19.3.0 -> ==20.1.0

Release Notes

python-attrs/attrs

v20.1.0

Compare Source

Backward-incompatible Changes
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  • Python 3.4 is not supported anymore.
    It has been unsupported by the Python core team for a while now, its PyPI downloads are negligible, and our CI provider removed it as a supported option.

    It's very unlikely that attrs will break under 3.4 anytime soon, which is why we do not block its installation on Python 3.4.
    But we don't test it anymore and will block it once someone reports breakage.
    #&#8203;608 <https://github.com/python-attrs/attrs/issues/608>_

Deprecations
^^^^^^^^^^^^

  • Less of a deprecation and more of a heads up: the next release of attrs will introduce an attrs namespace.
    That means that you'll finally be able to run import attrs with new functions that aren't cute abbreviations and that will carry better defaults.

    This should not break any of your code, because project-local packages have priority before installed ones.
    If this is a problem for you for some reason, please report it to our bug tracker and we'll figure something out.

    The old attr namespace isn't going anywhere and its defaults are not changing – this is a purely additive measure.
    Please check out the linked issue for more details.

    These new APIs have been added provisionally as part of #​666 so you can try them out today and provide feedback.
    Learn more in the API docs <https://www.attrs.org/en/stable/api.html#provisional-apis>.
    #&#8203;408 <https://github.com/python-attrs/attrs/issues/408>

Changes
^^^^^^^

  • Added attr.resolve_types().
    It ensures that all forward-references and types in string form are resolved into concrete types.

    You need this only if you need concrete types at runtime.
    That means that if you only use types for static type checking, you do not need this function.
    #&#8203;288 <https://github.com/python-attrs/attrs/issues/288>,
    #&#8203;302 <https://github.com/python-attrs/attrs/issues/302>

  • Added @attr.s(collect_by_mro=False) argument that if set to True fixes the collection of attributes from base classes.

    It's only necessary for certain cases of multiple-inheritance but is kept off for now for backward-compatibility reasons.
    It will be turned on by default in the future.

    As a side-effect, attr.Attribute now always has an inherited attribute indicating whether an attribute on a class was directly defined or inherited.
    #&#8203;428 <https://github.com/python-attrs/attrs/issues/428>,
    #&#8203;635 <https://github.com/python-attrs/attrs/issues/635>

  • On Python 3, all generated methods now have a docstring explaining that they have been created by attrs.
    #&#8203;506 <https://github.com/python-attrs/attrs/issues/506>_

  • It is now possible to prevent attrs from auto-generating the __setstate__ and __getstate__ methods that are required for pickling of slotted classes.

    Either pass @attr.s(getstate_setstate=False) or pass @attr.s(auto_detect=True) and implement them yourself:
    if attrs finds either of the two methods directly on the decorated class, it assumes implicitly getstate_setstate=False (and implements neither).

    This option works with dict classes but should never be necessary.
    #&#8203;512 <https://github.com/python-attrs/attrs/issues/512>,
    #&#8203;513 <https://github.com/python-attrs/attrs/issues/513>
    ,
    #&#8203;642 <https://github.com/python-attrs/attrs/issues/642>_

  • Fixed a ValueError: Cell is empty bug that could happen in some rare edge cases.
    #&#8203;590 <https://github.com/python-attrs/attrs/issues/590>_

  • attrs can now automatically detect your own implementations and infer init=False, repr=False, eq=False, order=False, and hash=False if you set @attr.s(auto_detect=True).
    attrs will ignore inherited methods.
    If the argument implies more than one method (e.g. eq=True creates both __eq__ and __ne__), it's enough for one of them to exist and attrs will create neither.

    This feature requires Python 3.
    #&#8203;607 <https://github.com/python-attrs/attrs/issues/607>_

  • Added attr.converters.pipe().
    The feature allows combining multiple conversion callbacks into one by piping the value through all of them, and retuning the last result.

    As part of this feature, we had to relax the type information for converter callables.
    #&#8203;618 <https://github.com/python-attrs/attrs/issues/618>_

  • Fixed serialization behavior of non-slots classes with cache_hash=True.
    The hash cache will be cleared on operations which make "deep copies" of instances of classes with hash caching,
    though the cache will not be cleared with shallow copies like those made by copy.copy().

    Previously, copy.deepcopy() or serialization and deserialization with pickle would result in an un-initialized object.

    This change also allows the creation of cache_hash=True classes with a custom __setstate__,
    which was previously forbidden (#&#8203;494 <https://github.com/python-attrs/attrs/issues/494>).
    #&#8203;620 <https://github.com/python-attrs/attrs/issues/620>

  • It is now possible to specify hooks that are called whenever an attribute is set after a class has been instantiated.

    You can pass on_setattr both to @attr.s() to set the default for all attributes on a class, and to @attr.ib() to overwrite it for individual attributes.

    attrs also comes with a new module attr.setters that brings helpers that run validators, converters, or allow to freeze a subset of attributes.
    #&#8203;645 <https://github.com/python-attrs/attrs/issues/645>,
    #&#8203;660 <https://github.com/python-attrs/attrs/issues/660>

  • Provisional APIs called attr.define(), attr.mutable(), and attr.frozen() have been added.

    They are only available on Python 3.6 and later, and call attr.s() with different default values.

    If nothing comes up, they will become the official way for creating classes in 20.2.0 (see above).

    Please note that it may take some time until mypy – and other tools that have dedicated support for attrs – recognize these new APIs.
    Please do not open issues on our bug tracker, there is nothing we can do about it.
    #&#8203;666 <https://github.com/python-attrs/attrs/issues/666>_

  • We have also provisionally added attr.field() that supplants attr.ib().
    It also requires at least Python 3.6 and is keyword-only.
    Other than that, it only dropped a few arguments, but changed no defaults.

    As with attr.s(): attr.ib() is not going anywhere.
    #&#8203;669 <https://github.com/python-attrs/attrs/issues/669>_



Renovate configuration

📅 Schedule: At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

♻️ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by WhiteSource Renovate. View repository job log here.

@renovate renovate bot changed the title (削除) Update dependency attrs to v20 (削除ここまで) (追記) Update dependency attrs to v20 - autoclosed (追記ここまで) Sep 2, 2020
@renovate renovate bot closed this Sep 2, 2020
@renovate renovate bot deleted the renovate/attrs-20.x branch September 2, 2020 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /