Skip to content

Commit a4dea76

Browse files
committed
Add support for --pip-version 25.3.
1 parent 9187c3e commit a4dea76

File tree

5 files changed

+46
-23
lines changed

5 files changed

+46
-23
lines changed

.github/workflows/ci.yml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ jobs:
8989
# Unit tests:
9090
# -----------
9191
- test-cmd: test-py27-pip20.3.4--patched
92-
- test-cmd: test-py314-pip25.2
93-
- test-cmd: test-py315-pip25.2
92+
- test-cmd: test-py314-pip25.3
93+
- test-cmd: test-py315-pip25.3
9494
- test-cmd: test-pypy311-pip24.3.1
9595

9696
# Integration tests, split most into two shards:
@@ -104,14 +104,14 @@ jobs:
104104
- test-cmd: test-py38-pip22.3.1-integration
105105
pex-test-pos-args: --shard 2/2
106106

107-
- test-cmd: test-py314-pip25.2-integration
107+
- test-cmd: test-py314-pip25.3-integration
108108
pex-test-pos-args: --shard 1/2
109-
- test-cmd: test-py314-pip25.2-integration
109+
- test-cmd: test-py314-pip25.3-integration
110110
pex-test-pos-args: --shard 2/2
111111

112-
- test-cmd: test-py315-pip25.2-integration
112+
- test-cmd: test-py315-pip25.3-integration
113113
pex-test-pos-args: --shard 1/2
114-
- test-cmd: test-py315-pip25.2-integration
114+
- test-cmd: test-py315-pip25.3-integration
115115
pex-test-pos-args: --shard 2/2
116116

117117
# PyPy is slow enough to require extra sharding.
@@ -162,12 +162,12 @@ jobs:
162162
matrix:
163163
include:
164164
- python-version: "3.14"
165-
test-cmd: test-py314-pip25.2
165+
test-cmd: test-py314-pip25.3
166166
- python-version: "3.14"
167-
test-cmd: test-py314-pip25.2-integration
167+
test-cmd: test-py314-pip25.3-integration
168168
pex-test-pos-args: --shard 1/2
169169
- python-version: "3.14"
170-
test-cmd: test-py314-pip25.2-integration
170+
test-cmd: test-py314-pip25.3-integration
171171
pex-test-pos-args: --shard 2/2
172172
steps:
173173
- name: Checkout Pex
@@ -253,19 +253,19 @@ jobs:
253253
- python-version: "3.11"
254254
test-cmd: typecheck package docs
255255
- python-version: "3.14"
256-
test-cmd: test-py314-pip25.2
256+
test-cmd: test-py314-pip25.3
257257
artifact-name: unit
258258
pex-test-pos-args: --junit-report ../dist/test-results/unit.xml
259259
- python-version: "3.14"
260-
test-cmd: test-py314-pip25.2-integration
260+
test-cmd: test-py314-pip25.3-integration
261261
artifact-name: integration-1
262262
pex-test-pos-args: --shard 1/3 --junit-report ../dist/test-results/integration-1.xml
263263
- python-version: "3.14"
264-
test-cmd: test-py314-pip25.2-integration
264+
test-cmd: test-py314-pip25.3-integration
265265
artifact-name: integration-2
266266
pex-test-pos-args: --shard 2/3 --junit-report ../dist/test-results/integration-2.xml
267267
- python-version: "3.14"
268-
test-cmd: test-py314-pip25.2-integration
268+
test-cmd: test-py314-pip25.3-integration
269269
artifact-name: integration-3
270270
pex-test-pos-args: --shard 3/3 --junit-report ../dist/test-results/integration-3.xml
271271
steps:

pex/pip/tool.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,7 @@ def _spawn_pip_isolated_job(
552552
)
553553
return Job(command=command, process=process, finalizer=finalizer, context="pip")
554554

