From 237952cf5fa9db14a8e554cccc38444517815b90 Mon Sep 17 00:00:00 2001 From: David Tucker Date: Sat, 6 May 2023 14:06:04 -0700 Subject: [PATCH 1/3] Drop support for Python 3.6 --- .github/workflows/validation.yml | 2 +- setup.py | 5 ++--- tox.ini | 2 -- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/validation.yml b/.github/workflows/validation.yml index cca2f1d..3edcdb3 100644 --- a/.github/workflows/validation.yml +++ b/.github/workflows/validation.yml @@ -5,7 +5,7 @@ jobs: runs-on: ubuntu-20.04 strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v3 - uses: actions/setup-python@v4 diff --git a/setup.py b/setup.py index 6abbd5a..ce0b0c5 100644 --- a/setup.py +++ b/setup.py @@ -29,12 +29,12 @@ def read(fname): py_modules=[ os.path.splitext(os.path.basename(path))[0] for path in glob.glob("src/*.py") ], - python_requires=">=3.6", + python_requires=">=3.7", setup_requires=["setuptools-scm>=3.5"], install_requires=[ "attrs>=19.0", "filelock>=3.0", - 'pytest>=4.6; python_version>="3.6" and python_version<"3.10"', + 'pytest>=4.6; python_version<"3.10"', 'pytest>=6.2; python_version>="3.10"', 'mypy>=0.500; python_version<"3.8"', 'mypy>=0.700; python_version>="3.8" and python_version<"3.9"', @@ -48,7 +48,6 @@ def read(fname): "Topic :: Software Development :: Testing", "Programming Language :: Python", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", diff --git a/tox.ini b/tox.ini index ff5684c..1781e33 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,6 @@ minversion = 3.20 isolated_build = true envlist = - py36-pytest{4.6, 5.0, 5.x, 6.0, 6.x, 7.0, 7.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x, 0.80, 0.8x, 0.90, 0.9x} py37-pytest{4.6, 5.0, 5.x, 6.0, 6.x, 7.0, 7.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x, 0.80, 0.8x, 0.90, 0.9x} py38-pytest{4.6, 5.0, 5.x, 6.0, 6.x, 7.0, 7.x}-mypy{0.71, 0.7x, 0.80, 0.8x, 0.90, 0.9x} py39-pytest{4.6, 5.0, 5.x, 6.0, 6.x, 7.0, 7.x}-mypy{0.78, 0.7x, 0.80, 0.8x, 0.90, 0.9x} @@ -14,7 +13,6 @@ envlist = [gh-actions] python = - 3.6: py36-pytest{4.6, 5.0, 5.x, 6.0, 6.x, 7.0, 7.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x, 0.80, 0.8x, 0.90, 0.9x} 3.7: py37-pytest{4.6, 5.0, 5.x, 6.0, 6.x, 7.0, 7.x}-mypy{0.50, 0.5x, 0.60, 0.6x, 0.70, 0.7x, 0.80, 0.8x, 0.90, 0.9x} 3.8: py38-pytest{4.6, 5.0, 5.x, 6.0, 6.x, 7.0, 7.x}-mypy{0.71, 0.7x, 0.80, 0.8x, 0.90, 0.9x}, publish, static 3.9: py39-pytest{4.6, 5.0, 5.x, 6.0, 6.x, 7.0, 7.x}-mypy{0.78, 0.7x, 0.80, 0.8x, 0.90, 0.9x} From 833a87a5b712c49816a6d7d1f9a587df7eca8449 Mon Sep 17 00:00:00 2001 From: David Tucker Date: Sat, 6 May 2023 13:39:34 -0700 Subject: [PATCH 2/3] Replace setup.py with PEP 621 metadata --- pyproject.toml | 45 ++++++++++++++++++++++++++++++++++++- setup.py | 60 -------------------------------------------------- tox.ini | 8 +++---- 3 files changed, 48 insertions(+), 65 deletions(-) delete mode 100644 setup.py diff --git a/pyproject.toml b/pyproject.toml index f26c121..6b70512 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,48 @@ [build-system] -requires = ["setuptools >= 59.6", "setuptools-scm[toml] >= 6.4", "wheel >= 0.37.1"] +requires = ["setuptools >= 61.0", "setuptools-scm >= 7.1", "wheel >= 0.40"] build-backend = "setuptools.build_meta" +[project] +name = "pytest-mypy" +dynamic = ["version"] +description = "A Pytest Plugin for Mypy" +readme = "README.rst" +license = {file = "LICENSE"} +maintainers = [ + {name = "David Tucker", email = "david@tucker.name"} +] +classifiers = [ + "Development Status :: 4 - Beta", + "Framework :: Pytest", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Software Development :: Testing", +] +requires-python = ">=3.7" +dependencies = [ + "attrs>=19.0", + "filelock>=3.0", + "pytest>=4.6; python_version<'3.10'", + "pytest>=6.2; python_version>='3.10'", + "mypy>=0.500; python_version<'3.8'", + "mypy>=0.700; python_version>='3.8' and python_version<'3.9'", + "mypy>=0.780; python_version>='3.9' and python_version<'3.11'", + "mypy>=0.900; python_version>='3.11'", +] + +[project.urls] +homepage = "https://github.com/realpython/pytest-mypy" + +[project.entry-points.pytest11] +mypy = "pytest_mypy" + [tool.setuptools_scm] diff --git a/setup.py b/setup.py deleted file mode 100644 index ce0b0c5..0000000 --- a/setup.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -import glob -import os -import codecs -from setuptools import setup, find_packages # type: ignore - - -def read(fname): - file_path = os.path.join(os.path.dirname(__file__), fname) - return codecs.open(file_path, encoding="utf-8").read() - - -setup( - name="pytest-mypy", - use_scm_version=True, - author="Daniel Bader", - author_email="mail@dbader.org", - maintainer="David Tucker", - maintainer_email="david@tucker.name", - license="MIT", - url="https://github.com/realpython/pytest-mypy", - description="Mypy static type checker plugin for Pytest", - long_description=read("README.rst"), - long_description_content_type="text/x-rst", - packages=find_packages("src"), - package_dir={"": "src"}, - py_modules=[ - os.path.splitext(os.path.basename(path))[0] for path in glob.glob("src/*.py") - ], - python_requires=">=3.7", - setup_requires=["setuptools-scm>=3.5"], - install_requires=[ - "attrs>=19.0", - "filelock>=3.0", - 'pytest>=4.6; python_version<"3.10"', - 'pytest>=6.2; python_version>="3.10"', - 'mypy>=0.500; python_version<"3.8"', - 'mypy>=0.700; python_version>="3.8" and python_version<"3.9"', - 'mypy>=0.780; python_version>="3.9" and python_version<"3.11"', - 'mypy>=0.900; python_version>="3.11"', - ], - classifiers=[ - "Development Status :: 4 - Beta", - "Framework :: Pytest", - "Intended Audience :: Developers", - "Topic :: Software Development :: Testing", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: Implementation :: CPython", - "Operating System :: OS Independent", - "License :: OSI Approved :: MIT License", - ], - entry_points={"pytest11": ["mypy = pytest_mypy"]}, -) diff --git a/tox.ini b/tox.ini index 1781e33..0762b8a 100644 --- a/tox.ini +++ b/tox.ini @@ -102,10 +102,10 @@ deps = flake8 ~= 4.0.0 mypy >= 0.900, < 0.910 commands = - black --check src setup.py tests - flake8 src setup.py tests - mypy src setup.py - bandit --recursive src setup.py + black --check src tests + flake8 src tests + mypy src + bandit --recursive src [flake8] max-line-length = 88 From 9b9ee9e878f11128c4d81717b23118a019fe9051 Mon Sep 17 00:00:00 2001 From: David Tucker Date: Sun, 7 May 2023 14:59:29 -0700 Subject: [PATCH 3/3] Use envtmpdir instead of distdir in tox.ini --- pyproject.toml | 6 +++--- tox.ini | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6b70512..9ee67de 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,10 +39,10 @@ dependencies = [ "mypy>=0.900; python_version>='3.11'", ] -[project.urls] -homepage = "https://github.com/realpython/pytest-mypy" - [project.entry-points.pytest11] mypy = "pytest_mypy" +[project.urls] +homepage = "https://github.com/realpython/pytest-mypy" + [tool.setuptools_scm] diff --git a/tox.ini b/tox.ini index 0762b8a..ba812fe 100644 --- a/tox.ini +++ b/tox.ini @@ -92,8 +92,8 @@ deps = build[virtualenv] ~= 0.9.0 twine ~= 4.0.0 commands = - {envpython} -m build --outdir {distdir} . - twine {posargs:check} {distdir}/* + {envpython} -m build --outdir {envtmpdir} . + twine {posargs:check} {envtmpdir}/* [testenv:static] deps =