From ed0f13f85c9cc0a387291b3df3125507f8540b0a Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Mon, 16 Dec 2024 05:57:03 +0100 Subject: [PATCH 1/3] Add Python 3.12 to the CI matrix --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b85873b0..f9aaa372 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,6 +54,7 @@ jobs: - Windows - macOS python-version: + - "3.12" - "3.11" - "3.10" - "3.9" From 6a4e1738ae122c223862f46a2fffecff5e386b32 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 17 Dec 2024 00:51:47 +0100 Subject: [PATCH 2/3] Handle pip 23.1.2 @ Python 3.12 freeze exclusion Ref https://github.com/jazzband/pip-tools/pull/2148#issuecomment-2545479219 --- tests/test_sync.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/test_sync.py b/tests/test_sync.py index e84b598b..c94b6e3f 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -12,6 +12,7 @@ from piptools.exceptions import IncompatibleRequirements from piptools.sync import dependency_tree, diff, merge, sync +from piptools.utils import PIP_VERSION from .constants import PACKAGES_PATH @@ -168,13 +169,20 @@ def test_diff_should_not_uninstall(fake_dist): "pip-tools==1.1.1", "pip-review==1.1.1", "pkg-resources==0.0.0", - "setuptools==34.0.0", - "wheel==0.29.0", "python==3.0", - "distribute==0.1", "wsgiref==0.1", "argparse==0.1", ) + if PIP_VERSION[:3] < (23, 2) or sys.version_info < (3, 12): + # github.com/jazzband/pip-tools/pull/2148#issuecomment-2545479219 + # Python 3.12 removed vendored `setuptools` and pip 23.2 reacted + # with stopping special-casing excluding the following projects: + ignored += ( + "setuptools==34.0.0", + "wheel==0.29.0", + "distribute==0.1", + ) + installed = [fake_dist(pkg) for pkg in ignored] reqs = [] From 088299b3d6365546c9040f941ce26ccf47e3f049 Mon Sep 17 00:00:00 2001 From: Sviatoslav Sydorenko Date: Tue, 17 Dec 2024 01:11:51 +0100 Subject: [PATCH 3/3] Bump lowest tested pip to v23.1 --- pyproject.toml | 3 ++- tox.ini | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index ac3e04ee..21360a37 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,8 @@ dependencies = [ # direct dependencies "build >= 1.0.0", "click >= 8", - "pip >= 22.2", + "pip >= 23.1; python_version >= '3.12'", + "pip >= 22.2; python_version < '3.12'", "pyproject_hooks", "tomli; python_version < '3.11'", # indirect dependencies diff --git a/tox.ini b/tox.ini index 85f3dc68..b565226a 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,8 @@ extras = coverage: coverage deps = pipsupported: pip==24.2 - piplowest: pip==22.2.* + piplowest: pip==23.1.*; python_version >= "3.12" + piplowest: pip==22.2.*; python_version < "3.12" piplatest: pip pipmain: https://github.com/pypa/pip/archive/main.zip setenv =