Skip to content

Commit 2125d71

Browse files
authored
fix: test-sources should use project dir (#2437)
* fix: test-sources should use project dir Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * docs: fix docstring Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent ea08120 commit 2125d71

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

cibuildwheel/platforms/ios.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,7 @@ def build(options: Options, tmp_path: Path) -> None:
565565
if build_options.test_sources:
566566
copy_test_sources(
567567
build_options.test_sources,
568-
build_options.package_dir,
568+
Path.cwd(),
569569
testbed_app_path,
570570
)
571571
else:

cibuildwheel/platforms/linux.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ def build_in_container(
403403
if build_options.test_sources:
404404
copy_test_sources(
405405
build_options.test_sources,
406-
build_options.package_dir,
406+
Path.cwd(),
407407
test_cwd,
408408
copy_into=container.copy_into,
409409
)

cibuildwheel/platforms/macos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ def build(options: Options, tmp_path: Path) -> None:
712712
test_cwd.mkdir()
713713
copy_test_sources(
714714
build_options.test_sources,
715-
build_options.package_dir,
715+
Path.cwd(),
716716
test_cwd,
717717
)
718718
else:

cibuildwheel/platforms/pyodide.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def build(options: Options, tmp_path: Path) -> None:
527527
if build_options.test_sources:
528528
copy_test_sources(
529529
build_options.test_sources,
530-
build_options.package_dir,
530+
Path.cwd(),
531531
test_cwd,
532532
)
533533
else:

cibuildwheel/platforms/windows.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ def build(options: Options, tmp_path: Path) -> None:
590590
if build_options.test_sources:
591591
copy_test_sources(
592592
build_options.test_sources,
593-
build_options.package_dir,
593+
Path.cwd(),
594594
test_cwd,
595595
)
596596
else:

cibuildwheel/util/file.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,21 @@ def copy_into_local(src: Path, dst: PurePath) -> None:
111111

112112
def copy_test_sources(
113113
test_sources: list[str],
114-
package_dir: Path,
114+
project_dir: Path,
115115
test_dir: PurePath,
116116
copy_into: Callable[[Path, PurePath], None] = copy_into_local,
117117
) -> None:
118118
"""Copy the list of test sources from the package to the test directory.
119119
120-
:param test_sources: A list of test paths, relative to the package_dir.
121-
:param package_dir: The root of the package directory.
120+
:param test_sources: A list of test paths, relative to the project_dir.
121+
:param project_dir: The root of the project.
122122
:param test_dir: The folder where test sources should be placed.
123-
:param copy_info: The copy function to use. By default, does a local
123+
:param copy_into: The copy function to use. By default, does a local
124124
filesystem copy; but an OCIContainer.copy_info method (or equivalent)
125125
can be provided.
126126
"""
127127
for test_path in test_sources:
128-
source = package_dir.resolve() / test_path
128+
source = project_dir.resolve() / test_path
129129

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

0 commit comments

Comments
 (0)