Skip to content

Commit

Permalink
Merge pull request #478 from Moraxyc/master
Browse files Browse the repository at this point in the history
build(cmake): avoid the usage of distutils
  • Loading branch information
bjodah authored May 28, 2024
2 parents 2223b99 + e72006d commit b87a4a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions cmake/FindPython.cmake
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set(PYTHON_BIN python CACHE STRING "Python executable name")

execute_process(
COMMAND ${PYTHON_BIN} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc())"
COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['include'])"
OUTPUT_VARIABLE PYTHON_SYS_PATH
)
string(STRIP ${PYTHON_SYS_PATH} PYTHON_SYS_PATH)
Expand All @@ -16,7 +16,7 @@ set(PYTHON_INSTALL_HEADER_PATH ${PYTHON_INCLUDE_PATH}/symengine
CACHE BOOL "Python install headers path")

execute_process(
COMMAND ${PYTHON_BIN} -c "from distutils.sysconfig import get_config_var; print(get_config_var('LIBDIR'))"
COMMAND ${PYTHON_BIN} -c "from sysconfig import get_config_var; print(get_config_var('LIBDIR'))"
OUTPUT_VARIABLE PYTHON_LIB_PATH
)
string(STRIP ${PYTHON_LIB_PATH} PYTHON_LIB_PATH)
Expand Down Expand Up @@ -50,7 +50,7 @@ if (${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
endif()

execute_process(
COMMAND ${PYTHON_BIN} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
COMMAND ${PYTHON_BIN} -c "from sysconfig import get_paths; print(get_paths()['purelib'])"
OUTPUT_VARIABLE PYTHON_INSTALL_PATH_tmp
)
string(STRIP ${PYTHON_INSTALL_PATH_tmp} PYTHON_INSTALL_PATH_tmp)
Expand Down
2 changes: 1 addition & 1 deletion cmake/get_suffix.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from distutils.sysconfig import get_config_var
from sysconfig import get_config_var
extsuffix = get_config_var('EXT_SUFFIX')
if extsuffix is None:
print("")
Expand Down

0 comments on commit b87a4a2

Please sign in to comment.