diff --git a/src/scikit_build_core/program_search.py b/src/scikit_build_core/program_search.py index 4a2844d17..77bcc9117 100644 --- a/src/scikit_build_core/program_search.py +++ b/src/scikit_build_core/program_search.py @@ -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]: @@ -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]: @@ -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( diff --git a/tests/test_cmake_config.py b/tests/test_cmake_config.py index 1901ec952..762bf0295 100644 --- a/tests/test_cmake_config.py +++ b/tests/test_cmake_config.py @@ -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") diff --git a/tests/test_get_requires.py b/tests/test_get_requires.py index 42dabe936..647625c4b 100644 --- a/tests/test_get_requires.py +++ b/tests/test_get_requires.py @@ -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") @@ -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") @@ -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") @@ -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") diff --git a/tests/test_program_search.py b/tests/test_program_search.py index d3e52add9..a47757113 100644 --- a/tests/test_program_search.py +++ b/tests/test_program_search.py @@ -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).", @@ -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" ) @@ -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))