diff --git a/.github/workflows/publication.yml b/.github/workflows/publication.yaml similarity index 78% rename from .github/workflows/publication.yml rename to .github/workflows/publication.yaml index f38db8f..a3a7b9c 100644 --- a/.github/workflows/publication.yml +++ b/.github/workflows/publication.yaml @@ -1,13 +1,13 @@ name: Publication on: release: - types: [created] + types: [published] jobs: deploy: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: '3.8' - run: python -m pip install --upgrade tox-gh-actions diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yaml similarity index 71% rename from .github/workflows/validation.yml rename to .github/workflows/validation.yaml index dd36e5f..764a1c9 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yaml @@ -1,14 +1,14 @@ name: Validation on: [push, pull_request] jobs: - build: - runs-on: ubuntu-20.04 + tox: + runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} - run: python -m pip install --upgrade tox-gh-actions diff --git a/pyproject.toml b/pyproject.toml index be63658..8df1d06 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,6 +25,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Testing", ] diff --git a/tests/test_pytest_mypy.py b/tests/test_pytest_mypy.py index 1ad7153..b621a81 100644 --- a/tests/test_pytest_mypy.py +++ b/tests/test_pytest_mypy.py @@ -8,7 +8,6 @@ import pytest_mypy - MYPY_VERSION = Version(mypy.version.__version__) PYTEST_VERSION = Version(pytest.__version__) PYTHON_VERSION = Version( @@ -82,6 +81,12 @@ def test_mypy_encoding_warnings(testdir, monkeypatch): mypy_status_check = 1 mypy_checks = mypy_file_checks + mypy_status_check expected_warnings = 2 # https://github.com/python/mypy/issues/14603 + if MYPY_VERSION < Version("1.5"): + # DeprecationWarning: mypy_extensions.TypedDict is deprecated, + # and will be removed in a future version. + # Use typing.TypedDict or typing_extensions.TypedDict instead. + # https://github.com/python/mypy/pull/15494 + expected_warnings += 1 result.assert_outcomes(passed=mypy_checks, warnings=expected_warnings) @@ -699,12 +704,10 @@ def test_mypy_report_style(testdir, xdist_args): """Verify that --mypy-report-style functions correctly.""" module_name = "unmistakable_module_name" testdir.makepyfile( - **{ - module_name: """ + **{module_name: """ def pyfunc(x: int) -> str: return x * 2 - """ - }, + """}, ) result = testdir.runpytest_subprocess("--mypy-report-style", "no-path", *xdist_args) mypy_file_checks = 1 diff --git a/tox.ini b/tox.ini index 9deb574..efdc083 100644 --- a/tox.ini +++ b/tox.ini @@ -5,10 +5,11 @@ isolated_build = true envlist = py38-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} py39-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} - py310-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} - py311-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} - py312-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} - py313-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} + py310-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} + py311-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} + py312-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} + py313-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} + py314-pytest{9.0, 9.x}-mypy{2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} static publish @@ -16,10 +17,11 @@ envlist = python = 3.8: py38-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} 3.9: py39-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} - 3.10: py310-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} - 3.11: py311-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} - 3.12: py312-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}, static, publish - 3.13: py313-pytest{7.0, 7.x, 8.0, 8.x}-mypy{1.0, 1.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} + 3.10: py310-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} + 3.11: py311-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} + 3.12: py312-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x}, static, publish + 3.13: py313-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} + 3.14: py314-pytest{7.0, 7.x, 8.0, 8.x, 9.0, 9.x}-mypy{1.0, 1.x, 2.0, 2.x}-xdist{1.x, 2.0, 2.x, 3.0, 3.x} [testenv] constrain_package_deps = true @@ -28,17 +30,21 @@ deps = pytest7.x: pytest ~= 7.0 pytest8.0: pytest ~= 8.0.0 pytest8.x: pytest ~= 8.0 + pytest9.0: pytest ~= 9.0.0 + pytest9.x: pytest ~= 9.0 mypy1.0: mypy ~= 1.0.0 mypy1.x: mypy ~= 1.0 + mypy2.0: mypy ~= 2.0.0 + mypy2.x: mypy ~= 2.0 xdist1.x: pytest-xdist ~= 1.0 xdist2.0: pytest-xdist ~= 2.0.0 xdist2.x: pytest-xdist ~= 2.0 xdist3.0: pytest-xdist ~= 3.0.0 xdist3.x: pytest-xdist ~= 3.0 - packaging ~= 21.3 - pytest-cov ~= 4.1.0 - pytest-randomly ~= 3.4 + packaging ~= 26.2 + pytest-cov ~= 5.0.0 + pytest-randomly ~= 3.15 setenv = COVERAGE_FILE = .coverage.{envname} commands = pytest -p no:mypy {posargs:--cov pytest_mypy --cov-branch --cov-fail-under 100 --cov-report term-missing -n auto} @@ -50,8 +56,8 @@ testpaths = tests passenv = TWINE_* constrain_package_deps = false deps = - build[virtualenv] ~= 1.0.0 - twine ~= 5.0.0 + build[virtualenv] ~= 1.5.0 + twine ~= 6.2.0 commands = {envpython} -m build --outdir {envtmpdir} . twine {posargs:check} {envtmpdir}/* @@ -59,13 +65,13 @@ commands = [testenv:static] basepython = py312 # pytest.Node.from_parent uses typing.Self deps = - bandit ~= 1.7.0 - black ~= 24.2.0 - flake8 ~= 7.0.0 - mypy ~= 1.11.0 + bandit ~= 1.9.0 + black ~= 26.5.0 + flake8 ~= 7.3.0 + mypy ~= 2.1.0 pytest-xdist >= 3.6.0 # needed for type-checking commands = - black --check src tests + black --check --target-version py38 src tests flake8 src tests mypy --strict src bandit --recursive src