diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b85873b00..f9aaa3723 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" diff --git a/pyproject.toml b/pyproject.toml index ac3e04ee1..0d5bc63bc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -20,10 +20,11 @@ classifiers = [ "Operating System :: OS Independent", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Programming Language :: Python", @@ -37,7 +38,7 @@ keywords = ["pip", "requirements", "packaging"] dependencies = [ # direct dependencies "build >= 1.0.0", - "click >= 8", + "click >= 8, < 8.2", "pip >= 22.2", "pyproject_hooks", "tomli; python_version < '3.11'", diff --git a/tests/test_cli_compile.py b/tests/test_cli_compile.py index 2c939ab0f..afc9c8776 100644 --- a/tests/test_cli_compile.py +++ b/tests/test_cli_compile.py @@ -3,6 +3,7 @@ import hashlib import os import pathlib +import re import shutil import subprocess import sys @@ -2664,7 +2665,7 @@ def test_error_in_pyproject_toml( captured = capfd.readouterr() assert ( - "`project` must contain ['name'] properties" in captured.err + bool(re.search(r"`project` must contain \['[^']+'\] properties", captured.err)) ) is verbose_option diff --git a/tests/test_cli_sync.py b/tests/test_cli_sync.py index 5e69770fe..cebfd7081 100644 --- a/tests/test_cli_sync.py +++ b/tests/test_cli_sync.py @@ -333,7 +333,9 @@ def test_invalid_pip_version_in_python_executable( with open(sync.DEFAULT_REQUIREMENTS_FILE, "w") as req_in: req_in.write("small-fake-a==1.10.0") - custom_executable = tmp_path / "custom_executable" + # a dummy executable on Windows needs to end in `.exe` in order for + # `shutil.which` to find it + custom_executable = tmp_path / "custom_executable.exe" custom_executable.write_text("") custom_executable.chmod(0o700) diff --git a/tests/test_sync.py b/tests/test_sync.py index e84b598ba..a6b19b83e 100644 --- a/tests/test_sync.py +++ b/tests/test_sync.py @@ -168,13 +168,19 @@ 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", ) + # on Python 3.12 and above, `ensurepip` and `venv` do not default to installing + # 'setuptools' -- as such, `pip` changes behavior on many Python 3.12 environments + # to use isolated builds + if sys.version_info < (3, 12): + ignored += ( + "setuptools==34.0.0", + "wheel==0.29.0", + "distribute==0.1", + ) installed = [fake_dist(pkg) for pkg in ignored] reqs = [] diff --git a/tox.ini b/tox.ini index 85f3dc685..dba0b4bb2 100644 --- a/tox.ini +++ b/tox.ini @@ -15,7 +15,11 @@ extras = coverage: coverage deps = pipsupported: pip==24.2 - piplowest: pip==22.2.* + pipsupported: setuptools <= 75.8.2 + + piplowest: pip == 22.2.* ; python_version < "3.12" + piplowest: pip == 23.2.* ; python_version >= "3.12" + piplatest: pip pipmain: https://github.com/pypa/pip/archive/main.zip setenv =