|
25 | 25 | from testing import IS_PYPY, PY_VER, built_wheel, make_env, run_pex_command
|
26 | 26 | from testing.cli import run_pex3
|
27 | 27 | from testing.lock import index_lock_artifacts
|
28 |
| -from testing.pytest.tmp import TempdirFactory |
| 28 | +from testing.pytest.tmp import Tempdir, TempdirFactory |
29 | 29 |
|
30 | 30 | if TYPE_CHECKING:
|
31 | 31 | from typing import Any, Mapping, Tuple
|
@@ -280,29 +280,31 @@ def test_unavailable_artifacts(
|
280 | 280 | )
|
281 | 281 |
|
282 | 282 |
|
283 |
| -@pytest.fixture(scope="module") |
284 |
| -def requests_lock_universal( |
285 |
| - tmpdir_factory, # type: TempdirFactory |
286 |
| - request, # type: Any |
287 |
| -): |
288 |
| - # type: (...) -> str |
289 |
| - |
290 |
| - lock = tmpdir_factory.mktemp("locks", request=request).join("requests-universal.lock") |
291 |
| - run_pex3( |
292 |
| - "lock", "create", "--style", "universal", "requests[security]==2.25.1", "-o", lock |
293 |
| - ).assert_success() |
294 |
| - return lock |
295 |
| - |
296 |
| - |
297 | 283 | def test_multiplatform(
|
298 |
| - tmpdir, # type: Any |
299 |
| - requests_lock_universal, # type: str |
| 284 | + tmpdir, # type: Tempdir |
300 | 285 | py38, # type: PythonInterpreter
|
301 | 286 | py310, # type: PythonInterpreter
|
302 | 287 | ):
|
303 | 288 | # type: (...) -> None
|
304 | 289 |
|
305 |
| - pex_file = os.path.join(str(tmpdir), "pex.file") |
| 290 | + requests_lock_universal = tmpdir.join("requests-universal.lock") |
| 291 | + run_pex3( |
| 292 | + "lock", |
| 293 | + "create", |
| 294 | + "--resolver-version", |
| 295 | + "pip-2020-resolver", |
| 296 | + "--style", |
| 297 | + "universal", |
| 298 | + "--interpreter-constraint", |
| 299 | + # N.B.: Ensure the lock covers 3.8 and 3.10, which we use below to build a multiplatform |
| 300 | + # PEX. |
| 301 | + ">=3.8,!=3.9.*,<3.11", |
| 302 | + "requests[security]==2.25.1", |
| 303 | + "-o", |
| 304 | + requests_lock_universal, |
| 305 | + ).assert_success() |
| 306 | + |
| 307 | + pex_file = tmpdir.join("pex.file") |
306 | 308 | run_pex_command(
|
307 | 309 | args=[
|
308 | 310 | "--python",
|
|
0 commit comments