Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Python 3.12 to the CI matrix #2148

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
- Windows
- macOS
python-version:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the conditional required here? Without it, would the rule supersede the previous, or both apply?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that not all pip versions would merge these properly otherwise. But I haven't checked in a while. FWIW, this is the typical idiom people tend to follow.

"pyproject_hooks",
"tomli; python_version < '3.11'",
# indirect dependencies
Expand Down
14 changes: 11 additions & 3 deletions tests/test_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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 = []

Expand Down
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
Loading