Skip to content

Support mypy>=0.931,<1.1 and pytest>=7,<7.3 #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 51 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 6 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,16 @@ 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"
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"

Expand All @@ -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/
)
'''
Expand Down
7 changes: 6 additions & 1 deletion tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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])

Expand Down
39 changes: 15 additions & 24 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down