Skip to content

Commit

Permalink
Bug fix and suppress pip/uv outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
gipert committed Dec 28, 2024
1 parent 9f39f02 commit da99d50
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,23 @@ configure_file("${PROJECT_SOURCE_DIR}/cmake/cpp_utils.py.in"
set(VENV_DIR "${CMAKE_BINARY_DIR}/python_venv")

add_custom_command(
OUTPUT "${VENV_DIR}/bin/activate"
COMMAND "${PYTHON_EXECUTABLE}" -m venv "${VENV_DIR}"
COMMAND "${VENV_DIR}/bin/python" -m pip install --upgrade pip
COMMAND "${VENV_DIR}/bin/python" -m pip install uv)
OUTPUT "${VENV_DIR}/bin/uv"
COMMAND "${Python3_EXECUTABLE}" -m venv "${VENV_DIR}"
COMMAND "${VENV_DIR}/bin/python" -m pip -q install --no-warn-script-location --upgrade pip
COMMAND "${VENV_DIR}/bin/python" -m pip -q install --no-warn-script-location uv
COMMENT "Configuring Python virtual environment")

add_custom_target(
python-virtualenv
DEPENDS "${VENV_DIR}/bin/activate"
COMMENT "Configuring Python virtual environment in ${VENV_DIR}")
add_custom_target(python-virtualenv DEPENDS "${VENV_DIR}/bin/uv")

# install the remage wrapper package into the virtual environment with uv
add_custom_command(
OUTPUT "${VENV_DIR}/bin/remage"
COMMAND "${VENV_DIR}/bin/python" -m uv pip install "${CMAKE_SOURCE_DIR}"
DEPENDS python-virtualenv)

add_custom_target(
remage-cli ALL
DEPENDS "${VENV_DIR}/bin/remage"
COMMAND "${VENV_DIR}/bin/python" -m uv -q pip install "${CMAKE_SOURCE_DIR}"
DEPENDS python-virtualenv
COMMENT "Installing remage Python wrapper into the virtual environment")

add_custom_target(remage-cli ALL DEPENDS "${VENV_DIR}/bin/remage")

# store the path to the remage executable, needed later in tests
set_target_properties(remage-cli PROPERTIES PYEXE_PATH "${VENV_DIR}/bin/remage")

Expand Down

0 comments on commit da99d50

Please sign in to comment.