Skip to content

Commit

Permalink
BLD: improve pip build testing
Browse files Browse the repository at this point in the history
  • Loading branch information
carsten-forty2 committed Nov 11, 2024
1 parent 6e20f08 commit b7f8098
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions core/pgcore/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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}"
Expand All @@ -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}")

Expand All @@ -50,7 +50,7 @@ else()
set(BINDEPS_LIBS $<TARGET_FILE:_pygimli_>)
else()
## copy important libs only for in source dev
set(BINDEPS_LIBS
set(BINDEPS_LIBS
#$<TARGET_FILE:${Boost_PYTHON_LIBRARY}>
$<TARGET_FILE:gimli>
$<TARGET_FILE:_pygimli_>)
Expand Down Expand Up @@ -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}"
)
Expand All @@ -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"
)
Expand Down
2 changes: 1 addition & 1 deletion pygimli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b7f8098

Please sign in to comment.