Commit Graph

1263 Commits

Author SHA1 Message Date
Hynek Schlawack da24151b1c
Drop Ko-fi
PayPal fees are egregious.
2023-02-12 14:28:48 +01:00
Hynek Schlawack f2571ea144 Simplify contributing guide 2023-02-12 09:48:38 +01:00
Hynek Schlawack ff7f9de526
Document latest Python sync req 2023-02-06 09:43:00 +01:00
Hynek Schlawack 99925dbc2e
Add news fragment for #993 2023-02-06 09:40:43 +01:00
Hynek Schlawack 415147c176
Add news fragment for #1079 2023-02-06 09:36:10 +01:00
Tin Tvrtković 4fcd15bddb
First pass over generics (#1079)
* 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>
2023-02-05 13:56:45 +01:00
Hynek Schlawack 9cf2ed5a6b
Update black 2023-02-03 12:47:41 +01:00
Hynek Schlawack 2252f5bc41
Streamline tox.ini 2023-02-03 09:36:01 +01:00
Hynek Schlawack 0ec44257f7
Determine tox versions on our own (#1098) 2023-02-03 09:08:09 +01:00
Sviatoslav Sydorenko cabc0621b3
📦 Enable support for git archive installs (#1095)
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
2023-02-02 06:50:41 +01:00
Hynek Schlawack 95d8a76fb7
Unpin tox (#1093)
* 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>
2023-02-02 06:43:07 +01:00
Sviatoslav Sydorenko 9d23ae9536
🐛 Bump isort to v5.12.0 (#1096) 2023-01-30 18:55:04 +01:00
Hynek Schlawack 42b8aa122f
Refresh sync reminders 2023-01-29 11:41:33 +01:00
Hynek Schlawack c9c7595b69
Switch to hatch-vcs (#1094)
Also start publishing every commit to main to <https://test.pypi.org/project/attrs/>.
2023-01-29 11:21:20 +01:00
Hynek Schlawack d7eb692ff6
Ensure we have a toml-enable coverage
Currently tomli is pulled in by other packages but that might change in
the future.
2023-01-25 12:46:33 +01:00
Hynek Schlawack c3a1766798
Run pre-commit on 3.11, pyupgrade for 3.7 2023-01-25 12:46:18 +01:00
Nick Pope c9150d278c
Fix backward compatibility with pickles before v22.2.0 (#1085)
* 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>
2023-01-25 06:58:31 +00:00
Vyacheslav Tverskoy 882805e173
Add AttrsInstance protocol to forgotten attrs.asdict and attrs.astuple (#1090)
* 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>
2023-01-23 09:21:20 +00:00
Tin Tvrtković 14354bbd67
Update Mypy tests for new Mypy output (#1070)
* Update Mypy tests for new Mypy output

* Finish rebase

* Tweak tox mypy

* Limit tox version
2023-01-16 15:50:52 +01:00
Bryan Forbes 46053d703d
Fix @frozen typing to work on PEP-681 checkers (#1084) 2023-01-12 07:22:13 +01:00
Hynek Schlawack d4934b14f1
Drop 3.6 & switch to 100% static packaging configuration (#993)
* 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
2023-01-11 16:50:27 +01:00
Hynek Schlawack c02d993f9d
Fix object index in API docs by splitting API docs in two (#1080)
* 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
2023-01-10 17:53:28 +01:00
Hynek Schlawack 0de967d6ec
Rename readthedocs.yml to .readthedocs.yaml
The good name is deprecated now: https://docs.readthedocs.io/en/stable/config-file/index.html
2023-01-10 08:05:39 +01:00
Julian Berman a71fbbad89
Fix @frozen exceptions to allow __traceback__ to be set. (#1081) 2023-01-08 18:34:28 +01:00
pre-commit-ci[bot] c6668fa419
[pre-commit.ci] pre-commit autoupdate (#1078)
updates:
- [github.com/psf/black: 22.10.0 → 22.12.0](https://github.com/psf/black/compare/22.10.0...22.12.0)
- [github.com/asottile/pyupgrade: v3.3.0 → v3.3.1](https://github.com/asottile/pyupgrade/compare/v3.3.0...v3.3.1)
- [github.com/PyCQA/isort: 5.10.1 → 5.11.4](https://github.com/PyCQA/isort/compare/5.10.1...5.11.4)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-01-03 07:02:20 +01:00
Hynek Schlawack 906b732e23
Re-add attr and attrs ..module
But add it where it belongs: API

Fixes #1073
2023-01-02 16:27:37 +01:00
Hynek Schlawack 98aa688501
Clarify make_class argument type (#1075) 2023-01-02 08:50:57 +01:00
Hynek Schlawack 88d2a37748
Remove inexistent file from MANIFEST.in 2022-12-22 07:29:58 +01:00
Hynek Schlawack 3a1367befa
Fix docset icons 2022-12-21 11:50:14 +01:00
Hynek Schlawack f04dce20f1
Allow upload.pypi.org 2022-12-21 10:41:58 +01:00
Hynek Schlawack f116bfc6cc
Start new development cycle 2022-12-21 10:20:48 +01:00
Hynek Schlawack a9960de98d
Prepare 22.2.0 2022-12-21 10:07:30 +01:00
Hynek Schlawack 566248a2d8
Don't linkcheck tree links 2022-12-21 09:59:37 +01:00
Hynek Schlawack 0f62805c7d
Make towncrier marker independent from warning 2022-12-21 09:31:13 +01:00
Hynek Schlawack b9f35eb2f2
Fix minor stub issues (#1072) 2022-12-20 14:10:12 +00:00
Hynek Schlawack 4ad4ea073f
Use MyST-native include 2022-12-20 10:47:48 +01:00
Hynek Schlawack 519423d94a
Use MyST-native doctest blocks in all MD 2022-12-20 10:46:32 +01:00
Hynek Schlawack 403adaba51
Remove stray file 2022-12-20 10:21:21 +01:00
Hynek Schlawack 6957e4a356
Use new typographic branding in the last rst file, too 2022-12-20 10:17:48 +01:00
Hynek Schlawack 1bb2864824
Convert examples.rst to md 2022-12-20 10:14:46 +01:00
Hynek Schlawack c1c24ccafb
Convert glossary.rst to md 2022-12-20 09:45:37 +01:00
Hynek Schlawack 9fd0f82ff0
Convert extending.rst to md 2022-12-20 09:28:31 +01:00
Hynek Schlawack 3473b4d3e2
Convert comparison.rst to md 2022-12-20 09:12:37 +01:00
Hynek Schlawack a760574795
Convert init.rst to md 2022-12-20 08:22:51 +01:00
Hynek Schlawack 2aff38afc4
Convert types.rst to md 2022-12-20 07:49:00 +01:00
Hynek Schlawack a09a6e7010
Convert how-does-it-work.rst to md 2022-12-20 07:34:58 +01:00
Hynek Schlawack 7fa9cd03d5
Convert overview.rst to md 2022-12-20 07:21:08 +01:00
Hynek Schlawack dc1dc3b1e3
Convert names.rst to md 2022-12-20 07:06:32 +01:00
Hynek Schlawack 5c280b35c1
We can style links now! 2022-12-19 16:42:36 +01:00
Hynek Schlawack 08b200efac
Convert why chapter to markdown 2022-12-19 16:38:33 +01:00