comparison env/lib/python3.9/site-packages/attrs-20.3.0.dist-info/METADATA @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 Metadata-Version: 2.1
2 Name: attrs
3 Version: 20.3.0
4 Summary: Classes Without Boilerplate
5 Home-page: https://www.attrs.org/
6 Author: Hynek Schlawack
7 Author-email: hs@ox.cx
8 Maintainer: Hynek Schlawack
9 Maintainer-email: hs@ox.cx
10 License: MIT
11 Project-URL: Documentation, https://www.attrs.org/
12 Project-URL: Bug Tracker, https://github.com/python-attrs/attrs/issues
13 Project-URL: Source Code, https://github.com/python-attrs/attrs
14 Project-URL: Funding, https://github.com/sponsors/hynek
15 Project-URL: Tidelift, https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=pypi
16 Keywords: class,attribute,boilerplate
17 Platform: UNKNOWN
18 Classifier: Development Status :: 5 - Production/Stable
19 Classifier: Intended Audience :: Developers
20 Classifier: Natural Language :: English
21 Classifier: License :: OSI Approved :: MIT License
22 Classifier: Operating System :: OS Independent
23 Classifier: Programming Language :: Python
24 Classifier: Programming Language :: Python :: 2
25 Classifier: Programming Language :: Python :: 2.7
26 Classifier: Programming Language :: Python :: 3
27 Classifier: Programming Language :: Python :: 3.5
28 Classifier: Programming Language :: Python :: 3.6
29 Classifier: Programming Language :: Python :: 3.7
30 Classifier: Programming Language :: Python :: 3.8
31 Classifier: Programming Language :: Python :: 3.9
32 Classifier: Programming Language :: Python :: Implementation :: CPython
33 Classifier: Programming Language :: Python :: Implementation :: PyPy
34 Classifier: Topic :: Software Development :: Libraries :: Python Modules
35 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*
36 Description-Content-Type: text/x-rst
37 Provides-Extra: dev
38 Requires-Dist: coverage[toml] (>=5.0.2) ; extra == 'dev'
39 Requires-Dist: hypothesis ; extra == 'dev'
40 Requires-Dist: pympler ; extra == 'dev'
41 Requires-Dist: pytest (>=4.3.0) ; extra == 'dev'
42 Requires-Dist: six ; extra == 'dev'
43 Requires-Dist: zope.interface ; extra == 'dev'
44 Requires-Dist: furo ; extra == 'dev'
45 Requires-Dist: sphinx ; extra == 'dev'
46 Requires-Dist: pre-commit ; extra == 'dev'
47 Provides-Extra: docs
48 Requires-Dist: furo ; extra == 'docs'
49 Requires-Dist: sphinx ; extra == 'docs'
50 Requires-Dist: zope.interface ; extra == 'docs'
51 Provides-Extra: tests
52 Requires-Dist: coverage[toml] (>=5.0.2) ; extra == 'tests'
53 Requires-Dist: hypothesis ; extra == 'tests'
54 Requires-Dist: pympler ; extra == 'tests'
55 Requires-Dist: pytest (>=4.3.0) ; extra == 'tests'
56 Requires-Dist: six ; extra == 'tests'
57 Requires-Dist: zope.interface ; extra == 'tests'
58 Provides-Extra: tests_no_zope
59 Requires-Dist: coverage[toml] (>=5.0.2) ; extra == 'tests_no_zope'
60 Requires-Dist: hypothesis ; extra == 'tests_no_zope'
61 Requires-Dist: pympler ; extra == 'tests_no_zope'
62 Requires-Dist: pytest (>=4.3.0) ; extra == 'tests_no_zope'
63 Requires-Dist: six ; extra == 'tests_no_zope'
64
65 .. image:: https://www.attrs.org/en/latest/_static/attrs_logo.png
66 :alt: attrs Logo
67
68 ======================================
69 ``attrs``: Classes Without Boilerplate
70 ======================================
71
72 .. image:: https://readthedocs.org/projects/attrs/badge/?version=stable
73 :target: https://www.attrs.org/en/stable/?badge=stable
74 :alt: Documentation Status
75
76 .. image:: https://github.com/python-attrs/attrs/workflows/CI/badge.svg?branch=master
77 :target: https://github.com/python-attrs/attrs/actions?workflow=CI
78 :alt: CI Status
79
80 .. image:: https://codecov.io/github/python-attrs/attrs/branch/master/graph/badge.svg
81 :target: https://codecov.io/github/python-attrs/attrs
82 :alt: Test Coverage
83
84 .. image:: https://img.shields.io/badge/code%20style-black-000000.svg
85 :target: https://github.com/psf/black
86 :alt: Code style: black
87
88 .. teaser-begin
89
90 ``attrs`` is the Python package that will bring back the **joy** of **writing classes** by relieving you from the drudgery of implementing object protocols (aka `dunder <https://nedbatchelder.com/blog/200605/dunder.html>`_ methods).
91
92 Its main goal is to help you to write **concise** and **correct** software without slowing down your code.
93
94 .. teaser-end
95
96 For that, it gives you a class decorator and a way to declaratively define the attributes on that class:
97
98 .. -code-begin-
99
100 .. code-block:: pycon
101
102 >>> import attr
103
104 >>> @attr.s
105 ... class SomeClass(object):
106 ... a_number = attr.ib(default=42)
107 ... list_of_numbers = attr.ib(factory=list)
108 ...
109 ... def hard_math(self, another_number):
110 ... return self.a_number + sum(self.list_of_numbers) * another_number
111
112
113 >>> sc = SomeClass(1, [1, 2, 3])
114 >>> sc
115 SomeClass(a_number=1, list_of_numbers=[1, 2, 3])
116
117 >>> sc.hard_math(3)
118 19
119 >>> sc == SomeClass(1, [1, 2, 3])
120 True
121 >>> sc != SomeClass(2, [3, 2, 1])
122 True
123
124 >>> attr.asdict(sc)
125 {'a_number': 1, 'list_of_numbers': [1, 2, 3]}
126
127 >>> SomeClass()
128 SomeClass(a_number=42, list_of_numbers=[])
129
130 >>> C = attr.make_class("C", ["a", "b"])
131 >>> C("foo", "bar")
132 C(a='foo', b='bar')
133
134
135 After *declaring* your attributes ``attrs`` gives you:
136
137 - a concise and explicit overview of the class's attributes,
138 - a nice human-readable ``__repr__``,
139 - a complete set of comparison methods (equality and ordering),
140 - an initializer,
141 - and much more,
142
143 *without* writing dull boilerplate code again and again and *without* runtime performance penalties.
144
145 On Python 3.6 and later, you can often even drop the calls to ``attr.ib()`` by using `type annotations <https://www.attrs.org/en/latest/types.html>`_.
146
147 This gives you the power to use actual classes with actual types in your code instead of confusing ``tuple``\ s or `confusingly behaving <https://www.attrs.org/en/stable/why.html#namedtuples>`_ ``namedtuple``\ s.
148 Which in turn encourages you to write *small classes* that do `one thing well <https://www.destroyallsoftware.com/talks/boundaries>`_.
149 Never again violate the `single responsibility principle <https://en.wikipedia.org/wiki/Single_responsibility_principle>`_ just because implementing ``__init__`` et al is a painful drag.
150
151
152 .. -getting-help-
153
154 Getting Help
155 ============
156
157 Please use the ``python-attrs`` tag on `StackOverflow <https://stackoverflow.com/questions/tagged/python-attrs>`_ to get help.
158
159 Answering questions of your fellow developers is also a great way to help the project!
160
161
162 .. -project-information-
163
164 Project Information
165 ===================
166
167 ``attrs`` is released under the `MIT <https://choosealicense.com/licenses/mit/>`_ license,
168 its documentation lives at `Read the Docs <https://www.attrs.org/>`_,
169 the code on `GitHub <https://github.com/python-attrs/attrs>`_,
170 and the latest release on `PyPI <https://pypi.org/project/attrs/>`_.
171 It’s rigorously tested on Python 2.7, 3.5+, and PyPy.
172
173 We collect information on **third-party extensions** in our `wiki <https://github.com/python-attrs/attrs/wiki/Extensions-to-attrs>`_.
174 Feel free to browse and add your own!
175
176 If you'd like to contribute to ``attrs`` you're most welcome and we've written `a little guide <https://www.attrs.org/en/latest/contributing.html>`_ to get you started!
177
178
179 ``attrs`` for Enterprise
180 ------------------------
181
182 Available as part of the Tidelift Subscription.
183
184 The maintainers of ``attrs`` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source packages you use to build your applications.
185 Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use.
186 `Learn more. <https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo>`_
187
188
189 Release Information
190 ===================
191
192 20.3.0 (2020-11-05)
193 -------------------
194
195 Backward-incompatible Changes
196 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
197
198 - ``attr.define()``, ``attr.frozen()``, ``attr.mutable()``, and ``attr.field()`` remain **provisional**.
199
200 This release does **not** change change anything about them and they are already used widely in production though.
201
202 If you wish to use them together with mypy, you can simply drop `this plugin <https://gist.github.com/hynek/1e3844d0c99e479e716169034b5fa963#file-attrs_ng_plugin-py>`_ into your project.
203
204 Feel free to provide feedback to them in the linked issue #668.
205
206 We will release the ``attrs`` namespace once we have the feeling that the APIs have properly settled.
207 `#668 <https://github.com/python-attrs/attrs/issues/668>`_
208
209
210 Changes
211 ^^^^^^^
212
213 - ``attr.s()`` now has a *field_transformer* hook that is called for all ``Attribute``\ s and returns a (modified or updated) list of ``Attribute`` instances.
214 ``attr.asdict()`` has a *value_serializer* hook that can change the way values are converted.
215 Both hooks are meant to help with data (de-)serialization workflows.
216 `#653 <https://github.com/python-attrs/attrs/issues/653>`_
217 - ``kw_only=True`` now works on Python 2.
218 `#700 <https://github.com/python-attrs/attrs/issues/700>`_
219 - ``raise from`` now works on frozen classes on PyPy.
220 `#703 <https://github.com/python-attrs/attrs/issues/703>`_,
221 `#712 <https://github.com/python-attrs/attrs/issues/712>`_
222 - ``attr.asdict()`` and ``attr.astuple()`` now treat ``frozenset``\ s like ``set``\ s with regards to the *retain_collection_types* argument.
223 `#704 <https://github.com/python-attrs/attrs/issues/704>`_
224 - The type stubs for ``attr.s()`` and ``attr.make_class()`` are not missing the *collect_by_mro* argument anymore.
225 `#711 <https://github.com/python-attrs/attrs/issues/711>`_
226
227 `Full changelog <https://www.attrs.org/en/stable/changelog.html>`_.
228
229 Credits
230 =======
231
232 ``attrs`` is written and maintained by `Hynek Schlawack <https://hynek.me/>`_.
233
234 The development is kindly supported by `Variomedia AG <https://www.variomedia.de/>`_.
235
236 A full list of contributors can be found in `GitHub's overview <https://github.com/python-attrs/attrs/graphs/contributors>`_.
237
238 It’s the spiritual successor of `characteristic <https://characteristic.readthedocs.io/>`_ and aspires to fix some of it clunkiness and unfortunate decisions.
239 Both were inspired by Twisted’s `FancyEqMixin <https://twistedmatrix.com/documents/current/api/twisted.python.util.FancyEqMixin.html>`_ but both are implemented using class decorators because `subclassing is bad for you <https://www.youtube.com/watch?v=3MNVP9-hglc>`_, m’kay?
240
241