* First pass over generics
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Reformat comment
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* More work on generics
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* Add test case
* Tweak condition
* Remove redundant code
* Add test
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Hynek Schlawack <hs@ox.cx>
This patch enables the end-users to succeed installing from GitHub
source Git archive URLs, letting `setuptools-scm` calculate the
distribution version correctly, including the exports of non-tagged
commits[1].
[1] https://github.com/pypa/setuptools_scm#git-archives
* Unpin tox
* Pass thru fake version
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Remove unnecessary parameterization of tests
* Fix backward compatibility with pickles before v22.2.0
Unfortunately we're using `django-redis` to cache some `attrs` instances
and the change to make `__getstate__` and `__setstate__` use `dict`
values instead of `tuple` values prevents reading any values from the
cache when updating to `attrs>=22.2.0`. We get an `AttributeError`
raised for all attributes.
This happens because the tuple of values stored in the original pickle
is checked for the name of the attribute and so none of the attributes
are set on unpickle.
To address this I've made a change so that `__setstate__` will still be
able to handle values pickled as `tuple`s allowing existing pickles to
be unpickled.
The test just contains a pre-pickled value due to the complexities
around tying to mock methods on a slotted as documented[^1].
I realise that documentation also mentions that we should "think twice"
before using pickle, but sometimes those decisions predate our
involvement in a project! In addition, pretty much all of Django's cache
implementations are built around using pickle by default. This change
will allow an easier path to upgrade by unpickling and repickling all
values in the cache.
Regression in 89a890a326.
[^1]: https://www.attrs.org/en/latest/glossary.html#term-slotted-classes
* Update 1085.change.md
Co-authored-by: Hynek Schlawack <hs@ox.cx>
* Add AttrsInstance protocol to forgotten attrs.asdict and attrs.astuple
* Add mypy test for attrs.asdict
* Add changelog entry for attrs.asdict
* Clarify it's about type stubs
Co-authored-by: Hynek Schlawack <hs@ox.cx>
* Drop 3.6 & move to Hatch + static metadata
Use ubuntu-latest again
* Use hatch-autorun instead of coverage-enable-subprocess
* Fix hostname
* Simplify tox.ini
* Move changelog check to docs jobs
* Hatchling supports PEP 639 just fine
* Fix object index in API docs
* Refactor API docs, prefer new namespace in examples
* Missed one
* Technically optional, practically confusing
* Simplify / clarify intro to API
* No need to make this clickable