Commit Graph

1623 Commits

Author SHA1 Message Date
pre-commit-ci[bot] 06daa1d0bc
[pre-commit.ci] pre-commit autoupdate (#1402)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.9.3 → v0.9.4](https://github.com/astral-sh/ruff-pre-commit/compare/v0.9.3...v0.9.4)
- [github.com/codespell-project/codespell: v2.4.0 → v2.4.1](https://github.com/codespell-project/codespell/compare/v2.4.0...v2.4.1)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-02-04 09:15:23 +00:00
Lumír 'Frenzy' Balhar eb49c53752
Don't expect TestCloudpickleCompat to fail with Python 3.14 (#1398)
Cloudpickle supports Python 3.14 already.

Fixes: https://github.com/python-attrs/attrs/issues/1397
2025-01-27 12:42:53 +00:00
Hynek Schlawack fbff14eeaf
Prepare 25.1.0 2025-01-25 12:23:36 +01:00
Hynek Schlawack 473c001286
give up 2025-01-25 12:19:18 +01:00
Hynek Schlawack c17b1f3ec5
Update Ruff 2025-01-24 08:02:11 +01:00
Hynek Schlawack 7cbc77f21b
Fix RTD build (#1396)
* Fix RTD build

* Update contributing guide
2025-01-22 10:45:13 +01:00
Hynek Schlawack d85bc09366
sponsors: add Privacy Solutions 2025-01-22 10:20:30 +01:00
Hynek Schlawack 61e7cae6a1
docset: use --icon-2x instead of manual copy 2025-01-20 08:30:38 +01:00
Hynek Schlawack 560b2136aa
Simplify pypy tests 2025-01-10 06:35:35 +01:00
pre-commit-ci[bot] 19518e74f0
[pre-commit.ci] pre-commit autoupdate (#1393)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.8.2 → v0.8.6](https://github.com/astral-sh/ruff-pre-commit/compare/v0.8.2...v0.8.6)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-01-07 05:44:55 +00:00
Alex Peters 076cf7643c
fix typos (#1391) 2024-12-28 06:42:52 +00:00
Hynek Schlawack 598494a618
Prepare 24.3.0 2024-12-16 07:26:35 +01:00
Hynek Schlawack 805ff5ec21
Ignore pypi in linkcheck 2024-12-16 06:57:30 +01:00
Hynek Schlawack 2b6f2ce1ae
docs: fix term 2024-12-15 15:16:09 +01:00
Hynek Schlawack 119e043b9f
docs: fix markup 2024-12-15 15:16:03 +01:00
Hynek Schlawack e82cde4c25
docs: add note to make_class about non-NG-ness
fixes https://github.com/python-attrs/attrs/issues/1375
2024-12-15 15:08:52 +01:00
Hynek Schlawack d3f320e0cb
typing: allow union types for instance_of (#1385)
* typing: allow union types for instance_of

fixes #1336

* Make hint meaningful albeit broken

* Stop running mypy on 3.9

* Declare bankruptcy

* Testing types only on 3.10+ now
2024-12-15 06:45:26 +01:00
Hynek Schlawack 62bdbf234f
Implement __replace__ on 3.13 (#1383)
* Implement __replace__ on 3.13

Fixes #1313

* Add newsfragment

Add news fragment

* fix markup

* Add pro-tip

* Explicit autodoc
2024-12-14 14:55:06 +00:00
Hynek Schlawack 103d51f6ef
Run Zizmor with token (#1384) 2024-12-14 13:47:26 +01:00
Tin Tvrtković d18763cac8
Introduce NothingType (#1358)
* Introduce NothingType

* Fallback to typing_extensions

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Avoid TypeAlias at runtime

* Add changelog

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Docs

* Add import, test

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Fix test

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-12-10 10:24:46 +00:00
Filipe Brandenburger 1e07f46897
Make attrs.converters.pipe only return a Converter instance if one is passed (#1380)
* Make attrs.converters.pipe only return a Converter instance if one is passed

* Add type check overloads to specify that callables will return callables

---------

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2024-12-10 06:05:32 +00:00
Filipe Brandenburger 2a76643e36
Fix pyright tests to match expected pyright output after pyright 1.1.380 (#1381) 2024-12-09 18:55:39 +00:00
Hynek Schlawack 160f5d8b97
Sponsors: add emsys
cc @sscherfke
2024-12-09 10:40:32 +01:00
Hynek Schlawack 0bdeb34d4e
Update Ruff 2024-12-09 07:11:05 +01:00
Hynek Schlawack 6d36983a3b
Use uvx to run Zizmor (#1379) 2024-12-09 06:49:26 +01:00
Hynek Schlawack 3a5a49ecca
Apply PEP 639 (#1377)
https://discuss.python.org/t/pep-639-round-3-improving-license-clarity-with-better-package-metadata/53020/128
2024-11-30 09:03:25 +01:00
Hynek Schlawack 45b6b6b6c3
Update Ruff 2024-11-30 08:46:16 +01:00
Filipe Brandenburger 6c89173db8
Fix type annotations for converter types, considering the Converter class (#1373)
* Fix type annotations for converter types, considering the Converter class

Also consider that field() or attr.ib() takes a list or tuple of
converters as an implicit pipe, add type annotations for that syntax

* Fix expected mypy output with bad converters now that typing information has been expanded
2024-11-27 05:18:13 +00:00
Filipe Brandenburger 13105a64f2
Use an explicit comparison to None for the converter of a field (#1374)
Make attrs work with a converter instance that does not evaluate True
2024-11-25 07:54:00 +00:00
Filipe Brandenburger e21793e90a
Allow converter.optional to take a Converter such as converter.pipe as its argument (#1372)
* Allow converter.optional to take a converter such as converter.pipe as its argument

* Only turn optional into a Converter if needed

* Move call to Converter constructor to the end of optional()

The constructor consumes __annotations__, so move the constructor call to after those have been set on the optional_converter function

* Update tests/test_converters.py

* Update tests/test_converters.py

---------

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2024-11-17 11:15:26 +00:00
Hynek Schlawack ee0f19b696
Update Ruff 2024-11-16 10:59:51 +01:00
Hynek Schlawack cf6af79d9b
Remove stale comment
ref
https://github.com/python-attrs/attrs/pull/1310#issuecomment-2480152650
2024-11-16 10:59:32 +01:00
pre-commit-ci[bot] 13e9a6aaea
[pre-commit.ci] pre-commit autoupdate (#1370)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.9 → v0.7.2](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.9...v0.7.2)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-11-05 06:12:56 +00:00
Hynek Schlawack 9c3b379b32
Harden CI (#1368) 2024-11-02 08:24:37 +00:00
Douglas Griffith 4580a74fc9
update frozen post-init example to use frozen (#1367) 2024-10-29 14:34:22 +00:00
Thomas Grainger 1921da6eac
allow __suppress_context__ and __notes__ to be mutated on frozen exceptions (#1365)
* allow __suppress_context__ to be mutated on frozen exceptions

* add changelog

* and __notes__! lets' not forget that.

* add notes to news

* add tests

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* fix improt

* fix test

* fix tests again

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-26 11:20:44 +00:00
esteevens 58cd3ae112
Fix tiny typo in glossary.md (#1363) 2024-10-25 06:17:00 +00:00
Hynek Schlawack 5eea939b64
Install pytest-mypy-plugins on 3.13 2024-10-14 15:33:12 +02:00
Hynek Schlawack 88c39b3faf
Make local pre-commit faster 2024-10-14 08:46:51 +02:00
Hynek Schlawack 348cc252cc
The Python used for coverage is new enough for toml 2024-10-14 08:45:51 +02:00
Hynek Schlawack d68f0cdce9
PyPy 3.9 is not supported anymore 2024-10-10 07:54:43 +02:00
Hynek Schlawack 6c20fc0aee
Use 3.13 in dev 2024-10-09 14:18:47 +02:00
pre-commit-ci[bot] 8535b1ead3
[pre-commit.ci] pre-commit autoupdate (#1356)
updates:
- [github.com/astral-sh/ruff-pre-commit: v0.6.3 → v0.6.9](https://github.com/astral-sh/ruff-pre-commit/compare/v0.6.3...v0.6.9)
- [github.com/pre-commit/pre-commit-hooks: v4.6.0 → v5.0.0](https://github.com/pre-commit/pre-commit-hooks/compare/v4.6.0...v5.0.0)

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-10-07 23:05:00 +00:00
Tim Stumbaugh 0e8e82a7a0
Remove mention of cmp= from next gen docs (#1355)
`attrs.define` and `attrs.field` do not actually accept `cmp=`
anymore, but the docs still discuss them
2024-10-04 05:12:03 +00:00
Hynek Schlawack a59c5d7292
docs: fix intersphinx links 2024-09-27 05:56:55 +02:00
Geoffrey Thomas 2afd663bf4
Document how to handle class variables/constants in typed syntax (#1352)
* Document how to handle class variables/constants in typed syntax

This is mentioned very briefly in the API docs for `auto_attrib` but
it's not easy to find if you don't already know about `typing.ClassVar`.

* Fix typo

* 2 empty lines before headers

---------

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2024-09-23 04:24:03 +00:00
Geoffrey Thomas a785e6b4ae
Rephrase the "Private Attributes and Aliases" section (#1351)
It took me a bit to figure out what was meant by the link to the
characteristic issue and why there is no such thing as a private
argument. Incorporate (my understanding of) the meaning inline and also
provide an example of how to work around the _1 syntax error.
2024-09-23 04:16:08 +00:00
Hynek Schlawack 0d7e434065
Lint first, format then
As recced by Astral
2024-09-18 13:46:02 +02:00
Hynek Schlawack ec5bc55caf
Stop installing into CI's system (#1346)
* Stop installing into CI's system

We're starting to get permission denied errors when installing with
--system.

* Pin Pyright

* Simplify

* Fix typo
2024-09-14 14:59:01 +02:00
Hynek Schlawack 2f1014aa60
Black dropped us 5 years ago
31f4105731
2024-09-05 09:02:00 +02:00