Commit Graph

12 Commits

Author SHA1 Message Date
layday ca6ce8c00e
Use `TypeGuard` for `has` in Python 3.10 and above (#997)
* Use `TypeGuard` for `has` in Python 3.10 and above

* fixup! Use `TypeGuard` for `has` in Python 3.10 and above

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

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

* Test the negative case

* Add type guard example

Co-authored-by: Hynek Schlawack <hs@ox.cx>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2022-08-16 07:20:32 +02:00
Hynek Schlawack c89abcd6e6 It totally is correct 2022-07-28 14:46:53 +02:00
Hynek Schlawack 557e3fd8ea Fix test_yaml
Looks like mypy added support for converter lambdas.
2022-07-27 16:30:18 +02:00
Tin Tvrtković c4ded79ff9
Mypy improvements (#890)
* Mypy improvements

* Change protocol, add a test

* Relax fields return type

* Test fixes

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2022-05-01 10:43:57 -06:00
wouter bolsterlee a22e98c6cb
No longer explicitly subclass ‘object’ (#940)
This is no longer relevant in Python 3+. Follow-up to !936.

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2022-03-21 10:35:44 +01: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
David Euresti 82ab0c1d11
Fix mypy tests. Looks like the tests are error order sensitive (#856) 2021-10-30 21:05:49 +02:00
David Euresti b8f5cd780b
Fix mypy tests. (#844)
Looks like the ordering changed
2021-09-19 17:09:35 +02:00
David Euresti ec249f62b3
Fix the mypy tests by double quoting. (#825) 2021-06-14 19:17:33 +02:00
David Euresti 467e28b268
Fix mypy tests (#749) 2021-01-23 10:33:13 +01:00
David Euresti 6b84ad2db2
Move some of the mypy tests over. (#738)
* First pass

* Fix the tests

* trim

Co-authored-by: Hynek Schlawack <hs@ox.cx>
2020-12-28 07:50:29 +01:00
David Euresti 3d274d0bfa
WIP: Add mypy tests (#737)
* Add basic mypy tests

* Only run mypy on 3.6+

* No pypy

* Fix things

* Oooh parametrized
2020-12-21 06:21:28 +01:00