From 5c87a797ff4469e4d4f3f2e3c1d01f0f68e9056d Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Tue, 29 Aug 2023 11:24:01 +0200 Subject: [PATCH] some more missing PYTHON -> Python3 renamings --- CMakeLists.txt | 2 +- cmake/NetgenConfig.cmake.in | 2 +- cmake/external_projects/tcltk.cmake | 4 ++-- python/CMakeLists.txt | 4 ++-- python/config_template.py | 6 +++--- tests/pytest/CMakeLists.txt | 6 +++--- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80f47e1f..cc6d4f9c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -341,7 +341,7 @@ if (USE_MPI) target_compile_definitions(netgen_metis INTERFACE METIS ) if(USE_MPI4PY AND USE_PYTHON) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import mpi4py;print(mpi4py.get_include())" OUTPUT_VARIABLE mpi4py_path OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${Python3_EXECUTABLE} -c "import mpi4py;print(mpi4py.get_include())" OUTPUT_VARIABLE mpi4py_path OUTPUT_STRIP_TRAILING_WHITESPACE) find_path(MPI4PY_INCLUDE_DIR mpi4py.h HINTS ${mpi4py_path}/mpi4py NO_DEFAULT_PATH REQUIRED) target_include_directories(netgen_metis INTERFACE ${MPI4PY_INCLUDE_DIR}) target_compile_definitions(netgen_metis INTERFACE NG_MPI4PY ) diff --git a/cmake/NetgenConfig.cmake.in b/cmake/NetgenConfig.cmake.in index f58d8778..477ed214 100644 --- a/cmake/NetgenConfig.cmake.in +++ b/cmake/NetgenConfig.cmake.in @@ -38,7 +38,7 @@ set(NETGEN_OCC_LIBRARIES_BIN "@OpenCASCADE_BINARY_DIR@") set(NETGEN_OCC_LIBRARIES "@OCC_LIBRARIES@") set(NETGEN_OCC_LIBRARY_DIR "@OpenCASCADE_LIBRARY_DIR@") set(NETGEN_OPENGL_LIBRARIES "@OPENGL_LIBRARIES@") -set(NETGEN_PYTHON_EXECUTABLE "@PYTHON_EXECUTABLE@") +set(NETGEN_PYTHON_EXECUTABLE "@Python3_EXECUTABLE@") set(NETGEN_PYTHON_INCLUDE_DIRS "@Python3_INCLUDE_DIRS@") set(NETGEN_PYTHON_LIBRARIES "@Python3_LIBRARIES@") set(NETGEN_TCL_INCLUDE_PATH "@TCL_INCLUDE_PATH@") diff --git a/cmake/external_projects/tcltk.cmake b/cmake/external_projects/tcltk.cmake index 8d1e1247..9542f3c0 100644 --- a/cmake/external_projects/tcltk.cmake +++ b/cmake/external_projects/tcltk.cmake @@ -7,7 +7,7 @@ else(LINUX) if(SKBUILD) # we are building a pip package - download the tcl/tk sources matching the tkinter version (for private headers not shipped with python) -execute_process(COMMAND ${PYTHON_EXECUTABLE} -c +execute_process(COMMAND ${Python3_EXECUTABLE} -c "import tkinter;print(tkinter.Tcl().eval('info patchlevel').replace('.','-'))" OUTPUT_VARIABLE PYTHON_TCL_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) @@ -39,7 +39,7 @@ set(TK_INCLUDE_PATH ${TK_DIR}/generic) list(APPEND NETGEN_DEPENDENCIES project_tcl project_tk) if(APPLE OR WIN32) - execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import sys; print(sys.prefix)" OUTPUT_VARIABLE PYTHON_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) + execute_process(COMMAND ${Python3_EXECUTABLE} -c "import sys; print(sys.prefix)" OUTPUT_VARIABLE PYTHON_PREFIX OUTPUT_STRIP_TRAILING_WHITESPACE) file(TO_CMAKE_PATH ${PYTHON_PREFIX} PYTHON_PREFIX) set(tcl_find_args diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index ccab5494..792b337c 100644 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -26,13 +26,13 @@ install(FILES # build stub files for pybind11 packages if(BUILD_STUB_FILES) -execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import pybind11_stubgen; print(pybind11_stubgen.__file__)" OUTPUT_VARIABLE stubgen_path RESULT_VARIABLE pybind11_stubgen) +execute_process(COMMAND ${Python3_EXECUTABLE} -c "import pybind11_stubgen; print(pybind11_stubgen.__file__)" OUTPUT_VARIABLE stubgen_path RESULT_VARIABLE pybind11_stubgen) if(pybind11_stubgen AND NOT ${pybind11_stubgen} EQUAL 0) message(WARNING "pybind11-stubgen not found, if you want to create stub files for better autocompletion support install it with pip.") else() message("-- Found pybind11-stubgen: ${stubgen_path}") - install(CODE "execute_process(COMMAND ${PYTHON_EXECUTABLE} -m pybind11_stubgen --no-setup-py --ignore-invalid=all netgen)") + install(CODE "execute_process(COMMAND ${Python3_EXECUTABLE} -m pybind11_stubgen --no-setup-py --ignore-invalid=all netgen)") install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/../stubs/netgen-stubs/ DESTINATION ${NG_INSTALL_DIR_PYTHON}/netgen/ COMPONENT netgen) endif() endif(BUILD_STUB_FILES) diff --git a/python/config_template.py b/python/config_template.py index 38991567..c4232dff 100644 --- a/python/config_template.py +++ b/python/config_template.py @@ -52,8 +52,8 @@ NETGEN_VERSION_TWEAK = "@NETGEN_VERSION_TWEAK@" NETGEN_VERSION_PATCH = "@NETGEN_VERSION_PATCH@" NETGEN_VERSION_HASH = "@NETGEN_VERSION_HASH@" -PYTHON_VERSION = "@PYTHON_VERSION@" -PYTHON_VERSION_MAJOR = "@PYTHON_VERSION_MAJOR@" -PYTHON_VERSION_MINOR = "@PYTHON_VERSION_MINOR@" +PYTHON_VERSION = "@Python3_VERSION@" +PYTHON_VERSION_MAJOR = "@Python3_VERSION_MAJOR@" +PYTHON_VERSION_MINOR = "@Python3_VERSION_MINOR@" version = NETGEN_VERSION_GIT diff --git a/tests/pytest/CMakeLists.txt b/tests/pytest/CMakeLists.txt index 26c7d22f..375bd420 100644 --- a/tests/pytest/CMakeLists.txt +++ b/tests/pytest/CMakeLists.txt @@ -1,8 +1,8 @@ if(USE_PYTHON) - add_test(NAME pytest COMMAND ${PYTHON_EXECUTABLE} -m pytest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) - add_custom_target(pytest ${PYTHON_EXECUTABLE} -m pytest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + add_test(NAME pytest COMMAND ${Python3_EXECUTABLE} -m pytest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + add_custom_target(pytest ${Python3_EXECUTABLE} -m pytest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) set_tests_properties ( pytest PROPERTIES TIMEOUT 1800 ) if(USE_MPI AND USE_MPI4PY) - add_test(NAME pytest-mpi COMMAND ${MPIEXEC_EXECUTABLE} --allow-run-as-root -np 4 ${PYTHON_EXECUTABLE} -m pytest --with-mpi test_mpi4py.py WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) + add_test(NAME pytest-mpi COMMAND ${MPIEXEC_EXECUTABLE} --allow-run-as-root -np 4 ${Python3_EXECUTABLE} -m pytest --with-mpi test_mpi4py.py WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) endif(USE_MPI AND USE_MPI4PY) endif(USE_PYTHON)