* Add support for Python 3.11
Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
* Tin/py311 (#973)
* Fix test_slots::TestPickle::test_no_getstate_setstate_for_dict_classes
* Fix annotations
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Tweak tests for 3.10
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Tweak tests some more
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Drop Python 2.7
The tooling situation around Python 2 has deteriorate to such a degree that
upholding compatibility is not tenable anymore for a volunteer-run project.
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* Add newsfragment
* Run Python 3.5 under coverage to make up for Python 2.7
* Wait for py35 in parallel
* Remove fullmatch kludge
* Remove Python 2-specific code
* Revert empty slot test
Also disable pyupgrade on that file.
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* We DO run under 3.5
* Remove __qualname__ workarounds
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Update changelog.d/936.breaking.rst
Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
* Compare methods using is
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Tin Tvrtković <tinchester@gmail.com>
* Add Python 3.10 support
Python 3.10 has string types everywhere and that has unmasked a bunch of
bugs/edge cases in our code.
Especially the hooks code need a resolving helper for string types. I'm leaving
that for a separate PR.
Fixes#716
* More robust quote handling
* Use resolve_types decorator where possible
* Use a helper for __init__ annotations
* Add test for various ClassVars
* Don't reset custom __setattr__ in slotted classes
Fixes#680
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* Simplify
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* Be defensive about __bases__
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* _Classes_ always have a __dict__
* Tighten xfail
* Clarify what need to be reset and when
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* Reset __attrs_own_setattr__ along with __setattr__
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* Update src/attr/_make.py
Co-authored-by: Paul Ganssle <paul@ganssle.io>
* Differentiate between own (= attrs) and custom (= user) __setattrs__
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* We've always used __bases__ in our call to type()
So no reason for being defensive.
* Update tests/test_setattr.py
Co-authored-by: Paul Ganssle <paul@ganssle.io>
Co-authored-by: Paul Ganssle <paul@ganssle.io>
* Add on_setattr hooks to attr.s and attr.ib
Signed-off-by: Hynek Schlawack <hs@ox.cx>
* Add PR newsfragment
* Fix attr.s doc sig
* Make _DisableType private
* Mark setters.frozen as NoReturn
* Rename setters.DISABLE to setters.NO_OP to clarify its purpose
DISABLE sounds less purposeful and doesn't convey its meaning as well.
* Fix type
* Loosen up type for convert even further
* Tighten type a tiny bit
Getting
```
Coverage.py warning: Module attr was previously imported, but not measured (module-not-measured)
```
and missing coverage for some reason. Google is not helpful.
* Add attr.__version_info__
This allows users to check for features and avoid deprecation warnings without
breaking backward compatibility.
* Add newsfragment
* Stay ASCII
* Typo
* Add stubs for _version.py
* Address David's feedback
* Handle PY2 better in comparability test
* drop the ing
* Add default_role for Sphinx.
Fix a bunch of broken refs along the way, which become
errors now via -W if you have default_role set.
In theory you can catch those via sphinx-build -n (i.e.
nitpick mode), which IMHO is a decent idea anyhow, but it's
a longer diff to enable that because it'd involve fixing a
bunch of the places that try to reference types that don't
exist (e.g. :type foo: Any value). But obviously can be done.
Also didn't actually use this anywhere yet (the any role),
but will do so in a follow-up if this is acceptable.
* Remove the roles from builtin objects to demo any.
* Style.
* Add z.i to intersphinx.
Enables the link to z.i.Interface.
* Enable nitpick mode.
Fix the remaining broken links or whitelist them via nitpick_ignore.
* Kill all :func:s.
* Kill all :class:es.
* Kill all :doc:s.
* Kill all :ref:s.
Except one, that probably meant :func:, and which
is a duplicate ref.
* Kill :exc: and :data:.
* Kill :mod:s.
* Kill new explicit refs from the merge.