Browse Source

Restoring authorship annotation for <abodrov@yandex-team.ru>. Commit 2 of 2.

abodrov 3 years ago
parent
commit
f02a874a72

+ 1 - 1
contrib/libs/ya.make

@@ -401,7 +401,7 @@ IF (OS_LINUX)
         libnfnetlink
         libnetfilter_log
         libnetfilter_conntrack
-        openmpi 
+        openmpi
         sdbus-cpp
         systemd
         uuid

+ 28 - 28
contrib/python/attrs/.dist-info/METADATA

@@ -30,7 +30,7 @@ Classifier: Programming Language :: Python :: 3.5
 Classifier: Programming Language :: Python :: 3.6
 Classifier: Programming Language :: Python :: 3.7
 Classifier: Programming Language :: Python :: 3.8
-Classifier: Programming Language :: Python :: 3.9 
+Classifier: Programming Language :: Python :: 3.9
 Classifier: Programming Language :: Python :: 3.10
 Classifier: Programming Language :: Python :: Implementation :: CPython
 Classifier: Programming Language :: Python :: Implementation :: PyPy
@@ -38,7 +38,7 @@ Classifier: Topic :: Software Development :: Libraries :: Python Modules
 Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*
 Description-Content-Type: text/x-rst
 Provides-Extra: dev
-Requires-Dist: coverage[toml] (>=5.0.2) ; extra == 'dev' 
+Requires-Dist: coverage[toml] (>=5.0.2) ; extra == 'dev'
 Requires-Dist: hypothesis ; extra == 'dev'
 Requires-Dist: pympler ; extra == 'dev'
 Requires-Dist: pytest (>=4.3.0) ; extra == 'dev'
@@ -56,7 +56,7 @@ Requires-Dist: sphinx ; extra == 'docs'
 Requires-Dist: zope.interface ; extra == 'docs'
 Requires-Dist: sphinx-notfound-page ; extra == 'docs'
 Provides-Extra: tests
-Requires-Dist: coverage[toml] (>=5.0.2) ; extra == 'tests' 
+Requires-Dist: coverage[toml] (>=5.0.2) ; extra == 'tests'
 Requires-Dist: hypothesis ; extra == 'tests'
 Requires-Dist: pympler ; extra == 'tests'
 Requires-Dist: pytest (>=4.3.0) ; extra == 'tests'
@@ -64,12 +64,12 @@ Requires-Dist: six ; extra == 'tests'
 Requires-Dist: mypy ; extra == 'tests'
 Requires-Dist: pytest-mypy-plugins ; extra == 'tests'
 Requires-Dist: zope.interface ; extra == 'tests'
-Provides-Extra: tests_no_zope 
-Requires-Dist: coverage[toml] (>=5.0.2) ; extra == 'tests_no_zope' 
-Requires-Dist: hypothesis ; extra == 'tests_no_zope' 
-Requires-Dist: pympler ; extra == 'tests_no_zope' 
-Requires-Dist: pytest (>=4.3.0) ; extra == 'tests_no_zope' 
-Requires-Dist: six ; extra == 'tests_no_zope' 
+Provides-Extra: tests_no_zope
+Requires-Dist: coverage[toml] (>=5.0.2) ; extra == 'tests_no_zope'
+Requires-Dist: hypothesis ; extra == 'tests_no_zope'
+Requires-Dist: pympler ; extra == 'tests_no_zope'
+Requires-Dist: pytest (>=4.3.0) ; extra == 'tests_no_zope'
+Requires-Dist: six ; extra == 'tests_no_zope'
 Requires-Dist: mypy ; extra == 'tests_no_zope'
 Requires-Dist: pytest-mypy-plugins ; extra == 'tests_no_zope'
 
@@ -83,7 +83,7 @@ Requires-Dist: pytest-mypy-plugins ; extra == 'tests_no_zope'
 
 Its main goal is to help you to write **concise** and **correct** software without slowing down your code.
 
-.. teaser-end 
+.. teaser-end
 
 For that, it gives you a class decorator and a way to declaratively define the attributes on that class:
 
@@ -141,7 +141,7 @@ Which in turn encourages you to write *small classes* that do `one thing well <h
 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.
 
 
-.. -getting-help- 
+.. -getting-help-
 
 Getting Help
 ============
@@ -151,8 +151,8 @@ Please use the ``python-attrs`` tag on `StackOverflow <https://stackoverflow.com
 Answering questions of your fellow developers is also a great way to help the project!
 
 
-.. -project-information- 
- 
+.. -project-information-
+
 Project Information
 ===================
 
@@ -160,7 +160,7 @@ Project Information
 its documentation lives at `Read the Docs <https://www.attrs.org/>`_,
 the code on `GitHub <https://github.com/python-attrs/attrs>`_,
 and the latest release on `PyPI <https://pypi.org/project/attrs/>`_.
-It’s rigorously tested on Python 2.7, 3.5+, and PyPy. 
+It’s rigorously tested on Python 2.7, 3.5+, and PyPy.
 
 We collect information on **third-party extensions** in our `wiki <https://github.com/python-attrs/attrs/wiki/Extensions-to-attrs>`_.
 Feel free to browse and add your own!
