From 0ea820b6a8e981871564a6d96387a04bb35323f2 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Sat, 21 Dec 2024 22:58:52 +0300 Subject: [PATCH] Release 3.2.0 --- .github/workflows/test.yml | 10 +++------- CHANGELOG.md | 13 +++++++++++++ pyproject.toml | 12 ++---------- pytest_mypy_plugins/collect.py | 2 +- pytest_mypy_plugins/utils.py | 2 +- requirements.txt | 2 ++ setup.py | 6 +++--- 7 files changed, 25 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index fa99d82..945e369 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,10 +21,8 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - pytest-version: ["~=7.2", "~=8.1"] - # TODO: remove after several new versions of mypy - mypy-version: ["~=1.7", "~=1.10"] + python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + pytest-version: ["~=7.2", "~=8.3"] steps: - uses: actions/checkout@v4 @@ -38,8 +36,6 @@ jobs: pip install -e . # Force correct `pytest` version for different envs: pip install -U "pytest${{ matrix.pytest-version }}" - # Force correct `mypy` version: - pip install -U "mypy${{ matrix.mypy-version }}" - name: Run tests run: pytest @@ -59,5 +55,5 @@ jobs: - name: Run linters run: | mypy . - black --check pytest_mypy_plugins setup.py + black --check . isort --check --diff . diff --git a/CHANGELOG.md b/CHANGELOG.md index 108556c..c684e94 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,19 @@ # Version history +## 3.2.0 + +### Features + +- Drops `python3.8` support +- Adds official `python3.13` support + +### Bugfixes + +- Fixes regex for colon output `:`, #155 +- Fixes internal error with `TraceLastReprEntry`, #154 + + ## 3.1.2 ### Bugfixes diff --git a/pyproject.toml b/pyproject.toml index 4d0dffa..cb41c13 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,15 +1,7 @@ [tool.mypy] +strict = true ignore_missing_imports = true -strict_optional = true -no_implicit_optional = true -disallow_any_generics = true -disallow_untyped_defs = true -strict_equality = true warn_unreachable = true -warn_no_return = true -warn_unused_ignores = true -warn_redundant_casts = true -warn_unused_configs = true [tool.pytest.ini_options] python_files = "test_*.py" @@ -17,7 +9,7 @@ addopts = "-s --mypy-extension-hook pytest_mypy_plugins.tests.reveal_type_hook.h [tool.black] line-length = 120 -target-version = ["py38"] +target-version = ["py39"] [tool.isort] include_trailing_comma = true diff --git a/pytest_mypy_plugins/collect.py b/pytest_mypy_plugins/collect.py index 34b9fe5..0670d99 100644 --- a/pytest_mypy_plugins/collect.py +++ b/pytest_mypy_plugins/collect.py @@ -168,7 +168,7 @@ def collect(self) -> Iterator["YamlTestItem"]: ) def _eval_skip(self, skip_if: str) -> bool: - return eval(skip_if, {"sys": sys, "os": os, "pytest": pytest, "platform": platform}) + return bool(eval(skip_if, {"sys": sys, "os": os, "pytest": pytest, "platform": platform})) def pytest_collect_file(file_path: pathlib.Path, parent: Node) -> Optional[YamlTestFile]: diff --git a/pytest_mypy_plugins/utils.py b/pytest_mypy_plugins/utils.py index d755508..0dfbfdd 100644 --- a/pytest_mypy_plugins/utils.py +++ b/pytest_mypy_plugins/utils.py @@ -78,7 +78,7 @@ def matches(self, actual: str) -> bool: ) + self.message ) - return regex.match(pattern, actual) + return bool(regex.match(pattern, actual)) else: return str(self) == actual diff --git a/requirements.txt b/requirements.txt index 9ef9dde..49449f4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,6 @@ isort types-decorator types-PyYAML types-setuptools +types-regex +mypy==1.13 -e . diff --git a/setup.py b/setup.py index c8c8123..1d7b322 100644 --- a/setup.py +++ b/setup.py @@ -17,7 +17,7 @@ setup( name="pytest-mypy-plugins", - version="3.1.2", + version="3.2.0", description="pytest plugin for writing tests for mypy plugins", long_description=readme, long_description_content_type="text/markdown", @@ -31,7 +31,7 @@ # the following makes a plugin available to pytest entry_points={"pytest11": ["pytest-mypy-plugins = pytest_mypy_plugins.collect"]}, install_requires=dependencies, - python_requires=">=3.8", + python_requires=">=3.9", package_data={ "pytest_mypy_plugins": ["py.typed", "schema.json"], }, @@ -39,11 +39,11 @@ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Typing :: Typed", ], )