From e972903850c2dd21c48c1bf627f74d32ca1d3d33 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade Date: Mon, 6 Nov 2023 19:30:30 +0200 Subject: [PATCH 1/3] Add support for Python 3.13 --- .github/workflows/test.yml | 2 +- noxfile.py | 1 + pyproject.toml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 8f81945e..48b97d3e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: matrix: os: [Ubuntu, Windows, macOS] python_version: - ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "pypy3.8", "pypy3.9", "pypy3.10"] + ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.8", "pypy3.9", "pypy3.10"] steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 diff --git a/noxfile.py b/noxfile.py index 4f97e8e5..fb18355d 100644 --- a/noxfile.py +++ b/noxfile.py @@ -29,6 +29,7 @@ "3.10", "3.11", "3.12", + "3.13", "pypy3.8", "pypy3.9", "pypy3.10", diff --git a/pyproject.toml b/pyproject.toml index 9fa0fb17..be3d10c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,6 +24,7 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Typing :: Typed", From b43afbdef817a459e3b5bbdc5e7d6062861dfd05 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 5 Mar 2024 16:13:41 +0200 Subject: [PATCH 2/3] Enable colour in logs for readability --- .github/workflows/docs.yml | 3 +++ .github/workflows/lint.yml | 3 +++ .github/workflows/test.yml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 50cfb956..cc614f0f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -14,6 +14,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true +env: + FORCE_COLOR: 1 + jobs: docs: name: nox -s docs diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 652a2f92..2c1829dd 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,6 +16,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true +env: + FORCE_COLOR: 1 + jobs: lint: name: nox -s lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48b97d3e..c9d547b9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,6 +14,9 @@ concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} cancel-in-progress: true +env: + FORCE_COLOR: 1 + jobs: test: name: ${{ matrix.os }} / ${{ matrix.python_version }} From 6efed5ea351d4e2c9d8be9e56ddcbae7616e07f0 Mon Sep 17 00:00:00 2001 From: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Date: Tue, 5 Mar 2024 17:14:07 +0200 Subject: [PATCH 3/3] Drop support for EOL Python 3.7 --- .github/workflows/test.yml | 2 +- .pre-commit-config.yaml | 4 ++-- docs/development/getting-started.rst | 8 ++++++-- noxfile.py | 1 - pyproject.toml | 3 +-- src/packaging/_manylinux.py | 2 +- src/packaging/_musllinux.py | 2 +- src/packaging/metadata.py | 20 ++------------------ 8 files changed, 14 insertions(+), 28 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c9d547b9..debdb74d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,7 +26,7 @@ jobs: matrix: os: [Ubuntu, Windows, macOS] python_version: - ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.8", "pypy3.9", "pypy3.10"] + ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy3.8", "pypy3.9", "pypy3.10"] steps: - uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index c03c4d43..f0ff2fdf 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -19,9 +19,9 @@ repos: rev: v3.3.1 hooks: - id: pyupgrade - args: [--py37-plus] + args: [--py38-plus] - - repo: https://github.com/psf/black + - repo: https://github.com/psf/black-pre-commit-mirror rev: 22.12.0 hooks: - id: black diff --git a/docs/development/getting-started.rst b/docs/development/getting-started.rst index a713eac8..0cad38ae 100644 --- a/docs/development/getting-started.rst +++ b/docs/development/getting-started.rst @@ -30,11 +30,15 @@ each supported Python version and run the tests. For example: $ nox -s tests ... nox > Ran multiple sessions: - nox > * tests-3.7: success nox > * tests-3.8: success nox > * tests-3.9: success nox > * tests-3.10: success - nox > * tests-pypy3: skipped + nox > * tests-3.11: success + nox > * tests-3.12: success + nox > * tests-3.13: success + nox > * tests-pypy3.8: skipped + nox > * tests-pypy3.9: skipped + nox > * tests-pypy3.10: skipped You may not have all the required Python versions installed, in which case you will see one or more ``InterpreterNotFound`` errors. diff --git a/noxfile.py b/noxfile.py index fb18355d..454ba21c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,7 +23,6 @@ @nox.session( python=[ - "3.7", "3.8", "3.9", "3.10", diff --git a/pyproject.toml b/pyproject.toml index be3d10c8..fa51b898 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ name = "packaging" description = "Core utilities for Python packages" dynamic = ["version"] readme = "README.rst" -requires-python = ">=3.7" +requires-python = ">=3.8" authors = [{name = "Donald Stufft", email = "donald@stufft.io"}] classifiers = [ "Development Status :: 5 - Production/Stable", @@ -18,7 +18,6 @@ classifiers = [ "Programming Language :: Python", "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", diff --git a/src/packaging/_manylinux.py b/src/packaging/_manylinux.py index ad62505f..1f5f4ab3 100644 --- a/src/packaging/_manylinux.py +++ b/src/packaging/_manylinux.py @@ -167,7 +167,7 @@ def _parse_glibc_version(version_str: str) -> Tuple[int, int]: return int(m.group("major")), int(m.group("minor")) -@functools.lru_cache() +@functools.lru_cache def _get_glibc_version() -> Tuple[int, int]: version_str = _glibc_version_string() if version_str is None: diff --git a/src/packaging/_musllinux.py b/src/packaging/_musllinux.py index 86419df9..eb4251b5 100644 --- a/src/packaging/_musllinux.py +++ b/src/packaging/_musllinux.py @@ -28,7 +28,7 @@ def _parse_musl_version(output: str) -> Optional[_MuslVersion]: return _MuslVersion(major=int(m.group(1)), minor=int(m.group(2))) -@functools.lru_cache() +@functools.lru_cache def _get_musl_version(executable: str) -> Optional[_MuslVersion]: """Detect currently-running musl runtime version. diff --git a/src/packaging/metadata.py b/src/packaging/metadata.py index fb274930..436d73b1 100644 --- a/src/packaging/metadata.py +++ b/src/packaging/metadata.py @@ -3,7 +3,6 @@ import email.message import email.parser import email.policy -import sys import typing from typing import ( Any, @@ -11,9 +10,11 @@ Dict, Generic, List, + Literal, Optional, Tuple, Type, + TypedDict, Union, cast, ) @@ -21,23 +22,6 @@ from . import requirements, specifiers, utils, version as version_module T = typing.TypeVar("T") -if sys.version_info[:2] >= (3, 8): # pragma: no cover - from typing import Literal, TypedDict -else: # pragma: no cover - if typing.TYPE_CHECKING: - from typing_extensions import Literal, TypedDict - else: - try: - from typing_extensions import Literal, TypedDict - except ImportError: - - class Literal: - def __init_subclass__(*_args, **_kwargs): - pass - - class TypedDict: - def __init_subclass__(*_args, **_kwargs): - pass try: