Commit Graph

7 Commits

Author SHA1 Message Date
Hynek Schlawack 6fda0a4e08
Make Converter a kind of adapter, fix converters.pipe (#1328)
* Make Converter a kind of adapter, fix converters.pipe

* Fix import cycle on 3.7/8

* stray space

* Create static __call__ on Converter instantiation

* Add tests for adapters doing passing correct args

* Add news fragment
2024-08-06 13:49:43 +02:00
Hynek Schlawack 59a445e584
Purge stale Python 2/3 mentions 2022-12-18 10:54:37 +01:00
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 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 48755905ee
Don't reset custom __setattr__ in slotted classes (#681)
* Don't reset custom __setattr__ in slotted classes

Fixes #680

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

* Simplify

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

* Be defensive about __bases__

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

* _Classes_ always have a __dict__

* Tighten xfail

* Clarify what need to be reset and when

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

* Reset __attrs_own_setattr__ along with __setattr__

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

* Update src/attr/_make.py

Co-authored-by: Paul Ganssle <paul@ganssle.io>

* Differentiate between own (= attrs) and custom (= user) __setattrs__

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

* We've always used __bases__ in our call to type()

So no reason for being defensive.

* Update tests/test_setattr.py

Co-authored-by: Paul Ganssle <paul@ganssle.io>

Co-authored-by: Paul Ganssle <paul@ganssle.io>
2020-09-05 09:46:06 +02:00
Hynek Schlawack 106c33c205
Clear __setattr__ if it was inherited && written by us (#663)
Signed-off-by: Hynek Schlawack <hs@ox.cx>
2020-08-13 13:49:44 +02:00