Skip to content

Commit fdd0d33

Browse files
authored
Update tests failing the Pip nightly adhoc job. (#3058)
1 parent b613088 commit fdd0d33

File tree

8 files changed

+36
-8
lines changed

8 files changed

+36
-8
lines changed

pex/pip/version.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def requirements(self):
118118

119119
@property
120120
def build_system_requires(self):
121-
# type: () -> Iterable[Requirement]
121+
# type: () -> Tuple[Requirement, ...]
122122
return ()
123123

124124
def requires_python_applies(self, target=None):
@@ -251,7 +251,7 @@ def requirement(self):
251251

252252
@property
253253
def build_system_requires(self):
254-
# type: () -> Iterable[Requirement]
254+
# type: () -> Tuple[Requirement, ...]
255255
build_system_requires = os.environ.get("_PEX_PIP_ADHOC_BUILD_SYSTEM_REQUIRES")
256256
if not build_system_requires:
257257
return ()

tests/integration/cli/commands/test_lock_resolve_auth.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ def ansicolors_and_pip_find_links_directory(
8383

8484
requirements = ["ansicolors==1.1.8"]
8585
if PipVersion.DEFAULT is not PipVersion.VENDORED:
86-
requirements.extend(map(str, PipVersion.DEFAULT.requirements))
86+
requirements.extend(
87+
map(str, PipVersion.DEFAULT.requirements + PipVersion.DEFAULT.build_system_requires)
88+
)
8789

8890
run_pex_command(
8991
args=(

tests/integration/cli/commands/test_split_universal_locks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,9 @@ def test_split_repos_lock(
275275
str(PipVersion.VENDORED.wheel_requirement),
276276
]
277277
else:
278-
requirements = list(map(str, PipVersion.DEFAULT.requirements))
278+
requirements = list(
279+
map(str, PipVersion.DEFAULT.requirements + PipVersion.DEFAULT.build_system_requires)
280+
)
279281
downloaded = resolver.download(requirements=requirements)
280282
for dist in downloaded.local_distributions:
281283
shutil.copy(dist.path, find_links)

tests/integration/resolve/test_issue_1907.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,12 @@ def test_pre_resolved_dists_offline(
173173
if PipVersion.DEFAULT is not PipVersion.VENDORED:
174174
# In order to go offline and still be able to build sdists, we need both the un-vendored Pip and
175175
# its basic build requirements.
176-
args.extend(str(req) for req in PipVersion.DEFAULT.requirements)
176+
args.extend(
177+
str(req)
178+
for req in (
179+
PipVersion.DEFAULT.requirements + PipVersion.DEFAULT.build_system_requires
180+
)
181+
)
177182
if IS_PYPY:
178183
# For PyPy, we need extra build dependencies for argon2-cffi-bindings.
179184
args.append("setuptools_scm")

tests/integration/resolve/test_issue_3040.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
import subprocess
88
import sys
99

10+
import pytest
11+
1012
from pex.common import safe_mkdir
1113
from pex.interpreter import PythonInterpreter
1214
from pex.pep_440 import Version
@@ -18,6 +20,10 @@
1820
from testing.pytest_utils.tmp import Tempdir
1921

2022

23+
@pytest.mark.skipif(
24+
PipVersion.DEFAULT is PipVersion.ADHOC,
25+
reason="Adhoc pip requires a git clone and we run the container under test with no network.",
26+
)
2127
@skip_unless_docker
2228
def test_pip_bootstrap_respects_pip_configuration(
2329
tmpdir, # type: Tempdir

tests/integration/test_excludes.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,16 @@ def test_exclude_deep(
328328
# Bootstrap the Pip version being used if needed before we turn off PyPI.
329329
if pip_options.pip_version is not PipVersion.VENDORED:
330330
subprocess.check_call(
331-
[pip, "wheel", "-w", find_links] + list(map(str, pip_options.pip_version.requirements))
331+
[pip, "wheel", "-w", find_links]
332+
+ list(
333+
map(
334+
str,
335+
(
336+
pip_options.pip_version.requirements
337+
+ pip_options.pip_version.build_system_requires
338+
),
339+
)
340+
)
332341
)
333342

334343
project_dir = tmpdir.join("projects")

tests/integration/test_issue_2706.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ def test_extras_from_dup_root_reqs(tmpdir):
2626
tmpdir.join("pip-resolver-venv"), install_pip=InstallationChoice.YES
2727
).interpreter.execute(
2828
args=["-m", "pip", "wheel", "--wheel-dir", find_links]
29-
+ list(map(str, PipVersion.DEFAULT.requirements))
29+
+ list(
30+
map(str, PipVersion.DEFAULT.requirements + PipVersion.DEFAULT.build_system_requires)
31+
)
3032
)
3133

3234
with built_wheel(

tests/integration/test_scoped_repos.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,9 @@ def test_scoped_marker(
550550
str(PipVersion.VENDORED.wheel_requirement),
551551
]
552552
else:
553-
requirements = list(map(str, PipVersion.DEFAULT.requirements))
553+
requirements = list(
554+
map(str, PipVersion.DEFAULT.requirements + PipVersion.DEFAULT.build_system_requires)
555+
)
554556
downloaded = resolver.download(requirements=requirements)
555557
for dist in downloaded.local_distributions:
556558
shutil.copy(dist.path, find_links)

0 commit comments

Comments
 (0)