Skip to content

Commit 1266c83

Browse files
authored
fix: make sure all paths are CMake paths (#1063)
Fix #1061. All paths need to be of type Path so they are converted to CMake paths and the type is correct (PATH). --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent d52df05 commit 1266c83

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/scikit_build_core/builder/builder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,15 +232,15 @@ def configure(
232232
numpy_include_dir = get_numpy_include_dir()
233233

234234
# Classic Find Python
235-
cache_config["PYTHON_EXECUTABLE"] = sys.executable
235+
cache_config["PYTHON_EXECUTABLE"] = Path(sys.executable)
236236
cache_config["PYTHON_INCLUDE_DIR"] = python_include_dir
237237
if python_library:
238238
cache_config["PYTHON_LIBRARY"] = python_library
239239

240240
# Modern Find Python
241241
for prefix in ("Python", "Python3"):
242-
cache_config[f"{prefix}_EXECUTABLE"] = sys.executable
243-
cache_config[f"{prefix}_ROOT_DIR"] = sys.prefix
242+
cache_config[f"{prefix}_EXECUTABLE"] = Path(sys.executable)
243+
cache_config[f"{prefix}_ROOT_DIR"] = Path(sys.prefix)
244244
cache_config[f"{prefix}_INCLUDE_DIR"] = python_include_dir
245245
cache_config[f"{prefix}_FIND_REGISTRY"] = "NEVER"
246246
# FindPython may break if this is set - only useful on Windows

tests/packages/dynamic_metadata/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ set(Python_SOABI ${SKBUILD_SOABI})
1111
python_add_library(_module MODULE src/module.c WITH_SOABI)
1212

1313
install(TARGETS _module DESTINATION ${SKBUILD_PROJECT_NAME})
14+
install(
15+
CODE "execute_process(COMMAND ${Python_EXECUTABLE} -V COMMAND_ECHO STDOUT)")

0 commit comments

Comments
 (0)