555-
@staticmethod
556-
def _iter_build_configuration_options(build_configuration):
555+
def _iter_build_configuration_options(self, build_configuration):
557556
# type: (BuildConfiguration) -> Iterator[str]
558557

559558
# N.B.: BuildConfiguration maintains invariants that ensure --only-binary, --no-binary,
@@ -576,7 +575,8 @@ def _iter_build_configuration_options(build_configuration):
576575
if build_configuration.prefer_older_binary:
577576
yield "--prefer-binary"
578577

579-
if build_configuration.use_pep517 is not None:
578+
# N.B.: In 25.3 `--use-pep517` became the default and only option.
579+
if build_configuration.use_pep517 is not None and self.version < PipVersion.v25_3:
580580
yield "--use-pep517" if build_configuration.use_pep517 else "--no-use-pep517"
581581

582582
if not build_configuration.build_isolation:

pex/pip/version.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,13 @@ def latest_compatible(cls, target=None):
369369
requires_python=">=3.9,<3.16",
370370
)
371371

372+
v25_3 = PipVersionValue(
373+
version="25.3",
374+
setuptools_version="80.9.0",
375+
wheel_version="0.45.1",
376+
requires_python=">=3.9,<3.16",
377+
)
378+
372379
VENDORED = v20_3_4_patched
373380
LATEST = LatestPipVersion()
374381
LATEST_COMPATIBLE = LatestCompatiblePipVersion()

pex/resolve/locker.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,16 @@ def _extract_resolve_data(artifact_url):
291291
def _maybe_record_wheel(self, url):
292292
# type: (str) -> ArtifactURL
293293
artifact_url = self.parse_url_and_maybe_record_fingerprint(url)
294+
295+
# N.B.: Lock resolves driven by `pip install --dry-run --report` will only consult PEP-658
296+
# `.whl.metadata` side-car files in the happy path; so we must use these as a proxy for the
297+
# `.whl` file they are paired with.
298+
# See: https://peps.python.org/pep-0658/
299+
if not self._lock_is_via_pip_download and artifact_url.url_info.path.endswith(".metadata"):
300+
artifact_url = ArtifactURL.from_url_info(
301+
artifact_url.url_info._replace(path=artifact_url.url_info.path[:-9])
302+
)
303+
294304
if artifact_url.is_wheel:
295305
pin, partial_artifact = self._extract_resolve_data(artifact_url)
296306

tests/integration/test_issue_1560.py

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import pytest
99

1010
from pex.common import safe_open, touch
11+
from pex.pip.version import PipVersion
1112
from pex.typing import TYPE_CHECKING
1213
from testing import (
1314
IntegResults,
@@ -88,12 +89,14 @@ def build_pex(*extra_args):
8889
build_pex().assert_success()
8990
build_pex("--force-pep517").assert_success()
9091

91-
result = build_pex("--no-use-pep517")
92-
result.assert_failure()
93-
assert (
94-
"ERROR: Disabling PEP 517 processing is invalid: project does not have a setup.py"
95-
in result.error
96-
)
92+
# N.B.: In 25.3 `--use-pep517` became the default and only option.
93+
if PipVersion.DEFAULT < PipVersion.v25_3:
94+
result = build_pex("--no-use-pep517")
95+
result.assert_failure()
96+
assert (
97+
"ERROR: Disabling PEP 517 processing is invalid: project does not have a setup.py"
98+
in result.error
99+
)
97100

98101

99102
def test_pep_517_for_legacy_project():
@@ -108,4 +111,7 @@ def assert_build_pex(*extra_args):
108111

109112
assert_build_pex()
110113
assert_build_pex("--use-pep517")
111-
assert_build_pex("--no-use-pep517")
114+
115+
# N.B.: In 25.3 `--use-pep517` became the default and only option.
116+
if PipVersion.DEFAULT < PipVersion.v25_3:
117+
assert_build_pex("--no-use-pep517")

0 commit comments

Comments
 (0)