@@ -168,32 +168,32 @@ Feel free to browse and add your own!
 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!
 
 
-``attrs`` for Enterprise 
------------------------- 
- 
-Available as part of the Tidelift Subscription. 
- 
-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. 
-Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. 
-`Learn more. <https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo>`_ 
- 
- 
+``attrs`` for Enterprise
+------------------------
+
+Available as part of the Tidelift Subscription.
+
+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.
+Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use.
+`Learn more. <https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo>`_
+
+
 Release Information
 ===================
 
 21.2.0 (2021-05-07)
 -------------------
 
-Backward-incompatible Changes 
-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 
- 
+Backward-incompatible Changes
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
 - We had to revert the recursive feature for ``attr.evolve()`` because it broke some use-cases -- sorry!
   `#806 <https://github.com/python-attrs/attrs/issues/806>`_
 - Python 3.4 is now blocked using packaging metadata because ``attrs`` can't be imported on it anymore.
   To ensure that 3.4 users can keep installing  ``attrs`` easily, we will `yank <https://pypi.org/help/#yanked>`_ 21.1.0 from PyPI.
   This has **no** consequences if you pin ``attrs`` to 21.1.0.
   `#807 <https://github.com/python-attrs/attrs/issues/807>`_
- 
+
 `Full changelog <https://www.attrs.org/en/stable/changelog.html>`_.
 
 Credits

+ 15 - 15
contrib/python/attrs/README.rst

@@ -27,7 +27,7 @@
 
 Its main goal is to help you to write **concise** and **correct** software without slowing down your code.
 
-.. teaser-end 
+.. teaser-end
 
 For that, it gives you a class decorator and a way to declaratively define the attributes on that class:
 
@@ -85,7 +85,7 @@ Which in turn encourages you to write *small classes* that do `one thing well <h
 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.
 
 
-.. -getting-help- 
+.. -getting-help-
 
 Getting Help
 ============
@@ -95,8 +95,8 @@ Please use the ``python-attrs`` tag on `StackOverflow <https://stackoverflow.com
 Answering questions of your fellow developers is also a great way to help the project!
 
 
-.. -project-information- 
- 
+.. -project-information-
+
 Project Information
 ===================
 
@@ -104,19 +104,19 @@ Project Information
 its documentation lives at `Read the Docs <https://www.attrs.org/>`_,
 the code on `GitHub <https://github.com/python-attrs/attrs>`_,
 and the latest release on `PyPI <https://pypi.org/project/attrs/>`_.
-It’s rigorously tested on Python 2.7, 3.5+, and PyPy. 
+It’s rigorously tested on Python 2.7, 3.5+, and PyPy.
 
 We collect information on **third-party extensions** in our `wiki <https://github.com/python-attrs/attrs/wiki/Extensions-to-attrs>`_.
 Feel free to browse and add your own!
 
 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!
- 
- 
-``attrs`` for Enterprise 
------------------------- 
- 
-Available as part of the Tidelift Subscription. 
- 
-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. 
-Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. 
-`Learn more. <https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo>`_ 
+
+
+``attrs`` for Enterprise
+------------------------
+
+Available as part of the Tidelift Subscription.
+
+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.
+Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use.
+`Learn more. <https://tidelift.com/subscription/pkg/pypi-attrs?utm_source=pypi-attrs&utm_medium=referral&utm_campaign=enterprise&utm_term=repo>`_

+ 11 - 11
contrib/python/attrs/attr/__init__.py

@@ -1,13 +1,13 @@
 from __future__ import absolute_import, division, print_function
 
-import sys 
- 
+import sys
+
 from functools import partial
 
-from . import converters, exceptions, filters, setters, validators 
+from . import converters, exceptions, filters, setters, validators
 from ._cmp import cmp_using
 from ._config import get_run_validators, set_run_validators
