Skip to content

Commit d1867dd

Browse files
hjmjohnsonthewtex
authored andcommitted
BUG: Python version mis-match during build and test
```txt grep "Found Python" ITK.macOS.Python.logs -- Found Python3: /Users/runner/hostedtoolcache/Python/3.9.22/x64/bin/python3 (found suitable version "3.9.22", required range is "3.9...3.999") found components: Interpreter Development.Module -- Found Python: /usr/local/Frameworks/Python.framework/Versions/3.13/bin/python3.13 (found version "3.13.3") found components: Interpreter Linking CXX shared module Wrapping/Generators/Python/itk/_ITKPyBasePython.cpython-313-darwin.so ``` NOTE: Python3.13 is found after Python 3.9 is set. The issue is that python3.9 is used to run the tests, but the shared libraries are built with 3.13
1 parent 075533d commit d1867dd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Wrapping/macro_files/itk_end_wrap_module.cmake

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,10 +421,12 @@ ${DO_NOT_WAIT_FOR_THREADS_CALLS}
421421
if (ITK_USE_PYTHON_LIMITED_API)
422422
set_target_properties(${lib} PROPERTIES SUFFIX .abi3.so)
423423
else()
424-
find_package(Python)
425-
if(PYTHON_FOUND)
424+
if(NOT PYTHON3_FOUND)
425+
find_package(Python3 ${PYTHON_VERSION_MIN}...${PYTHON_VERSION_MAX} COMPONENTS Interpreter Development.Module ${SKBUILD_SABI_COMPONENT})
426+
endif()
427+
if(PYTHON3_FOUND)
426428
# Graalpy Patch
427-
set_target_properties(${lib} PROPERTIES SUFFIX .${Python_SOABI}.so)
429+
set_target_properties(${lib} PROPERTIES SUFFIX .${Python3_SOABI}.so)
428430
else()
429431
set_target_properties(${lib} PROPERTIES SUFFIX .so)
430432
endif()

0 commit comments

Comments
 (0)