Skip to content

Commit 62d986e

Browse files
committed
fix: install the wheel out-of-dir
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 39397f5 commit 62d986e

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

cibuildwheel/linux.py

+8-3
Original file line numberDiff line numberDiff line change
@@ -313,11 +313,15 @@ def build_in_container(
313313
)
314314

315315
testing_temp_dir = PurePosixPath(
316-
container.call(["mktemp", "-d"], capture_output=True).strip()
316+
container.call(["mktemp", "-d"], capture_output=True, cwd="/").strip()
317317
)
318318
venv_dir = testing_temp_dir / "venv"
319319

320-
container.call(["python", "-m", "virtualenv", "--no-download", venv_dir], env=env)
320+
container.call(
321+
["python", "-m", "virtualenv", "--no-download", venv_dir],
322+
env=env,
323+
cwd="/",
324+
)
321325

322326
virtualenv_env = env.copy()
323327
virtualenv_env["PATH"] = f"{venv_dir / 'bin'}:{virtualenv_env['PATH']}"
@@ -338,8 +342,9 @@ def build_in_container(
338342
# Let's just pick the first one.
339343
wheel_to_test = repaired_wheels[0]
340344
container.call(
341-
["pip", "install", str(wheel_to_test) + build_options.test_extras],
345+
["pip", "install", f"{wheel_to_test}{build_options.test_extras}"],
342346
env=virtualenv_env,
347+
cwd="/",
343348
)
344349

345350
# Install any requirements to run the tests

cibuildwheel/macos.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -591,8 +591,9 @@ def build(options: Options, tmp_path: Path) -> None:
591591
call_with_arch(
592592
"pip",
593593
"install",
594-
f"{repaired_wheel}{build_options.test_extras}",
594+
f"{repaired_wheel.resolve()}{build_options.test_extras}",
595595
env=virtualenv_env,
596+
cwd="/",
596597
)
597598

598599
# test the wheel

cibuildwheel/oci_container.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def glob(self, path: PurePosixPath, pattern: str) -> list[PurePosixPath]:
230230
[
231231
self.UTILITY_PYTHON,
232232
"-c",
233-
f"import sys, json, glob; json.dump(glob.glob({str(glob_pattern)!r}), sys.stdout)",
233+
f"import os, sys, json, glob; json.dump([os.abspath(x) for x in glob.glob({str(glob_pattern)!r})], sys.stdout)",
234234
],
235235
capture_output=True,
236236
)

cibuildwheel/windows.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -539,8 +539,9 @@ def build(options: Options, tmp_path: Path) -> None:
539539
call(
540540
"pip",
541541
"install",
542-
str(repaired_wheel) + build_options.test_extras,
542+
f"{repaired_wheel.resolve()}{build_options.test_extras}",
543543
env=virtualenv_env,
544+
cwd="/",
544545
)
545546

546547
# test the wheel

0 commit comments

Comments
 (0)