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
6 changes: 3 additions & 3 deletions src/scikit_build_core/program_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def _get_cmake_path(*, module: bool = True) -> Generator[Path, None, None]:
for candidate in candidates:
cmake_path = shutil.which(candidate)
if cmake_path is not None:
yield Path(cmake_path).resolve()
yield Path(cmake_path)


def _get_ninja_path(*, module: bool = True) -> Generator[Path, None, None]:
Expand All @@ -58,7 +58,7 @@ def _get_ninja_path(*, module: bool = True) -> Generator[Path, None, None]:
for candidate in candidates:
ninja_path = shutil.which(candidate)
if ninja_path is not None:
yield Path(ninja_path).resolve()
yield Path(ninja_path)


def get_cmake_programs(*, module: bool = True) -> Generator[Program, None, None]:
Expand Down Expand Up @@ -116,7 +116,7 @@ def get_make_programs() -> Generator[Path, None, None]:
for candidate in candidates:
make_path = shutil.which(candidate)
if make_path is not None:
yield Path(make_path).resolve()
yield Path(make_path)


def best_program(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cmake_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def cmake_path() -> str:
print(cmake_str)
if cmake_str is None:
pytest.skip("cmake must be installed for this test")
return os.fspath(Path(cmake_str).resolve())
return os.fspath(Path(cmake_str))

return os.fspath(Path(cmake.CMAKE_BIN_DIR) / "cmake")

Expand Down
8 changes: 4 additions & 4 deletions tests/test_get_requires.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def which_mock(name: str) -> str | None:
def test_get_requires_for_build_wheel(fp, monkeypatch):
# This needs to be passed due to packaging.tags 22 extra checks if macos 10.16 is reported
fp.pass_command([sys.executable, fp.any()])
cmake = Path("cmake/path").resolve()
cmake = Path("cmake/path")
monkeypatch.setattr(shutil, "which", which_mock)
monkeypatch.delenv("CMAKE_GENERATOR", raising=False)
fp.register([os.fspath(cmake), "--version"], stdout="3.14.0")
Expand All @@ -30,7 +30,7 @@ def test_get_requires_for_build_wheel(fp, monkeypatch):

def test_get_requires_for_build_wheel_uneeded(fp, monkeypatch):
fp.pass_command([sys.executable, fp.any()])
cmake = Path("cmake/path").resolve()
cmake = Path("cmake/path")
monkeypatch.setattr(shutil, "which", which_mock)
monkeypatch.delenv("CMAKE_GENERATOR", raising=False)
fp.register([os.fspath(cmake), "--version"], stdout="3.18.0")
Expand All @@ -39,7 +39,7 @@ def test_get_requires_for_build_wheel_uneeded(fp, monkeypatch):

def test_get_requires_for_build_wheel_settings(fp, monkeypatch):
fp.pass_command([sys.executable, fp.any()])
cmake = Path("cmake/path").resolve()
cmake = Path("cmake/path")
monkeypatch.setattr(shutil, "which", which_mock)
monkeypatch.delenv("CMAKE_GENERATOR", raising=False)
fp.register([os.fspath(cmake), "--version"], stdout="3.18.0")
Expand All @@ -59,7 +59,7 @@ def test_get_requires_for_build_wheel_pyproject(fp, monkeypatch, tmp_path):
minimum-version = "3.21"
"""
)
cmake = Path("cmake/path").resolve()
cmake = Path("cmake/path")
monkeypatch.setattr(shutil, "which", which_mock)
monkeypatch.delenv("CMAKE_GENERATOR", raising=False)
fp.register([os.fspath(cmake), "--version"], stdout="3.18.0")
Expand Down
12 changes: 6 additions & 6 deletions tests/test_program_search.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def test_get_ninja_programs_cmake_module(monkeypatch):

def test_get_cmake_programs_all(monkeypatch, fp):
monkeypatch.setattr("shutil.which", lambda x: x)
cmake_path = Path("cmake").resolve()
cmake3_path = Path("cmake3").resolve()
cmake_path = Path("cmake")
cmake3_path = Path("cmake3")
fp.register(
[os.fspath(cmake_path), "--version"],
stdout="cmake version 3.20.0\n\nCMake suite maintained and supported by Kitware (kitware.com/cmake).",
Expand All @@ -67,8 +67,8 @@ def test_get_cmake_programs_all(monkeypatch, fp):

def test_get_ninja_programs_all(monkeypatch, fp):
monkeypatch.setattr("shutil.which", lambda x: x if "ninja" in x else None)
ninja_path = Path("ninja").resolve()
ninja_build_path = Path("ninja-build").resolve()
ninja_path = Path("ninja")
ninja_build_path = Path("ninja-build")
fp.register(
[os.fspath(ninja_path), "--version"], stdout="1.10.1.git.kitware.jobserver-1"
)
Expand All @@ -92,8 +92,8 @@ def test_get_ninja_programs_all(monkeypatch, fp):
def test_get_cmake_programs_malformed(monkeypatch, fp, caplog):
caplog.set_level(logging.WARNING)
monkeypatch.setattr("shutil.which", lambda x: x)
cmake_path = Path("cmake").resolve()
cmake3_path = Path("cmake3").resolve()
cmake_path = Path("cmake")
cmake3_path = Path("cmake3")
fp.register([os.fspath(cmake_path), "--version"], stdout="scrambled output\n")
fp.register([os.fspath(cmake3_path), "--version"], stdout="cmake version 3.17.3\n")
programs = list(get_cmake_programs(module=False))
Expand Down