Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cibuildwheel/platforms/ios.py
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def build(options: Options, tmp_path: Path) -> None:
if build_options.test_sources:
copy_test_sources(
build_options.test_sources,
build_options.package_dir,
Path.cwd(),
testbed_app_path,
)
else:
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/platforms/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def build_in_container(
if build_options.test_sources:
copy_test_sources(
build_options.test_sources,
build_options.package_dir,
Path.cwd(),
test_cwd,
copy_into=container.copy_into,
)
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/platforms/macos.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ def build(options: Options, tmp_path: Path) -> None:
test_cwd.mkdir()
copy_test_sources(
build_options.test_sources,
build_options.package_dir,
Path.cwd(),
test_cwd,
)
else:
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/platforms/pyodide.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def build(options: Options, tmp_path: Path) -> None:
if build_options.test_sources:
copy_test_sources(
build_options.test_sources,
build_options.package_dir,
Path.cwd(),
test_cwd,
)
else:
Expand Down
2 changes: 1 addition & 1 deletion cibuildwheel/platforms/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ def build(options: Options, tmp_path: Path) -> None:
if build_options.test_sources:
copy_test_sources(
build_options.test_sources,
build_options.package_dir,
Path.cwd(),
test_cwd,
)
else:
Expand Down
10 changes: 5 additions & 5 deletions cibuildwheel/util/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,21 +111,21 @@ def copy_into_local(src: Path, dst: PurePath) -> None:

def copy_test_sources(
test_sources: list[str],
package_dir: Path,
project_dir: Path,
test_dir: PurePath,
copy_into: Callable[[Path, PurePath], None] = copy_into_local,
) -> None:
"""Copy the list of test sources from the package to the test directory.

:param test_sources: A list of test paths, relative to the package_dir.
:param package_dir: The root of the package directory.
:param test_sources: A list of test paths, relative to the project_dir.
:param project_dir: The root of the project.
:param test_dir: The folder where test sources should be placed.
:param copy_info: The copy function to use. By default, does a local
:param copy_into: The copy function to use. By default, does a local
filesystem copy; but an OCIContainer.copy_info method (or equivalent)
can be provided.
"""
for test_path in test_sources:
source = package_dir.resolve() / test_path
source = project_dir.resolve() / test_path

if not source.exists():
msg = f"Test source {test_path} does not exist."
Expand Down