Commit Graph

26 Commits

Author SHA1 Message Date
Hynek Schlawack 3843452516
Replace omnipresent pytest.mark.parametrize("(slots|frozen)" w/ fixture (#1002)
Replace omnipresent pytest.mark.parametrize("(slots|frozen)", [True, False]) w/ fixture
2022-08-11 09:35:39 +02:00
Hynek Schlawack 08f8319efe
Drop Python 3.5 (#988)
* Drop Python 3.5

Less than 0.5% of our downloads are 3.5 and it allows us to simplify A LOT of code.

Fixes #965

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

* Run 3.6 under coverage

* Add newsfragment

* Probably don't need 3.7 for coverage

* Everything is ordered!

* pre-commit autoupdate, add yesqa
2022-08-05 09:48:00 +02:00
Hynek Schlawack 980c8b04f5
Drop Python 2.7 (#936)
* 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>
2022-03-21 08:47:47 +01:00
Hynek Schlawack 046beaaaaa Apply SPDX IDs 2021-12-27 09:29:09 +01:00
Hynek Schlawack e7345584ff
Add attrs namespace (#887) 2021-12-25 15:15:10 +01: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
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
David Euresti ce8bb4ffa9
Add attribs to resolve_types and fix test_hooks (#774) 2021-03-05 16:01:04 -08:00
Hynek Schlawack 03d3fc7a71
Add Python 3.10 support (#763)
* 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
2021-02-22 12:56:44 +01:00
Stefan Scherfke 0eae613ce1
Add hooks for field transformation and for asdict serialization (#653) 2020-10-15 09:33:59 +02:00
Hynek Schlawack b02335f59d
Add attr.define/mutable/frozen (#666)
* Add attr.auto/mutable/frozen

Prepare for import attrs y'all!

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

* Try combining coverage using 3.8, always

* Add tests for overriding of auto_attribs

* Clarifications

* Add newsfragment

* s/auto/define

This is going be the next-gen name anyways, so no need to introduce new names.

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

* Missed two

* Add type stubs

* Beg for patience

* Explain second setup-python action

* fix comment
2020-08-17 16:22:33 +02:00
Hynek Schlawack 08fcfe91d4
Split cmp into eq and order (#574)
* Split cmp into eq and order

Fixes #170

* Fix tests on old pypy3 versions

Old as in: currently on AP.

* Fix issue number and clarify newsfragment

* Clarify behavior and interaction between cmp/eq/order

* This sounds better

* Address Julian's review comments

* Missed a cmp

* Test the behavior of Attribute.cmp

* Make test more idiomatic

* Explain assumptions

* Clarify comment

* Grammar

* One more cmp!
2019-09-22 15:07:19 +02:00
Hynek Schlawack df200c73fe Re-activate pypy3 annotations 2019-06-22 09:44:20 +02:00
Hynek Schlawack 4de9481d14 Exclude test_annotations from pypy3
See #509
2019-02-25 16:22:55 +01:00
Hynek Schlawack 0693f47b82 Disable hypothesis.HealthCheck.too_slow globally (#396)
* Disable hypothesis.HealthCheck.too_slow globally

Fixes #364

* Add newsfragment
2018-06-17 13:32:48 +02:00
Hynek Schlawack a372d51b7b
Fade to Black (#392) 2018-06-10 19:40:07 +02:00
Hynek Schlawack ef9a062022
Use isort so we can stop thinking about imports (#297) 2017-11-26 22:18:07 +01:00
Hynek Schlawack 3040bdabbc Refactor class creation (#272)
Instead of adding and possibly later deleting attributes, the class creation is delegated into a cleaner building pattern.
2017-10-26 12:55:34 +02:00
Hynek Schlawack 03c10ad0ef Use new serious biz names in internal code (#257)
* Use new serious biz names

* Use offical API in tests where possible

* Fix flake8
2017-10-02 19:32:10 +02:00
Chad Dombrova 566ada9848 Basic type support (#239)
* Add support for passing a type to attr.ib() and gathering the type from PEP526-style annotations.

* Address review notes.

* More review notes.

* A few more review changes.

* Quick final fix to the changelog.
2017-09-17 16:22:49 +02:00
Hynek Schlawack 96fc8cb815 Stop living in the past
...and move all aux tests to 3.6.
2017-03-04 07:52:33 +01:00
Adam Dangoor a26ab0374e Fix typo in docstring (fully features > fully featured). (#125) 2016-12-14 08:35:56 +01:00
Hynek Schlawack dd36808a5a Don't run PyPy under coverage
It's too slow and keeps breaking the tests.
2016-09-05 14:50:08 +02:00
Tin Tvrtković d10e5c41d6 asdict - propagate dict_factory properly (#45)
* asdict - propagate dict_factory properly. Hypothesis tests.

* Disable Hypothesis health checks on Travis/PyPy.

* Tox - pass the HYPOTHESIS_PROFILE environment variable.

* Shut up pytest again.
2016-06-02 15:40:15 -07:00
Hynek Schlawack 01cdff398f Move conftest.py out of tests 2015-02-16 16:30:05 +01:00