Skip to content

Commit

Permalink
Python modules are now installed only when files are modified (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
koparasy authored Feb 29, 2024
1 parent ce6f7bb commit 2d29fd3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,8 @@ show-fixes = true

# change the default line length number or characters.
line-length = 120

[tool.yapf]
ignore = ["E501", "W503", "E226", "BLK100", "E203"]
column_limit = 120

17 changes: 13 additions & 4 deletions src/AMSWorkflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,17 @@ endif()
message(STATUS "AMS Python Source files are ${pyfiles}")
message(STATUS "AMS Python built cmd is : ${Python_EXECUTABLE} -m pip install ${_pip_args} ${AMS_PY_APP}")

add_custom_command(
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/timestamp"
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/timestamp"
COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${AMS_PY_APP}
DEPENDS ${pyfiles}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Build AMS-WF Python Modules and Applications"
BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/timestamp"
)

add_custom_target(PyAMS ALL
COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${AMS_PY_APP}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMENT "Build AMS-WF Python Modules and Applications"
DEPENDS ${pyfiles})
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/timestamp"
)

0 comments on commit 2d29fd3

Please sign in to comment.