Skip to content

Commit

Permalink
SETUPTOOLS_USE_DISTUTILS=stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsavulescu committed Jul 18, 2022
1 parent f505247 commit d6c92b7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nrn_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
wheel
setuptools<59.7.0
setuptools
scikit-build
matplotlib
bokeh
Expand Down
1 change: 1 addition & 0 deletions share/lib/python/neuron/rxd/geometry3d/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ mingw=${MINGW}\n\
shift\n\
export LDCSHARED=\"${CMAKE_C_COMPILER} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}\"\n\
export LDCXXSHARED=\"${CMAKE_CXX_COMPILER} ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}\"\n\
export SETUPTOOLS_USE_DISTUTILS=stdlib
if test x$mingw = x1 ; then\n\
pyver=`$pyexe -c 'import sys; print (sys.version_info[0]); quit()'`\n\
echo pyver=$pyver\n\
Expand Down
10 changes: 9 additions & 1 deletion src/nrnpython/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,13 @@ if(NRN_ENABLE_MODULE_INSTALL)
"LDCSHARED=${CMAKE_C_COMPILER} ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}"
"LDCXXSHARED=${CMAKE_CXX_COMPILER} ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
endif()
# Workaround for: https://github.com/neuronsimulator/nrn/issues/1605 See:
# https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html
# https://setuptools.pypa.io/en/latest/history.html#id228
set(extra_env_distutils
${CMAKE_COMMAND} -E env
"SETUPTOOLS_USE_DISTUTILS=stdlib")

foreach(pyexe ${NRN_PYTHON_EXE_LIST})
add_custom_command(
TARGET hoc_module
Expand All @@ -238,7 +245,7 @@ if(NRN_ENABLE_MODULE_INSTALL)
${CMAKE_COMMAND} -E copy_if_different
${PROJECT_SOURCE_DIR}/share/lib/python/neuron/help_data.dat
${CMAKE_CURRENT_BINARY_DIR}/lib/python/neuron/help_data.dat
COMMAND ${extra_env} ${pyexe} setup.py --quiet build --build-lib=${NRN_PYTHON_BUILD_LIB}
COMMAND ${extra_env} ${extra_env_distutils} ${pyexe} setup.py --quiet build --build-lib=${NRN_PYTHON_BUILD_LIB}
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Building python module with: ${pyexe}")
endforeach(pyexe)
Expand All @@ -261,6 +268,7 @@ if(NRN_ENABLE_MODULE_INSTALL)
echo 'Installing python module using:'\n\
set -ex\n\
cd ${CMAKE_CURRENT_BINARY_DIR}\n\
export SETUPTOOLS_USE_DISTUTILS=stdlib
$1 setup.py --quiet build --build-lib=${NRN_PYTHON_BUILD_LIB} install ${NRN_MODULE_INSTALL_OPTIONS}\n\
")
foreach(pyexe ${NRN_PYTHON_EXE_LIST})
Expand Down

0 comments on commit d6c92b7

Please sign in to comment.