Title: chore(deps): Bump attrs from 20.3.0 to 21.1.0 by dependabot[bot] · Pull Request #12 · P1sec/openapi-python-client · GitHub
Open Graph Title: chore(deps): Bump attrs from 20.3.0 to 21.1.0 by dependabot[bot] · Pull Request #12 · P1sec/openapi-python-client
X Title: chore(deps): Bump attrs from 20.3.0 to 21.1.0 by dependabot[bot] · Pull Request #12 · P1sec/openapi-python-client
Description: Bumps attrs from 20.3.0 to 21.1.0.
Release notes
Sourced from attrs's releases.
21.1.0
I am extremely excited to announce the release of attrs 21.1.0.
attrs is the direct ancestor of – and the inspiration for – dataclasses in the standard library and remains the more powerful option for creating regular classes without getting bogged down with writing identical boilerplate again and again: https://www.attrs.org/
Heartfelt thanks go to my generous GitHub sponsors, companies subscribing to attrs on Tidelift, and people who bought me a coffee on Ko-fi! Support like that makes me work on FOSS on a Saturday afternoon – especially when a release drags itself like this one! <3
While this release took a bit longer than I wished for, it comes with many exciting changes. The highlights alone are longer than a usual changelog:
The next-generation APIs (@attr.define, @attr.mutable, @attr.frozen, @attr.field) are deemed stable now. The old ones aren't going anywhere, but I encourage you to check the new ones out – they're much nicer!
pyright and pylance support: Eric Traut of Microsoft was kind enough to involve me in their work on the dataclass_transforms spec.
As a result, Microsoft's type checker pyright will work with this attrs release, and so will their Python language server pylance which should be exciting to VS Code users.
Currently it only supports a subset of attrs's features, but it's the most important ones and more will most likely follow. Some of the limitations are documented in our documentation on type annotations.
Customization of field comparison. This is something especially NumPy users have been asking for for a long time: you can now fully customize how a field is compared. We also ship a helper to avoid boilerplate code. So if you'd like to have an object with a NumPy array that compares correctly, this is the way:
import attr
import numpy
@attr.define
class C:
an_array = attr.field(eq=attr.cmp_using(eq=numpy.array_equal))
Check out the new documentation on comparison for details.
To make it more ergonomic, I've decided to un-deprecate the cmp argument again, so you can customize eq and order in one go. Sorry about the trouble! The cmp attribute remains deprecated.
New powerful __init__ helpers:
If attrs deduces you don't want it to write a __init__ for you, it will create an __attrs_init__ instead that you can call from your custom __init__.
If attrs finds a __attrs_pre_init__, it will call it without any arguments before doing any initializations. This is really only useful if you want to run super().__init__(), but that's a use-case people have asked for for years!
See Hooking Yourself Into Initialization for details.
In preparation for the (rescinded) plan to make from __future__ import annotations the default in Python 3.10, attr.resolve_types() can now also be used to resolve types inside of field_transformers.
A Look Ahead
For the next release we've got even bigger plans! By stabilizing the next-generation APIs we can finally go the last step, I've been talking for years (yeah, sorry): import attrs.
attrs's playful APIs (@attr.s, @attr.ib) lost a bit of their charm as the scope of the package grew – especially after the introduction of type annotations.
While the old APIs aren't going anywhere, in the next feature release there will be additionally an attrs package that you can use as an alternative to attr. No more attr.Factory!
The new package gives us the opportunity to rethink the defaults of some functions. So if you have any pet peeves, please air them on #487.
Full Changelog
... (truncated)
Changelog
Sourced from attrs's changelog.
21.1.0 (2021-05-06)
Deprecations
^^^^^^^^^^^^
The long-awaited, much-talked-about, little-delivered import attrs is finally upon us!
Since the NG APIs have now been proclaimed stable, the next release of attrs will allow you to actually import attrs.
We're taking this opportunity to replace some defaults in our APIs that made sense in 2015, but don't in 2021.
So please, if you have any pet peeves about defaults in attrs's APIs, now is the time to air your grievances in #487!
We're not gonna get such a chance for a second time, without breaking our backward-compatibility guarantees, or long deprecation cycles.
Therefore, speak now or forever hold you peace!
[#487](https://github.com/python-attrs/attrs/issues/487)
Open Graph Description: Bumps attrs from 20.3.0 to 21.1.0. Release notes Sourced from attrs's releases. 21.1.0 I am extremely excited to announce the release of attrs 21.1.0. attrs is the direct ancestor of – and th...
X Description: Bumps attrs from 20.3.0 to 21.1.0. Release notes Sourced from attrs's releases. 21.1.0 I am extremely excited to announce the release of attrs 21.1.0. attrs is the direct ancestor of – an...
Opengraph URL: https://github.com/P1sec/openapi-python-client/pull/12
X: @github
Domain: patch-diff.githubusercontent.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:3b7257fd-b473-eda7-94b5-4074293c465a |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | A29A:247D5D:4538A5A:5EFB241:6980D5A9 |
| html-safe-nonce | 874af947b4c9a4bdcee68ab79c6ae63532a95b3f166630b22b85a919fc03f83c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMjlBOjI0N0Q1RDo0NTM4QTVBOjVFRkIyNDE6Njk4MEQ1QTkiLCJ2aXNpdG9yX2lkIjoiNjM3ODM5ODIxMjk5NDE2MDA0MSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 092a909556e4ca41b89d79fa5d826579318aec5517983dec0dd995aae9b74f70 |
| hovercard-subject-tag | pull_request:632400041 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/P1sec/openapi-python-client/pull/12/files |
| twitter:image | https://avatars.githubusercontent.com/in/29110?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/in/29110?s=400&v=4 |
| og:image:alt | Bumps attrs from 20.3.0 to 21.1.0. Release notes Sourced from attrs's releases. 21.1.0 I am extremely excited to announce the release of attrs 21.1.0. attrs is the direct ancestor of – and th... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 17bc0924c8593587ed4a8ae12c6076d0895c5516aaa44daccbb68ede54878b1f |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/P1sec/openapi-python-client git https://github.com/P1sec/openapi-python-client.git |
| octolytics-dimension-user_id | 856786 |
| octolytics-dimension-user_login | P1sec |
| octolytics-dimension-repository_id | 343377673 |
| octolytics-dimension-repository_nwo | P1sec/openapi-python-client |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 240776275 |
| octolytics-dimension-repository_parent_nwo | openapi-generators/openapi-python-client |
| octolytics-dimension-repository_network_root_id | 240776275 |
| octolytics-dimension-repository_network_root_nwo | openapi-generators/openapi-python-client |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 602fb6e6fec65cf4baabc1305db1830bc609c154 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width