|
21 | 21 | prepare_command, |
22 | 22 | read_python_configs, |
23 | 23 | split_config_settings, |
| 24 | + test_fail_cwd_file, |
24 | 25 | unwrap, |
25 | 26 | ) |
26 | 27 |
|
@@ -306,9 +307,11 @@ def build_in_container( |
306 | 307 | # set up a virtual environment to install and test from, to make sure |
307 | 308 | # there are no dependencies that were pulled in at build time. |
308 | 309 | container.call(["pip", "install", "virtualenv", *dependency_constraint_flags], env=env) |
309 | | - venv_dir = ( |
310 | | - PurePath(container.call(["mktemp", "-d"], capture_output=True).strip()) / "venv" |
| 310 | + |
| 311 | + testing_temp_dir = PurePosixPath( |
| 312 | + container.call(["mktemp", "-d"], capture_output=True).strip() |
311 | 313 | ) |
| 314 | + venv_dir = testing_temp_dir / "venv" |
312 | 315 |
|
313 | 316 | container.call(["python", "-m", "virtualenv", "--no-download", venv_dir], env=env) |
314 | 317 |
|
@@ -345,10 +348,14 @@ def build_in_container( |
345 | 348 | project=container_project_path, |
346 | 349 | package=container_package_dir, |
347 | 350 | ) |
348 | | - container.call(["sh", "-c", test_command_prepared], cwd="/root", env=virtualenv_env) |
| 351 | + test_cwd = testing_temp_dir / "test_cwd" |
| 352 | + container.call(["mkdir", "-p", test_cwd]) |
| 353 | + container.copy_into(test_fail_cwd_file, test_cwd / "test_fail.py") |
| 354 | + |
| 355 | + container.call(["sh", "-c", test_command_prepared], cwd=test_cwd, env=virtualenv_env) |
349 | 356 |
|
350 | 357 | # clean up test environment |
351 | | - container.call(["rm", "-rf", venv_dir]) |
| 358 | + container.call(["rm", "-rf", testing_temp_dir]) |
352 | 359 |
|
353 | 360 | # move repaired wheels to output |
354 | 361 | if compatible_wheel is None: |
|
0 commit comments