diff --git a/README.md b/README.md index c680c7b..03c73d6 100644 --- a/README.md +++ b/README.md @@ -108,57 +108,87 @@ decorators are extracted from the ast. -U -r requirements.txt`. * Start developing. * To run all tests with [tox](https://tox.readthedocs.io/en/latest/), - Python 3.7, 3.8, 3.9 and 3.10 must be available. You might want to look + Python 3.7, 3.8, 3.9, 3.10 and 3.11 must be available. You might want to look into using [pyenv](https://github.com/pyenv/pyenv). # Changelog -## Upcoming +## v0.1.0 -* Implement support for flexible matching of mypy error codes +* Implement support for flexible matching of mypy error codes (towards [#36][i36], [#41][p41]) +* Add support for pytest 7.2.x ([#42][p42]) +* Add support for mypy 1.0.x ([#42][p42]) +* Add support for Python 3.11 ([#42][p42]) +* Drop support for pytest 6.x ([#42][p42]) +* Drop support for mypy versions less than 0.931 ([#42][p42]) ## v0.0.12 -* Allow Windows drives in filename (#17, #34) -* Support async def tests (#30, #31) -* Add support for mypy 0.971 (#27) -* Remove support for Python 3.6 (#32) +* Allow Windows drives in filename ([#17][i17], [#34][p34]) +* Support async def tests ([#30][i30], [#31][p31]) +* Add support for mypy 0.971 ([#35][i35], [#27][i27]) +* Remove support for Python 3.6 ([#32][p32]) +* Bump development dependencies ([#40][p40]) ## v0.0.11 -* Add support for mypy 0.960 (#25) +* Add support for mypy 0.960 ([#25][p25]) ## v0.0.10 -* Add support for pytest 7.0.x and require Python >= 3.7 (#23) -* Bump dependencies (#24) +* Add support for pytest 7.0.x and require Python >= 3.7 ([#23][p23]) +* Bump dependencies ([#24][p24]) ## v0.0.9 -* Disable soft error limit (#21) +* Disable soft error limit ([#21][p21]) ## v0.0.8 -* Normalize messages to enable support for mypy 0.902 and pytest 6.2.4 (#20) +* Normalize messages to enable support for mypy 0.902 and pytest 6.2.4 ([#20][p20]) ## v0.0.7 -* Fix `PYTEST_VERSION_INFO` - by [@blueyed](https://github.com/blueyed) (#8) -* Always pass `--check-untyped-defs` to mypy (#11) -* Respect pytest config `python_files` when identifying pytest test modules (#12) +* Fix `PYTEST_VERSION_INFO` - by [@blueyed](https://github.com/blueyed) ([#8][p8]) +* Always pass `--check-untyped-defs` to mypy ([#11][p11]) +* Respect pytest config `python_files` when identifying pytest test modules ([#12][p12]) ## v0.0.6 - add pytest 5.4 support -* Update the plugin to work with pytest 5.4 (#7) +* Update the plugin to work with pytest 5.4 ([#7][p7]) ## v0.0.5 - CI improvements -* Make invoke tasks work (partially) on Windows (#6) +* Make invoke tasks work (partially) on Windows ([#6][p6]) * Add an invoke task to run tox environments by selecting globs (e.g., - `inv tox -e py-*`) (#6) + `inv tox -e py-*`) ([#6][p6]) * Use coverage directly for code coverage to get more consistent - parallel run results (#6) + parallel run results ([#6][p6]) * Use flit fork dflit to make packaging work with `LICENSES` directory - (#6) -* Bump dependencies (#6) + ([#6][p6]) +* Bump dependencies ([#6][p6]) + + +[i17]: https://github.com/davidfritzsche/pytest-mypy-testing/issues/17 +[i27]: https://github.com/davidfritzsche/pytest-mypy-testing/issues/27 +[i30]: https://github.com/davidfritzsche/pytest-mypy-testing/issues/30 +[i35]: https://github.com/davidfritzsche/pytest-mypy-testing/issues/35 +[i36]: https://github.com/davidfritzsche/pytest-mypy-testing/issues/36 + +[p6]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/6 +[p7]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/7 +[p8]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/8 +[p11]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/11 +[p12]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/12 +[p20]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/20 +[p21]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/21 +[p23]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/23 +[p24]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/24 +[p25]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/25 +[p31]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/31 +[p32]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/32 +[p34]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/34 +[p40]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/40 +[p41]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/41 +[p42]: https://github.com/davidfritzsche/pytest-mypy-testing/pull/42 diff --git a/pyproject.toml b/pyproject.toml index 2045395..75cc1ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", "Typing :: Typed", ] description-file = "README.md" @@ -29,8 +30,8 @@ dist-name = "pytest-mypy-testing" home-page = "https://github.com/davidfritzsche/pytest-mypy-testing" license = "Apache-2.0 OR MIT" requires = [ - "pytest>=6,<8", - "mypy", + "pytest>=7,<8", + "mypy>=0.931", ] requires-python = ">=3.7" @@ -42,20 +43,11 @@ include = ["src/pytest_mypy_testing/_version.py"] [tool.black] line-length = 88 -target-version = ['py37', 'py38'] +target-version = ['py37', 'py38', 'py39', 'py310', 'py311'] include = '\.pyi?$' -exclude = ''' +extend-exclude = ''' ( - /\.eggs/ - | /\.git/ - | /\.hg/ - | /\.mypy_cache/ - | /\.tox/ - | /\.venv/ - | /_build/ - | /_version\.py - | /buck-out/ - | /build/ + /_version\.py | /dist/ ) ''' diff --git a/tests/test_plugin.py b/tests/test_plugin.py index 6e836bd..bfd773f 100644 --- a/tests/test_plugin.py +++ b/tests/test_plugin.py @@ -7,7 +7,6 @@ import pytest from _pytest.config import Config -from py._path.local import LocalPath from pytest_mypy_testing.message import Severity from pytest_mypy_testing.parser import MypyTestFile @@ -19,6 +18,12 @@ from pytest_mypy_testing.strutil import dedent +try: + from py._path.local import LocalPath +except ModuleNotFoundError: + from _pytest._py.path import LocalPath + + PYTEST_VERSION = pytest.__version__ PYTEST_VERSION_INFO = tuple(int(part) for part in PYTEST_VERSION.split(".")[:3]) diff --git a/tox.ini b/tox.ini index 3506ae6..0a85d34 100644 --- a/tox.ini +++ b/tox.ini @@ -1,41 +1,32 @@ # SPDX-FileCopyrightText: David Fritzsche # SPDX-License-Identifier: CC0-1.0 + [tox] isolated_build = True envlist = - {py37,py38,py39}-pytest{62,70,71}-mypy{0910,0931,0971} - {py310}-pytest{62,71}-mypy{0910,0931,0971} - py-pytest{62,70,71}-mypy{0910,0931,0971} + {py37,py38,py39}-pytest{70,71,72}-mypy{093,097,10} + {py310,py311}-pytest{70,71,72}-mypy{093,097,10} + py-pytest{70,71,72}-mypy{093,097,10} linting [testenv] deps = coverage[toml] - pytest53: pytest~=5.3.5 - pytest54: pytest~=5.4.1 - pytest60: pytest~=6.0.2 - pytest61: pytest~=6.1.2 - pytest62: pytest~=6.2.5 pytest70: pytest~=7.0.1 - pytest71: pytest~=7.1.2 - pytest-cov - pytest-html - mypy0902: mypy==0.902 - mypy0910: mypy==0.910 - mypy0921: mypy==0.921 - mypy0931: mypy==0.931 - mypy0942: mypy==0.942 - mypy0950: mypy==0.950 - mypy0960: mypy==0.960 - mypy0961: mypy==0.961 - mypy0971: mypy==0.971 + pytest71: pytest~=7.1.3 + pytest72: pytest~=7.2.1 + mypy093: mypy==0.931 + mypy094: mypy==0.942 + mypy095: mypy==0.950 + mypy096: mypy==0.960 + mypy096: mypy==0.961 + mypy097: mypy==0.971 + mypy099: mypy==0.991 + mypy10: mypy==1.0.1 setenv = COVERAGE_FILE={toxinidir}/build/{envname}/coverage commands = - python -m coverage run --context "{envname}" -m pytest \ - {posargs} \ - --html={toxinidir}/build/{envname}/pytest-report.html \ - --junitxml={toxinidir}/build/{envname}/junit.xml + python -m coverage run --context "{envname}" -m pytest {posargs} --junitxml={toxinidir}/build/{envname}/junit.xml [testenv:black] basepython = python3.10