Commit Graph

916 Commits

Author SHA1 Message Date
Hynek Schlawack 8592ea6aa5 Stack Overflow is two words 2021-10-28 07:11:16 +02:00
Hynek Schlawack 84eb79905f Fix Python 2/2020 tense 2021-10-28 07:06:57 +02:00
Hynek Schlawack 95b70bde2e Clarify that validators/converters only run on init 2021-10-28 07:00:01 +02:00
Hynek Schlawack 5c78fbc154
Fix typo 2021-10-14 13:02:59 +02:00
Hynek Schlawack 03c9615a55 Python 3.10 is final 2021-10-14 11:37:14 +02:00
Hynek Schlawack 6e5c6175b5
Switch codecov to new version (#852) 2021-10-14 11:35:40 +02:00
Kyle Altendorf 2eb5d97ef3
create a :mod:`attr` and :mod:`attrs` for intersphinx links to the package itself (#850)
* Try to create a :mod:`attr` and :mod:`attrs`

https://github.com/python-attrs/attrs/issues/849

* Update index.rst

* Update index.rst

* Update index.rst
2021-10-12 14:55:26 +02:00
Kyle Altendorf 68be706621
Avoid attr.attr.frozen and attr.attr.mutable in Sphinx object inventory (#851)
https://github.com/altendky/qtrio/issues/269
2021-10-12 07:42:46 +02:00
Hynek Schlawack 124c20cde0
Document Attribute.eq_key & .order_key (#847)
* Document Attribute.eq_key & .order_key

Fixes #839

Signed-off-by: Hynek Schlawack <hs@ox.cx>

* Add for example
2021-10-06 12:21:36 +02:00
Jasper Spaans 44ea327ab7
Make `from attr import *` work again on recent python versions. (#848)
* Make `from attr import *` work again on recent python versions.

* Move import * test into a function and mark some flake8 exceptions.

* Please the linters.

* Update attr_import_star.py

test was renamed, rename it in the comment as well
2021-10-04 16:23:50 +02:00
Hynek Schlawack 407c5e3d9e pre-commit autoupdate 2021-10-02 14:25:49 +02:00
Stefan Scherfke 52fcad29bb
Add additonal validators (#845)
* Add additonal validators

* Python 2 \o/

* Add changelog entry

* Add "versionadded" tags

* More python 2

* Add doctests and rename maxlen to max_len

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-09-24 12:47:19 +02:00
Stefan Scherfke f57b6a6759
Convert transformed attrs to AttrsClass (#824)
* Convert transformed attrs to AttrsClass

Fixes: #821

* Add cangelog entry

* Only call AttrsClass once

* Calm mypy by inline the AttrsClass call

* Defer AttrsClass creation as long as possible

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-09-22 21:58:32 +02:00
David Euresti f31bb2850a
Fix bug in resolve_types with subclasses (#843)
* Fix bug in resolve_types with subclasses

* lint

* changelog

* lint again, like we did last summer

* Moar coverage

* lint ... why

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-09-19 21:04:55 +02:00
Thomas Grainger 7c99a49530
update NASA url (#840)
Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-09-19 18:47:46 +02:00
David Euresti b8f5cd780b
Fix mypy tests. (#844)
Looks like the ordering changed
2021-09-19 17:09:35 +02:00
Hynek Schlawack fcb7393f53 Add changelog for #830, fix filenames 2021-08-10 07:48:50 +02:00
Rebecca Turner e84b57ea68
Inline distutils.util.strtobool in tests (closes #813) (#830)
* Inline distutils.util.strtobool in tests (#813)

`distutils` is deprecated in Python 3.10 and slated for removal in
Python 3.12. Fortunately, `attrs` only uses `distutils` once and it's
trivial to remove.

As suggested by @sscherfke, add the `to_bool` converter to
`converters.py`.

Closes #813

Co-authored-by: Stefan Scherfke <stefan@sofa-rockers.org>

* Use :raises: directive in docstring

* Remove f-strings for Py2.7 and 3.5 support

* Add to_bool tests

Co-authored-by: Stefan Scherfke <stefan@sofa-rockers.org>
Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-08-10 07:45:28 +02:00
Hynek Schlawack 2ca7aada70 Run pypy on pypy2 2021-08-07 08:53:10 +02:00
Tin Tvrtković 38580632ce
Rework linecache handling (#828)
* Rework linecache handling

* lint

* Add changelog
2021-06-30 08:28:56 +02:00
David Euresti fb154878eb
Fix mypy tests on 3.10 (#771)
Looks like this was a bug fixed upstream
2021-06-14 17:58:33 +00:00
David Euresti ec249f62b3
Fix the mypy tests by double quoting. (#825) 2021-06-14 19:17:33 +02:00
Hynek Schlawack 7cc3121617 pre-commit autoupdate 2021-06-03 08:41:29 +02:00
Hynek Schlawack 464d6e42b7 Harmonize badge label color 2021-06-03 08:40:49 +02:00
Hynek Schlawack e25a24c77c Add license badge
The color is complimentary to the blue of the version badge.
2021-06-01 12:15:23 +02:00
Hynek Schlawack 9a6dc6599a Simplify badges
Especially remove everything that's apparent from the GitHub UI.
2021-06-01 11:46:40 +02:00
Tin Tvrtković 9709dd82e1
Initial implementation of a faster repr (#819)
* Initial implementation of a faster repr

* Switch to positional args for _make_repr

* Fix tests and changelog

* Remove trailing comma for Py2

* Fix lint

* __qualname__ is always present if f-strings work

* Fix Py2 qualname

* Revert "Fix Py2 qualname"

This reverts commit eb091a31d2.

* Update src/attr/_make.py

Co-authored-by: Hynek Schlawack <hs@ox.cx>

* Update changelog.d/819.changes.rst

Co-authored-by: Hynek Schlawack <hs@ox.cx>

* Update src/attr/_make.py

Co-authored-by: Hynek Schlawack <hs@ox.cx>

* Update src/attr/_make.py

Co-authored-by: Hynek Schlawack <hs@ox.cx>

* Update src/attr/_make.py

Co-authored-by: Hynek Schlawack <hs@ox.cx>

* Update src/attr/_make.py

Co-authored-by: Hynek Schlawack <hs@ox.cx>

* Update src/attr/_make.py

Co-authored-by: Hynek Schlawack <hs@ox.cx>

* Fix syntax

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-05-26 21:57:52 +02:00
Hynek Schlawack 0c769095ff Switch to black formatting in stubs
Also block isort from stubs -- it plays ping-pong with black about an empty
line after imports.
2021-05-20 17:11:53 +02:00
Hynek Schlawack 0112392da9 pre-commit update 2021-05-20 17:11:39 +02:00
Hynek Schlawack d17326e49f Replace coverage with downloads
The codecov badge is misleading because it dips whenever a build is running.
2021-05-18 16:09:16 +02:00
Hynek Schlawack 8c9a79680f
Minor polish to #815
Signed-off-by: Hynek Schlawack <hs@ox.cx>
2021-05-18 11:29:29 +02:00
Hynek Schlawack 6731eea0ed
Run Python 3.10 under coverage (#818)
Since the matching code is Python 3.10-specific, we run it under coverage.
2021-05-18 11:28:21 +02:00
Karthikeyan Singaravelan 8613af97bb
Add __match_args__ to support match case destructuring in Python 3.10 (#815)
* Add support to generate __match_args__ for Python 3.10.

* Add versionadded directive.

* Update stubs.

* Update changelog and add a test to typing examples.

* Fix error regarding new-style classes in Python 2.

* Fix lint error regarding line length.

* Fix lint error regarding trailing whitespace.

* Add docstrings for interrogate.

* Use _has_own_attribute instead of cls.__dict__ contains check.

* Update docs as per review comments.

* Revert mistaken changelog update.

* Add Python 3.10 pattern matching syntax test cases.

* Update define signature with match_args.

* Fix conftest formatting.

* Fix isort formatting.

* Bump to Python 3.10 to parse syntax.

* Bump basepython of lint to Python 3.10 for parsing.

* Move lint to py310

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2021-05-18 07:02:06 +02:00
Hynek Schlawack 20c2d4fc0c
Optimize the case of on_setattr=validate & no validators (#817)
* Optimize the case of on_setattr=validate & no validators

This is important because define/mutable have on_setattr=setters.validate on
default.

Fixes #816

Signed-off-by: Hynek Schlawack <hs@ox.cx>

* Grammar
2021-05-17 09:24:46 +02:00
Hynek Schlawack 8ae2d6f1c3 Fix typo 2021-05-09 07:07:12 +02:00
Hynek Schlawack 932902c29f Start new cycle 2021-05-07 11:35:44 +02:00
Hynek Schlawack 83d3cd70f9 Prepare 21.2.0 2021-05-07 11:22:31 +02:00
Hynek Schlawack f83dabb15e That comma is not necessary 2021-05-07 11:19:55 +02:00
Hynek Schlawack 744a790756 Clarify yanking of 21.1 2021-05-07 11:13:13 +02:00
Hynek Schlawack 8076287aeb
Create 807.breaking.rst 2021-05-06 18:39:48 +02:00
Jan Gosmann 966c220e55
Declare Python 3.4 as incompatible (#807)
Python 3.4 testing has been dropped in #608, but it was not declared as
incompatible in setup.py because the code base was expected to still
work with Python 3.4 for a while. This compatibility finally broke with
the 21.1.0 release. At least one of the problematic commits is
e09b1d6423 introducing an import of
the typing module not available in Python 3.4.
2021-05-06 18:37:57 +02:00
Hynek Schlawack f10d050864
Revert recursive evolve (#806)
* Revert "Recursively evolve nested attrs classes (#759)"

* Add regression test

* lol legacy python

* Add newsfragment

* Add a test to prevent inst -> dict replacement breaking
2021-05-06 15:26:27 +02:00
Hynek Schlawack 24a2c1e7a5 Start new cycle 2021-05-06 10:28:10 +02:00
Hynek Schlawack b22195ee65 Prepare 21.1.0 2021-05-06 10:20:53 +02:00
Hynek Schlawack c5ae43f7f2 Pin towncrier
Currently the title is either not rendered at all, or rendered twice

cf.

- https://github.com/twisted/towncrier/issues/346
- https://github.com/twisted/towncrier/issues/340
2021-05-06 10:16:57 +02:00
Hynek Schlawack 503164f570 Fix changelog template for towncrier 21.3.0
See https://github.com/twisted/towncrier/issues/340
2021-05-06 10:08:29 +02:00
Hynek Schlawack fbed0320a6 Revert last change, the string is consistent w/ total_ordering
This reverts commit 2f395f1a27.
2021-05-06 09:03:24 +02:00
Hynek Schlawack 2f395f1a27 Make docstring consistent with the rest 2021-05-05 20:21:50 +02:00
Hynek Schlawack f41db43541 Unpin pyright & minor docs polish
ref #796
2021-05-05 16:06:09 +02:00
Hynek Schlawack 16f7a0df07 Make #796 newsfragment more timeless 2021-05-05 15:52:11 +02:00