From b7f8098c3442e13b28b021c1229efe7b75d9ca0f Mon Sep 17 00:00:00 2001 From: carsten-forty2 Date: Mon, 11 Nov 2024 14:17:26 +0100 Subject: [PATCH] BLD: improve pip build testing --- core/pgcore/CMakeLists.txt | 20 ++++++++++---------- pygimli/CMakeLists.txt | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/core/pgcore/CMakeLists.txt b/core/pgcore/CMakeLists.txt index 9b92865ab..e0ff4db55 100644 --- a/core/pgcore/CMakeLists.txt +++ b/core/pgcore/CMakeLists.txt @@ -1,10 +1,10 @@ ## PRE Build set(TARGET_NAME pgcore) -CONFIGURE_FILE(getwheelname.py.in +CONFIGURE_FILE(getwheelname.py.in ${CMAKE_CURRENT_BINARY_DIR}/getwheelname.py @ONLY ) -execute_process(COMMAND "${Python_EXECUTABLE}" getwheelname.py +execute_process(COMMAND "${Python_EXECUTABLE}" getwheelname.py RESULT_VARIABLE STATUS OUTPUT_VARIABLE PY_WHEELFILE WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" @@ -19,19 +19,19 @@ else() cprint(green "********** Prepare wheel build for: ${TARGET_NAME} ***********") message(STATUS "Detected Python wheel filename: ${PY_WHEELFILE}") - CONFIGURE_FILE(setup.py.in + CONFIGURE_FILE(setup.py.in ${CMAKE_CURRENT_BINARY_DIR}/setup.py @ONLY ) - + message(STATUS "Copying python files to ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}/${TARGET_NAME}") - file(GLOB_RECURSE PYGIMLI_FILES RELATIVE - ${CMAKE_CURRENT_SOURCE_DIR} + file(GLOB_RECURSE PYGIMLI_FILES RELATIVE + ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/*.py) foreach (filename ${PYGIMLI_FILES}) #message(STATUS "Copying ${filename} to ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}/${TARGET_NAME}/${target}") configure_file("${filename}" "${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}/${filename}" COPYONLY) endforeach (filename) - + string(REPLACE "linux" "manylinux_2_28" PY_WHEELFILE_OUTPLATFORM ${PY_WHEELFILE}) message(STATUS "Desired Python wheel filename after audtitwheel repair: ${PY_WHEELFILE_OUTPLATFORM}") @@ -50,7 +50,7 @@ else() set(BINDEPS_LIBS $) else() ## copy important libs only for in source dev - set(BINDEPS_LIBS + set(BINDEPS_LIBS #$ $ $) @@ -84,7 +84,7 @@ else() add_custom_target(whl${TARGET_NAME} DEPENDS whl${TARGET_NAME}PackageRepair) elseif (OS_VAR STREQUAL "MAC") add_custom_target(whl${TARGET_NAME}PackageRepair DEPENDS whl${TARGET_NAME}PackageBuild - COMMAND "delocate" repair ${WHEELHOUSE}/${PY_WHEELFILE} + COMMAND "delocate" repair ${WHEELHOUSE}/${PY_WHEELFILE} WORKING_DIRECTORY "${CMAKE_BINARY_DIR}" COMMENT "Building python wheel package at: ${CMAKE_BINARY_DIR}" ) @@ -98,7 +98,7 @@ else() ## test the wheel: make whlTest add_custom_target(whl${TARGET_NAME}TestInstall DEPENDS whl${TARGET_NAME} COMMAND "${Python3_EXECUTABLE}" -m pip uninstall -y ${TARGET_NAME} - COMMAND "${Python3_EXECUTABLE}" -m pip install ${TARGET_NAME} --find-links=${WHEELHOUSE} + COMMAND "${Python3_EXECUTABLE}" -m pip install ${TARGET_NAME} --find-links ${WHEELHOUSE} --no-index WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMENT "Installing ${TARGET_NAME} in virtual test environment" ) diff --git a/pygimli/CMakeLists.txt b/pygimli/CMakeLists.txt index de1e1dd60..b19fd04f2 100644 --- a/pygimli/CMakeLists.txt +++ b/pygimli/CMakeLists.txt @@ -58,7 +58,7 @@ else() # update the environment with VIRTUAL_ENV variable (mimic the activate script) and search again add_custom_target(whl${TARGET_NAME}TestInstall DEPENDS whl${TARGET_NAME} DEPENDS whlpgcoreTestRun COMMAND "${Python3_EXECUTABLE}" -m pip uninstall -y ${TARGET_NAME} - COMMAND "${Python3_EXECUTABLE}" -m pip install ${TARGET_NAME} --quiet --find-links=${WHEELHOUSE} + COMMAND "${Python3_EXECUTABLE}" -m pip install ${TARGET_NAME} --quiet --find-links ${WHEELHOUSE} --no-index COMMENT "Installing ${TARGET_NAME} in virtual test environment" ) add_custom_target(whl${TARGET_NAME}TestRun DEPENDS whl${TARGET_NAME}TestInstall