From 5331a3f6738c8a16ff374c7c2977dd783bb3c13e Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Mon, 27 Jan 2025 13:43:34 -0500 Subject: [PATCH] feat: drop Python 3.7 Signed-off-by: Henry Schreiner --- .github/workflows/checks.yml | 2 +- .github/workflows/tests.yml | 7 +------ .readthedocs.yml | 3 +++ noxfile.py | 2 +- pyproject.toml | 7 +------ pyproject_metadata/project_table.py | 8 ++------ tests/test_standard_metadata.py | 6 +++--- 7 files changed, 12 insertions(+), 23 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 3df74be..9d10aad 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -15,7 +15,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: 3.8 - name: Install nox run: python -m pip install nox diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c8999ab..fd81b0b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,7 +21,6 @@ jobs: - "windows-latest" - "ubuntu-latest" python: - - "3.7" - "3.8" - "3.9" - "3.10" @@ -30,7 +29,7 @@ jobs: - "3.13" include: - os: macos-13 - python: "3.7" + python: "3.8" - os: macos-14 python: "3.12" @@ -47,10 +46,6 @@ jobs: - name: Prepare nox run: pipx install nox - - name: Limit virtualenv on 3.7 - if: matrix.python == '3.7' - run: pipx inject --force nox 'virtualenv<20.27.0' - - name: Run tests run: nox -s test-${{ matrix.python }} diff --git a/.readthedocs.yml b/.readthedocs.yml index 7543ffb..da7e9ee 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -1,5 +1,8 @@ version: 2 +sphinx: + configuration: docs/conf.py + build: os: ubuntu-22.04 tools: diff --git a/noxfile.py b/noxfile.py index c9e9e0e..2f642e1 100644 --- a/noxfile.py +++ b/noxfile.py @@ -16,7 +16,7 @@ ] -@nox.session(python="3.7") +@nox.session(python="3.8") def mypy(session: nox.Session) -> None: """ Run a type checker. diff --git a/pyproject.toml b/pyproject.toml index 51e50e6..003da05 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,7 @@ name = "pyproject-metadata" dynamic = ["version"] description = "PEP 621 metadata parsing" readme = "README.md" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [ { name = "Filipe LaĆ­ns", email = "lains@riseup.net" }, ] @@ -15,7 +15,6 @@ classifiers = [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", @@ -25,7 +24,6 @@ classifiers = [ ] dependencies = [ "packaging>=19.0", - "typing_extensions; python_version<'3.8'", ] [project.optional-dependencies] @@ -52,9 +50,6 @@ include = ["LICENSE", "tests/**", "docs/**", ".gitignore"] [tool.uv] dev-dependencies = ["pyproject-metadata[test]"] -environments = [ - "python_version >= '3.10'", -] [tool.pytest.ini_options] diff --git a/pyproject_metadata/project_table.py b/pyproject_metadata/project_table.py index a92d66d..093e3f2 100644 --- a/pyproject_metadata/project_table.py +++ b/pyproject_metadata/project_table.py @@ -14,16 +14,12 @@ import typing from typing import Any, Dict, List, Union -if sys.version_info < (3, 11): +if sys.version_info < (3, 11): # pragma: nocover from typing_extensions import Required else: from typing import Required -if sys.version_info < (3, 8): - from typing_extensions import Literal, TypedDict -else: - from typing import Literal, TypedDict - +from typing import Literal, TypedDict __all__ = [ "BuildSystemTable", diff --git a/tests/test_standard_metadata.py b/tests/test_standard_metadata.py index fb4496a..177b095 100644 --- a/tests/test_standard_metadata.py +++ b/tests/test_standard_metadata.py @@ -1259,7 +1259,7 @@ def test_license_file_24( pre_spdx = ( metadata_version in pyproject_metadata.constants.PRE_SPDX_METADATA_VERSIONS ) - with contextlib.nullcontext() if pre_spdx else pytest.warns( # type: ignore[attr-defined] + with contextlib.nullcontext() if pre_spdx else pytest.warns( pyproject_metadata.errors.ConfigurationWarning ): metadata = pyproject_metadata.StandardMetadata.from_pyproject( @@ -1444,8 +1444,8 @@ def test_statically_defined_dynamic_field() -> None: "value", [ "<3.10", - ">3.7,<3.11", - ">3.7,<3.11,!=3.8.4", + ">3.8,<3.11", + ">3.8,<3.11,!=3.8.4", "~=3.10,!=3.10.3", ], )