Skip to content

Commit

Permalink
details about module search path on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
christianrauch committed Oct 19, 2024
1 parent ad91b33 commit dcad06c
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion cmake/MakePythonWheel.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,19 @@ function( MakeWheel python_module)
cmake_parse_arguments(MAKEWHEEL "PRINT_HELP" "MODULE;VERSION;SUMMARY;DESCRIPTION;HOMEPAGE;AUTHOR;EMAIL;LICENCE" "REQUIRES" ${ARGN} )
set(version ${MAKEWHEEL_VERSION})

execute_process(COMMAND ${Python3_EXECUTABLE} -c "import setuptools" ERROR_QUIET RESULT_VARIABLE has_setuptools)
execute_process(
COMMAND ${Python3_EXECUTABLE} -c "
import sys
try:
import setuptools
sys.exit(0)
except ImportError as e:
print(f'{e}. Search paths:', file=sys.stderr)
for p in sys.path: print(f' {p}', file=sys.stderr)
sys.exit(1)
"
ERROR_QUIET RESULT_VARIABLE has_setuptools)

if(has_setuptools EQUAL "1")
message(FATAL_ERROR "Python module `setuptools` required for correct wheel filename generation.")

Check failure on line 26 in cmake/MakePythonWheel.cmake

View workflow job for this annotation

GitHub Actions / build (windows-2022, ON)

Python module `setuptools` required for correct wheel filename generation.

Check failure on line 26 in cmake/MakePythonWheel.cmake

View workflow job for this annotation

GitHub Actions / build (windows-2022, OFF)

Python module `setuptools` required for correct wheel filename generation.
endif()
Expand Down

0 comments on commit dcad06c

Please sign in to comment.