Skip to content

Commit f0d2f50

Browse files
committed
Handle pip 23.1.2 @ Python 3.12 freeze exclusion
Ref jazzband#2148 (comment)
1 parent 33b1011 commit f0d2f50

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

tests/test_sync.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
from piptools.exceptions import IncompatibleRequirements
1414
from piptools.sync import dependency_tree, diff, merge, sync
15+
from piptools.utils import PIP_VERSION
1516

1617
from .constants import PACKAGES_PATH
1718

@@ -168,13 +169,20 @@ def test_diff_should_not_uninstall(fake_dist):
168169
"pip-tools==1.1.1",
169170
"pip-review==1.1.1",
170171
"pkg-resources==0.0.0",
171-
"setuptools==34.0.0",
172-
"wheel==0.29.0",
173172
"python==3.0",
174-
"distribute==0.1",
175173
"wsgiref==0.1",
176174
"argparse==0.1",
177175
)
176+
if PIP_VERSION[:3] < (23, 2) or sys.version_info < (3, 12):
177+
# github.com/jazzband/pip-tools/pull/2148#issuecomment-2545479219
178+
# Python 3.12 removed vendored `setuptools` and pip 23.2 reacted
179+
# with stopping special-casing excluding the following projects:
180+
ignored += (
181+
"setuptools==34.0.0",
182+
"wheel==0.29.0",
183+
"distribute==0.1",
184+
)
185+
178186
installed = [fake_dist(pkg) for pkg in ignored]
179187
reqs = []
180188

0 commit comments

Comments
 (0)