Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
13 changes: 8 additions & 5 deletions tests/test_pytest_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import pytest_mypy


MYPY_VERSION = Version(mypy.version.__version__)
PYTEST_VERSION = Version(pytest.__version__)
PYTHON_VERSION = Version(
Expand Down Expand Up @@ -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)


Expand Down Expand Up @@ -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
Expand Down
42 changes: 24 additions & 18 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,23 @@ 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

[gh-actions]
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
Expand All @@ -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}
Expand All @@ -50,22 +56,22 @@ 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}/*

[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
Expand Down