From 19de6e50acac2dd2a57a481c1a7eb666838c9869 Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Mon, 15 Aug 2022 14:53:33 +0300 Subject: [PATCH] Version 1.10.0 release (#104) --- .github/workflows/test.yml | 4 +-- CHANGELOG.md | 9 ++++++ README.md | 2 +- pytest_mypy_plugins/item.py | 2 -- pytest_mypy_plugins/tests/fixtures/pair.py | 2 -- .../tests/test-paths-from-env.yml | 28 ++++--------------- setup.py | 10 ++++--- 7 files changed, 24 insertions(+), 33 deletions(-) delete mode 100644 pytest_mypy_plugins/tests/fixtures/pair.py diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b2abfe6..1bbdfcf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -13,8 +13,8 @@ jobs: strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] - pytest-version: ["~=6.2", "==7.0.0rc1"] # TODO: enable `~=7.0` + python-version: ["3.7", "3.8", "3.9", "3.10"] + pytest-version: ["~=6.2", "~=7.1"] steps: - uses: actions/checkout@v3 diff --git a/CHANGELOG.md b/CHANGELOG.md index 2e0399c..a4b01a5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,15 @@ # Version history +## Version 1.10.0 + +### Features + +- Changes how `mypy>=0.970` handles `MYPYPATH` +- Bumps minimal `mypy` version to `mypy>=0.970` +- Drops `python3.6` support + + ## Version 1.9.3 ### Bugfixes diff --git a/README.md b/README.md index 02cacd4..70e7ffb 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ You can also specify `PYTHONPATH`, `MYPYPATH`, or any other environment variable instance: Pair reveal_type(instance) # N: Revealed type is 'pair.Pair' env: - - MYPYPATH=./pytest_mypy_plugins/tests/fixtures + - MYPYPATH=../fixtures ``` diff --git a/pytest_mypy_plugins/item.py b/pytest_mypy_plugins/item.py index 0c210a3..1ffd091 100644 --- a/pytest_mypy_plugins/item.py +++ b/pytest_mypy_plugins/item.py @@ -384,8 +384,6 @@ def _collect_mypy_path(self, rootdir: Optional[Path]) -> None: existing_mypy_path = os.environ.get("MYPYPATH") if existing_mypy_path: mypy_path_parts.append(existing_mypy_path) - if self.base_ini_fpath: - mypy_path_parts.append(os.path.dirname(self.base_ini_fpath)) mypy_path_key = self.environment_variables.get("MYPYPATH") if mypy_path_key: mypy_path_parts.append(maybe_to_abspath(mypy_path_key, rootdir)) diff --git a/pytest_mypy_plugins/tests/fixtures/pair.py b/pytest_mypy_plugins/tests/fixtures/pair.py deleted file mode 100644 index ed373d1..0000000 --- a/pytest_mypy_plugins/tests/fixtures/pair.py +++ /dev/null @@ -1,2 +0,0 @@ -class Pair(object): - """We only have this type to make sure that MYPYPATH works.""" diff --git a/pytest_mypy_plugins/tests/test-paths-from-env.yml b/pytest_mypy_plugins/tests/test-paths-from-env.yml index e355c80..62ef522 100644 --- a/pytest_mypy_plugins/tests/test-paths-from-env.yml +++ b/pytest_mypy_plugins/tests/test-paths-from-env.yml @@ -1,29 +1,13 @@ -- case: mypy_path_from_env - main: | - from pair import Pair - - a: Pair - reveal_type(a) # N: Revealed type is "pair.Pair" - env: - - MYPYPATH=./pytest_mypy_plugins/tests/fixtures - - -- case: mypy_path_from_env_with_error - main: | - from pair import Missing - out: | - main:1: error: Module "pair" has no attribute "Missing" - env: - - MYPYPATH=./pytest_mypy_plugins/tests/fixtures - - - case: add_mypypath_env_var_to_package_search main: | import extra_module + extra_module.extra_fn() + + extra_module.missing() # E: Module has no attribute "missing" env: - - MYPYPATH=./extras + - MYPYPATH=../extras files: - - path: extras/extra_module.py + - path: ../extras/extra_module.py content: | - def extra_fn(): + def extra_fn() -> None: pass diff --git a/setup.py b/setup.py index 55b2dbf..706d140 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ dependencies = [ "pytest>=6.0.0", - "mypy>=0.900", + "mypy>=0.970", "decorator", "pyyaml", "chevron", @@ -15,7 +15,7 @@ setup( name="pytest-mypy-plugins", - version="1.9.3", + version="1.10.0", description="pytest plugin for writing tests for mypy plugins", long_description=readme, long_description_content_type="text/markdown", @@ -23,16 +23,18 @@ url="https://github.com/TypedDjango/pytest-mypy-plugins", author="Maksim Kurnikov", author_email="maxim.kurnikov@gmail.com", + maintainer="Nikita Sobolev", + maintainer_email="mail@sobolevn.me", packages=["pytest_mypy_plugins"], # the following makes a plugin available to pytest entry_points={"pytest11": ["pytest-mypy-plugins = pytest_mypy_plugins.collect"]}, install_requires=dependencies, - python_requires=">=3.6", + python_requires=">=3.7", package_data={ "pytest_mypy_plugins": ["py.typed"], }, classifiers=[ - "Development Status :: 3 - Alpha", + "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7",