-from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types 
+from ._funcs import asdict, assoc, astuple, evolve, has, resolve_types
 from ._make import (
     NOTHING,
     Attribute,
@@ -64,15 +64,15 @@ __all__ = [
     "has",
     "ib",
     "make_class",
-    "resolve_types", 
+    "resolve_types",
     "s",
     "set_run_validators",
-    "setters", 
+    "setters",
     "validate",
     "validators",
 ]
- 
-if sys.version_info[:2] >= (3, 6): 
-    from ._next_gen import define, field, frozen, mutable 
- 
-    __all__.extend((define, field, frozen, mutable)) 
+
+if sys.version_info[:2] >= (3, 6):
+    from ._next_gen import define, field, frozen, mutable
+
+    __all__.extend((define, field, frozen, mutable))

+ 154 - 154
contrib/python/attrs/attr/__init__.pyi

@@ -20,7 +20,7 @@ from typing import (
 from . import converters as converters
 from . import exceptions as exceptions
 from . import filters as filters
-from . import setters as setters 
+from . import setters as setters
 from . import validators as validators
 from ._version_info import VersionInfo
 
@@ -41,26 +41,26 @@ _C = TypeVar("_C", bound=type)
 
 _EqOrderType = Union[bool, Callable[[Any], Any]]
 _ValidatorType = Callable[[Any, Attribute[_T], _T], Any]
-_ConverterType = Callable[[Any], Any] 
+_ConverterType = Callable[[Any], Any]
 _FilterType = Callable[[Attribute[_T], _T], bool]
 _ReprType = Callable[[Any], str]
 _ReprArgType = Union[bool, _ReprType]
-_OnSetAttrType = Callable[[Any, Attribute[Any], Any], Any] 
-_OnSetAttrArgType = Union[ 
-    _OnSetAttrType, List[_OnSetAttrType], setters._NoOpType 
-] 
+_OnSetAttrType = Callable[[Any, Attribute[Any], Any], Any]
+_OnSetAttrArgType = Union[
+    _OnSetAttrType, List[_OnSetAttrType], setters._NoOpType
+]
 _FieldTransformer = Callable[[type, List[Attribute[Any]]], List[Attribute[Any]]]
-# FIXME: in reality, if multiple validators are passed they must be in a list 
-# or tuple, but those are invariant and so would prevent subtypes of 
-# _ValidatorType from working when passed in a list or tuple. 
+# FIXME: in reality, if multiple validators are passed they must be in a list
+# or tuple, but those are invariant and so would prevent subtypes of
+# _ValidatorType from working when passed in a list or tuple.
 _ValidatorArgType = Union[_ValidatorType[_T], Sequence[_ValidatorType[_T]]]
 
 # _make --
 
 NOTHING: object
 
-# NOTE: Factory lies about its return type to make this possible: 
-# `x: List[int] # = Factory(list)` 
+# NOTE: Factory lies about its return type to make this possible:
+# `x: List[int] # = Factory(list)`
 # Work around mypy issue #4554 in the common case by using an overload.
 if sys.version_info >= (3, 8):
     from typing import Literal
@@ -112,19 +112,19 @@ class Attribute(Generic[_T]):
     order: _EqOrderType
     hash: Optional[bool]
     init: bool
-    converter: Optional[_ConverterType] 
+    converter: Optional[_ConverterType]
     metadata: Dict[Any, Any]
     type: Optional[Type[_T]]
     kw_only: bool
-    on_setattr: _OnSetAttrType 
+    on_setattr: _OnSetAttrType
 
     def evolve(self, **changes: Any) -> "Attribute[Any]": ...
 
 # NOTE: We had several choices for the annotation to use for type arg:
 # 1) Type[_T]
 #   - Pros: Handles simple cases correctly
-#   - Cons: Might produce less informative errors in the case of conflicting 
-#     TypeVars e.g. `attr.ib(default='bad', type=int)` 
+#   - Cons: Might produce less informative errors in the case of conflicting
+#     TypeVars e.g. `attr.ib(default='bad', type=int)`
 # 2) Callable[..., _T]
 #   - Pros: Better error messages than #1 for conflicting TypeVars
 #   - Cons: Terrible error messages for validator checks.
@@ -142,8 +142,8 @@ class Attribute(Generic[_T]):
 # This makes this type of assignments possible:
 #     x: int = attr(8)
 #
-# This form catches explicit None or no default but with no other arguments 
-# returns Any. 
+# This form catches explicit None or no default but with no other arguments
+# returns Any.
 @overload
 def attrib(
     default: None = ...,
@@ -159,11 +159,11 @@ def attrib(
     kw_only: bool = ...,
     eq: Optional[_EqOrderType] = ...,
     order: Optional[_EqOrderType] = ...,
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
 ) -> Any: ...
 
-# This form catches an explicit None or no default and infers the type from the 
-# other arguments. 
+# This form catches an explicit None or no default and infers the type from the
+# other arguments.
 @overload
 def attrib(
     default: None = ...,
@@ -174,12 +174,12 @@ def attrib(
     init: bool = ...,
     metadata: Optional[Mapping[Any, Any]] = ...,
     type: Optional[Type[_T]] = ...,
-    converter: Optional[_ConverterType] = ..., 
+    converter: Optional[_ConverterType] = ...,
     factory: Optional[Callable[[], _T]] = ...,
     kw_only: bool = ...,
     eq: Optional[_EqOrderType] = ...,
     order: Optional[_EqOrderType] = ...,
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
 ) -> _T: ...
 
 # This form catches an explicit default argument.
@@ -193,12 +193,12 @@ def attrib(
     init: bool = ...,
     metadata: Optional[Mapping[Any, Any]] = ...,
     type: Optional[Type[_T]] = ...,
-    converter: Optional[_ConverterType] = ..., 
+    converter: Optional[_ConverterType] = ...,
     factory: Optional[Callable[[], _T]] = ...,
     kw_only: bool = ...,
     eq: Optional[_EqOrderType] = ...,
     order: Optional[_EqOrderType] = ...,
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
 ) -> _T: ...
 
 # This form covers type=non-Type: e.g. forward references (str), Any
@@ -212,85 +212,85 @@ def attrib(
     init: bool = ...,
     metadata: Optional[Mapping[Any, Any]] = ...,
     type: object = ...,
-    converter: Optional[_ConverterType] = ..., 
+    converter: Optional[_ConverterType] = ...,
     factory: Optional[Callable[[], _T]] = ...,
     kw_only: bool = ...,
     eq: Optional[_EqOrderType] = ...,
     order: Optional[_EqOrderType] = ...,
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
 ) -> Any: ...
 @overload
-def field( 
-    *, 
-    default: None = ..., 
-    validator: None = ..., 
-    repr: _ReprArgType = ..., 
-    hash: Optional[bool] = ..., 
-    init: bool = ..., 
-    metadata: Optional[Mapping[Any, Any]] = ..., 
-    converter: None = ..., 
-    factory: None = ..., 
-    kw_only: bool = ..., 
-    eq: Optional[bool] = ..., 
-    order: Optional[bool] = ..., 
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
-) -> Any: ... 
- 
-# This form catches an explicit None or no default and infers the type from the 
-# other arguments. 
-@overload 
-def field( 
-    *, 
-    default: None = ..., 
-    validator: Optional[_ValidatorArgType[_T]] = ..., 
-    repr: _ReprArgType = ..., 
-    hash: Optional[bool] = ..., 
-    init: bool = ..., 
-    metadata: Optional[Mapping[Any, Any]] = ..., 
-    converter: Optional[_ConverterType] = ..., 
-    factory: Optional[Callable[[], _T]] = ..., 
-    kw_only: bool = ..., 
+def field(
+    *,
+    default: None = ...,
+    validator: None = ...,
+    repr: _ReprArgType = ...,
+    hash: Optional[bool] = ...,
+    init: bool = ...,
+    metadata: Optional[Mapping[Any, Any]] = ...,
+    converter: None = ...,
+    factory: None = ...,
+    kw_only: bool = ...,
+    eq: Optional[bool] = ...,
+    order: Optional[bool] = ...,
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
+) -> Any: ...
+
+# This form catches an explicit None or no default and infers the type from the
+# other arguments.
+@overload
+def field(
+    *,
+    default: None = ...,
+    validator: Optional[_ValidatorArgType[_T]] = ...,
+    repr: _ReprArgType = ...,
+    hash: Optional[bool] = ...,
+    init: bool = ...,
+    metadata: Optional[Mapping[Any, Any]] = ...,
+    converter: Optional[_ConverterType] = ...,
+    factory: Optional[Callable[[], _T]] = ...,
+    kw_only: bool = ...,
     eq: Optional[_EqOrderType] = ...,
     order: Optional[_EqOrderType] = ...,
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
-) -> _T: ... 
- 
-# This form catches an explicit default argument. 
-@overload 
-def field( 
-    *, 
-    default: _T, 
-    validator: Optional[_ValidatorArgType[_T]] = ..., 
-    repr: _ReprArgType = ..., 
-    hash: Optional[bool] = ..., 
-    init: bool = ..., 
-    metadata: Optional[Mapping[Any, Any]] = ..., 
-    converter: Optional[_ConverterType] = ..., 
-    factory: Optional[Callable[[], _T]] = ..., 
-    kw_only: bool = ..., 
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
+) -> _T: ...
+
+# This form catches an explicit default argument.
+@overload
+def field(
+    *,
+    default: _T,
+    validator: Optional[_ValidatorArgType[_T]] = ...,
+    repr: _ReprArgType = ...,
+    hash: Optional[bool] = ...,
+    init: bool = ...,
+    metadata: Optional[Mapping[Any, Any]] = ...,
+    converter: Optional[_ConverterType] = ...,
+    factory: Optional[Callable[[], _T]] = ...,
+    kw_only: bool = ...,
     eq: Optional[_EqOrderType] = ...,
     order: Optional[_EqOrderType] = ...,
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
-) -> _T: ... 
- 
-# This form covers type=non-Type: e.g. forward references (str), Any 
-@overload 
-def field( 
-    *, 
-    default: Optional[_T] = ..., 
-    validator: Optional[_ValidatorArgType[_T]] = ..., 
-    repr: _ReprArgType = ..., 
-    hash: Optional[bool] = ..., 
-    init: bool = ..., 
-    metadata: Optional[Mapping[Any, Any]] = ..., 
-    converter: Optional[_ConverterType] = ..., 
-    factory: Optional[Callable[[], _T]] = ..., 
-    kw_only: bool = ..., 
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
+) -> _T: ...
+
+# This form covers type=non-Type: e.g. forward references (str), Any
+@overload
+def field(
+    *,
+    default: Optional[_T] = ...,
+    validator: Optional[_ValidatorArgType[_T]] = ...,
+    repr: _ReprArgType = ...,
+    hash: Optional[bool] = ...,
+    init: bool = ...,
+    metadata: Optional[Mapping[Any, Any]] = ...,
+    converter: Optional[_ConverterType] = ...,
+    factory: Optional[Callable[[], _T]] = ...,
+    kw_only: bool = ...,
     eq: Optional[_EqOrderType] = ...,
     order: Optional[_EqOrderType] = ...,
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
-) -> Any: ... 
-@overload 
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
+) -> Any: ...
+@overload
 @__dataclass_transform__(order_default=True, field_descriptors=(attrib, field))
 def attrs(
     maybe_cls: _C,
@@ -310,10 +310,10 @@ def attrs(
     auto_exc: bool = ...,
     eq: Optional[_EqOrderType] = ...,
     order: Optional[_EqOrderType] = ...,
-    auto_detect: bool = ..., 
+    auto_detect: bool = ...,
     collect_by_mro: bool = ...,
-    getstate_setstate: Optional[bool] = ..., 
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
+    getstate_setstate: Optional[bool] = ...,
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
     field_transformer: Optional[_FieldTransformer] = ...,
 ) -> _C: ...
 @overload
@@ -336,64 +336,64 @@ def attrs(
     auto_exc: bool = ...,
     eq: Optional[_EqOrderType] = ...,
     order: Optional[_EqOrderType] = ...,
-    auto_detect: bool = ..., 
+    auto_detect: bool = ...,
     collect_by_mro: bool = ...,
-    getstate_setstate: Optional[bool] = ..., 
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
+    getstate_setstate: Optional[bool] = ...,
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
     field_transformer: Optional[_FieldTransformer] = ...,
 ) -> Callable[[_C], _C]: ...
-@overload 
+@overload
 @__dataclass_transform__(field_descriptors=(attrib, field))
-def define( 
-    maybe_cls: _C, 
-    *, 
-    these: Optional[Dict[str, Any]] = ..., 
-    repr: bool = ..., 
-    hash: Optional[bool] = ..., 
-    init: bool = ..., 
-    slots: bool = ..., 
-    frozen: bool = ..., 
-    weakref_slot: bool = ..., 
-    str: bool = ..., 
-    auto_attribs: bool = ..., 
-    kw_only: bool = ..., 
-    cache_hash: bool = ..., 
-    auto_exc: bool = ..., 
-    eq: Optional[bool] = ..., 
-    order: Optional[bool] = ..., 
-    auto_detect: bool = ..., 
-    getstate_setstate: Optional[bool] = ..., 
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
+def define(
+    maybe_cls: _C,
+    *,
+    these: Optional[Dict[str, Any]] = ...,
+    repr: bool = ...,
+    hash: Optional[bool] = ...,
+    init: bool = ...,
+    slots: bool = ...,
+    frozen: bool = ...,
+    weakref_slot: bool = ...,
+    str: bool = ...,
+    auto_attribs: bool = ...,
+    kw_only: bool = ...,
+    cache_hash: bool = ...,
+    auto_exc: bool = ...,
+    eq: Optional[bool] = ...,
+    order: Optional[bool] = ...,
+    auto_detect: bool = ...,
+    getstate_setstate: Optional[bool] = ...,
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
     field_transformer: Optional[_FieldTransformer] = ...,
-) -> _C: ... 
-@overload 
+) -> _C: ...
+@overload
 @__dataclass_transform__(field_descriptors=(attrib, field))
-def define( 
-    maybe_cls: None = ..., 
-    *, 
-    these: Optional[Dict[str, Any]] = ..., 
-    repr: bool = ..., 
-    hash: Optional[bool] = ..., 
-    init: bool = ..., 
-    slots: bool = ..., 
-    frozen: bool = ..., 
-    weakref_slot: bool = ..., 
-    str: bool = ..., 
-    auto_attribs: bool = ..., 
-    kw_only: bool = ..., 
-    cache_hash: bool = ..., 
-    auto_exc: bool = ..., 
-    eq: Optional[bool] = ..., 
-    order: Optional[bool] = ..., 
-    auto_detect: bool = ..., 
-    getstate_setstate: Optional[bool] = ..., 
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
+def define(
+    maybe_cls: None = ...,
+    *,
+    these: Optional[Dict[str, Any]] = ...,
+    repr: bool = ...,
+    hash: Optional[bool] = ...,
+    init: bool = ...,
+    slots: bool = ...,
+    frozen: bool = ...,
+    weakref_slot: bool = ...,
+    str: bool = ...,
+    auto_attribs: bool = ...,
+    kw_only: bool = ...,
+    cache_hash: bool = ...,
+    auto_exc: bool = ...,
+    eq: Optional[bool] = ...,
+    order: Optional[bool] = ...,
+    auto_detect: bool = ...,
+    getstate_setstate: Optional[bool] = ...,
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
     field_transformer: Optional[_FieldTransformer] = ...,
-) -> Callable[[_C], _C]: ... 
+) -> Callable[[_C], _C]: ...
+
+mutable = define
+frozen = define  # they differ only in their defaults
 
-mutable = define 
-frozen = define  # they differ only in their defaults 
- 
 # TODO: add support for returning NamedTuple from the mypy plugin
 class _Fields(Tuple[Attribute[Any], ...]):
     def __getattr__(self, name: str) -> Attribute[Any]: ...
@@ -401,16 +401,16 @@ class _Fields(Tuple[Attribute[Any], ...]):
 def fields(cls: type) -> _Fields: ...
 def fields_dict(cls: type) -> Dict[str, Attribute[Any]]: ...
 def validate(inst: Any) -> None: ...
-def resolve_types( 
-    cls: _C, 
-    globalns: Optional[Dict[str, Any]] = ..., 
-    localns: Optional[Dict[str, Any]] = ..., 
+def resolve_types(
+    cls: _C,
+    globalns: Optional[Dict[str, Any]] = ...,
+    localns: Optional[Dict[str, Any]] = ...,
     attribs: Optional[List[Attribute[Any]]] = ...,
-) -> _C: ... 
+) -> _C: ...
 
 # TODO: add support for returning a proper attrs class from the mypy plugin
-# we use Any instead of _CountingAttr so that e.g. `make_class('Foo', 
-# [attr.ib()])` is valid 
+# we use Any instead of _CountingAttr so that e.g. `make_class('Foo',
+# [attr.ib()])` is valid
 def make_class(
     name: str,
     attrs: Union[List[str], Tuple[str, ...], Dict[str, Any]],
@@ -431,15 +431,15 @@ def make_class(
     eq: Optional[_EqOrderType] = ...,
     order: Optional[_EqOrderType] = ...,
     collect_by_mro: bool = ...,
-    on_setattr: Optional[_OnSetAttrArgType] = ..., 
+    on_setattr: Optional[_OnSetAttrArgType] = ...,
     field_transformer: Optional[_FieldTransformer] = ...,
 ) -> type: ...
 
 # _funcs --
 
 # TODO: add support for returning TypedDict from the mypy plugin
-# FIXME: asdict/astuple do not honor their factory args. Waiting on one of 
-# these: 
+# FIXME: asdict/astuple do not honor their factory args. Waiting on one of
+# these:
 # https://github.com/python/mypy/issues/4236
 # https://github.com/python/typing/issues/253
 def asdict(

+ 2 - 2
contrib/python/attrs/attr/_compat.py

@@ -21,8 +21,8 @@ else:
 if PY2:
     from collections import Mapping, Sequence
 
-    from UserDict import IterableUserDict 
- 
+    from UserDict import IterableUserDict
+
     # We 'bundle' isclass instead of using inspect as importing inspect is
     # fairly expensive (order of 10-15 ms for a modern machine in 2016)
     def isclass(klass):

+ 45 - 45
contrib/python/attrs/attr/_funcs.py

@@ -339,57 +339,57 @@ def evolve(inst, **changes):
         init_name = attr_name if attr_name[0] != "_" else attr_name[1:]
         if init_name not in changes:
             changes[init_name] = getattr(inst, attr_name)
- 
+
     return cls(**changes)
- 
- 
+
+
 def resolve_types(cls, globalns=None, localns=None, attribs=None):
-    """ 
-    Resolve any strings and forward annotations in type annotations. 
- 
-    This is only required if you need concrete types in `Attribute`'s *type* 
-    field. In other words, you don't need to resolve your types if you only 
-    use them for static type checking. 
- 
-    With no arguments, names will be looked up in the module in which the class 
-    was created. If this is not what you want, e.g. if the name only exists 
-    inside a method, you may pass *globalns* or *localns* to specify other 
-    dictionaries in which to look up these names. See the docs of 
-    `typing.get_type_hints` for more details. 
- 
-    :param type cls: Class to resolve. 
-    :param Optional[dict] globalns: Dictionary containing global variables. 
-    :param Optional[dict] localns: Dictionary containing local variables. 
+    """
+    Resolve any strings and forward annotations in type annotations.
+
+    This is only required if you need concrete types in `Attribute`'s *type*
+    field. In other words, you don't need to resolve your types if you only
+    use them for static type checking.
+
+    With no arguments, names will be looked up in the module in which the class
+    was created. If this is not what you want, e.g. if the name only exists
+    inside a method, you may pass *globalns* or *localns* to specify other
+    dictionaries in which to look up these names. See the docs of
+    `typing.get_type_hints` for more details.
+
+    :param type cls: Class to resolve.
+    :param Optional[dict] globalns: Dictionary containing global variables.
+    :param Optional[dict] localns: Dictionary containing local variables.
     :param Optional[list] attribs: List of attribs for the given class.
         This is necessary when calling from inside a ``field_transformer``
         since *cls* is not an ``attrs`` class yet.
- 
-    :raise TypeError: If *cls* is not a class. 
-    :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs`` 
+
+    :raise TypeError: If *cls* is not a class.
+    :raise attr.exceptions.NotAnAttrsClassError: If *cls* is not an ``attrs``
         class and you didn't pass any attribs.
-    :raise NameError: If types cannot be resolved because of missing variables. 
- 
-    :returns: *cls* so you can use this function also as a class decorator. 
-        Please note that you have to apply it **after** `attr.s`. That means 
-        the decorator has to come in the line **before** `attr.s`. 
- 
-    ..  versionadded:: 20.1.0 
+    :raise NameError: If types cannot be resolved because of missing variables.
+
+    :returns: *cls* so you can use this function also as a class decorator.
+        Please note that you have to apply it **after** `attr.s`. That means
+        the decorator has to come in the line **before** `attr.s`.
+
+    ..  versionadded:: 20.1.0
     ..  versionadded:: 21.1.0 *attribs*
 
-    """ 
-    try: 
-        # Since calling get_type_hints is expensive we cache whether we've 
-        # done it already. 
-        cls.__attrs_types_resolved__ 
-    except AttributeError: 
-        import typing 
- 
-        hints = typing.get_type_hints(cls, globalns=globalns, localns=localns) 
+    """
+    try:
+        # Since calling get_type_hints is expensive we cache whether we've
+        # done it already.
+        cls.__attrs_types_resolved__
+    except AttributeError:
+        import typing
+
+        hints = typing.get_type_hints(cls, globalns=globalns, localns=localns)
         for field in fields(cls) if attribs is None else attribs:
-            if field.name in hints: 
-                # Since fields have been frozen we must work around it. 
-                _obj_setattr(field, "type", hints[field.name]) 
-        cls.__attrs_types_resolved__ = True 
- 
-    # Return the class so you can use it as a decorator too. 
-    return cls 
+            if field.name in hints:
+                # Since fields have been frozen we must work around it.
+                _obj_setattr(field, "type", hints[field.name])
+        cls.__attrs_types_resolved__ = True
+
+    # Return the class so you can use it as a decorator too.
+    return cls

File diff suppressed because it is too large
+ 362 - 362
contrib/python/attrs/attr/_make.py


+ 152 - 152
contrib/python/attrs/attr/_next_gen.py

@@ -1,158 +1,158 @@
-""" 
+"""
 These are Python 3.6+-only and keyword-only APIs that call `attr.s` and
 `attr.ib` with different default values.
-""" 
- 
-from functools import partial 
- 
-from attr.exceptions import UnannotatedAttributeError 
- 
-from . import setters 
-from ._make import NOTHING, _frozen_setattrs, attrib, attrs 
- 
- 
-def define( 
-    maybe_cls=None, 
-    *, 
-    these=None, 
-    repr=None, 
-    hash=None, 
-    init=None, 
-    slots=True, 
-    frozen=False, 
-    weakref_slot=True, 
-    str=False, 
-    auto_attribs=None, 
-    kw_only=False, 
-    cache_hash=False, 
-    auto_exc=True, 
-    eq=None, 
-    order=False, 
-    auto_detect=True, 
-    getstate_setstate=None, 
-    on_setattr=None, 
+"""
+
+from functools import partial
+
+from attr.exceptions import UnannotatedAttributeError
+
+from . import setters
+from ._make import NOTHING, _frozen_setattrs, attrib, attrs
+
+
+def define(
+    maybe_cls=None,
+    *,
+    these=None,
+    repr=None,
+    hash=None,
+    init=None,
+    slots=True,
+    frozen=False,
+    weakref_slot=True,
+    str=False,
+    auto_attribs=None,
+    kw_only=False,
+    cache_hash=False,
+    auto_exc=True,
+    eq=None,
+    order=False,
+    auto_detect=True,
+    getstate_setstate=None,
+    on_setattr=None,
     field_transformer=None,
-): 
-    r""" 
-    The only behavioral differences are the handling of the *auto_attribs* 
-    option: 
- 
-    :param Optional[bool] auto_attribs: If set to `True` or `False`, it behaves 
-       exactly like `attr.s`. If left `None`, `attr.s` will try to guess: 
- 
+):
+    r"""
+    The only behavioral differences are the handling of the *auto_attribs*
+    option:
+
+    :param Optional[bool] auto_attribs: If set to `True` or `False`, it behaves
+       exactly like `attr.s`. If left `None`, `attr.s` will try to guess:
+
        1. If any attributes are annotated and no unannotated `attr.ib`\ s
           are found, it assumes *auto_attribs=True*.
-       2. Otherwise it assumes *auto_attribs=False* and tries to collect 
-          `attr.ib`\ s. 
- 
-    and that mutable classes (``frozen=False``) validate on ``__setattr__``. 
- 
-    .. versionadded:: 20.1.0 
-    """ 
- 
-    def do_it(cls, auto_attribs): 
-        return attrs( 
-            maybe_cls=cls, 
-            these=these, 
-            repr=repr, 
-            hash=hash, 
-            init=init, 
-            slots=slots, 
-            frozen=frozen, 
-            weakref_slot=weakref_slot, 
-            str=str, 
-            auto_attribs=auto_attribs, 
-            kw_only=kw_only, 
-            cache_hash=cache_hash, 
-            auto_exc=auto_exc, 
-            eq=eq, 
-            order=order, 
-            auto_detect=auto_detect, 
-            collect_by_mro=True, 
-            getstate_setstate=getstate_setstate, 
-            on_setattr=on_setattr, 
+       2. Otherwise it assumes *auto_attribs=False* and tries to collect
+          `attr.ib`\ s.
+
+    and that mutable classes (``frozen=False``) validate on ``__setattr__``.
+
+    .. versionadded:: 20.1.0
+    """
+
+    def do_it(cls, auto_attribs):
+        return attrs(
+            maybe_cls=cls,
+            these=these,
+            repr=repr,
+            hash=hash,
+            init=init,
+            slots=slots,
+            frozen=frozen,
+            weakref_slot=weakref_slot,
+            str=str,
+            auto_attribs=auto_attribs,
+            kw_only=kw_only,
+            cache_hash=cache_hash,
+            auto_exc=auto_exc,
+            eq=eq,
+            order=order,
+            auto_detect=auto_detect,
+            collect_by_mro=True,
+            getstate_setstate=getstate_setstate,
+            on_setattr=on_setattr,
             field_transformer=field_transformer,
-        ) 
- 
-    def wrap(cls): 
-        """ 
-        Making this a wrapper ensures this code runs during class creation. 
- 
-        We also ensure that frozen-ness of classes is inherited. 
-        """ 
-        nonlocal frozen, on_setattr 
- 
-        had_on_setattr = on_setattr not in (None, setters.NO_OP) 
- 
-        # By default, mutable classes validate on setattr. 
-        if frozen is False and on_setattr is None: 
-            on_setattr = setters.validate 
- 
-        # However, if we subclass a frozen class, we inherit the immutability 
-        # and disable on_setattr. 
-        for base_cls in cls.__bases__: 
-            if base_cls.__setattr__ is _frozen_setattrs: 
-                if had_on_setattr: 
-                    raise ValueError( 
-                        "Frozen classes can't use on_setattr " 
-                        "(frozen-ness was inherited)." 
-                    ) 
- 
-                on_setattr = setters.NO_OP 
-                break 
- 
-        if auto_attribs is not None: 
-            return do_it(cls, auto_attribs) 
- 
-        try: 
-            return do_it(cls, True) 
-        except UnannotatedAttributeError: 
-            return do_it(cls, False) 
- 
-    # maybe_cls's type depends on the usage of the decorator.  It's a class 
-    # if it's used as `@attrs` but ``None`` if used as `@attrs()`. 
-    if maybe_cls is None: 
-        return wrap 
-    else: 
-        return wrap(maybe_cls) 
- 
- 
-mutable = define 
-frozen = partial(define, frozen=True, on_setattr=None) 
- 
- 
-def field( 
-    *, 
-    default=NOTHING, 
-    validator=None, 
-    repr=True, 
-    hash=None, 
-    init=True, 
-    metadata=None, 
-    converter=None, 
-    factory=None, 
-    kw_only=False, 
-    eq=None, 
-    order=None, 
-    on_setattr=None, 
-): 
-    """ 
-    Identical to `attr.ib`, except keyword-only and with some arguments 
-    removed. 
- 
-    .. versionadded:: 20.1.0 
-    """ 
-    return attrib( 
-        default=default, 
-        validator=validator, 
-        repr=repr, 
-        hash=hash, 
-        init=init, 
-        metadata=metadata, 
-        converter=converter, 
-        factory=factory, 
-        kw_only=kw_only, 
-        eq=eq, 
-        order=order, 
-        on_setattr=on_setattr, 
-    ) 
+        )
+
+    def wrap(cls):
+        """
+        Making this a wrapper ensures this code runs during class creation.
+
+        We also ensure that frozen-ness of classes is inherited.
+        """
+        nonlocal frozen, on_setattr
+
+        had_on_setattr = on_setattr not in (None, setters.NO_OP)
+
+        # By default, mutable classes validate on setattr.
+        if frozen is False and on_setattr is None:
+            on_setattr = setters.validate
+
+        # However, if we subclass a frozen class, we inherit the immutability
+        # and disable on_setattr.
+        for base_cls in cls.__bases__:
+            if base_cls.__setattr__ is _frozen_setattrs:
+                if had_on_setattr:
+                    raise ValueError(
+                        "Frozen classes can't use on_setattr "
+                        "(frozen-ness was inherited)."
+                    )
+
+                on_setattr = setters.NO_OP
+                break
+
+        if auto_attribs is not None:
+            return do_it(cls, auto_attribs)
+
+        try:
+            return do_it(cls, True)
+        except UnannotatedAttributeError:
+            return do_it(cls, False)
+
+    # maybe_cls's type depends on the usage of the decorator.  It's a class
+    # if it's used as `@attrs` but ``None`` if used as `@attrs()`.
+    if maybe_cls is None:
+        return wrap
+    else:
+        return wrap(maybe_cls)
+
+
+mutable = define
+frozen = partial(define, frozen=True, on_setattr=None)
+
+
+def field(
+    *,
+    default=NOTHING,
+    validator=None,
+    repr=True,
+    hash=None,
+    init=True,
+    metadata=None,
+    converter=None,
+    factory=None,
+    kw_only=False,
+    eq=None,
+    order=None,
+    on_setattr=None,
+):
+    """
+    Identical to `attr.ib`, except keyword-only and with some arguments
+    removed.
+
+    .. versionadded:: 20.1.0
+    """
+    return attrib(
+        default=default,
+        validator=validator,
+        repr=repr,
+        hash=hash,
+        init=init,
+        metadata=metadata,
+        converter=converter,
+        factory=factory,
+        kw_only=kw_only,
+        eq=eq,
+        order=order,
+        on_setattr=on_setattr,
+    )

+ 8 - 8
contrib/python/attrs/attr/converters.py

@@ -5,7 +5,7 @@ Commonly useful converters.
 from __future__ import absolute_import, division, print_function
 
 from ._compat import PY2
-from ._make import NOTHING, Factory, pipe 
+from ._make import NOTHING, Factory, pipe
 
 
 if not PY2:
@@ -13,13 +13,13 @@ if not PY2:
     import typing
 
 
-__all__ = [ 
-    "pipe", 
-    "optional", 
-    "default_if_none", 
-] 
- 
- 
+__all__ = [
+    "pipe",
+    "optional",
+    "default_if_none",
+]
+
+
 def optional(converter):
     """
     A converter that allows an attribute to be optional. An optional attribute

Some files were not shown because too many files changed in this diff