Skip to content

Commit 2d29fd3

Browse files
authored
Python modules are now installed only when files are modified (#54)
1 parent ce6f7bb commit 2d29fd3

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

pyproject.toml

+5
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,8 @@ show-fixes = true
8181

8282
# change the default line length number or characters.
8383
line-length = 120
84+
85+
[tool.yapf]
86+
ignore = ["E501", "W503", "E226", "BLK100", "E203"]
87+
column_limit = 120
88+

src/AMSWorkflow/CMakeLists.txt

+13-4
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,17 @@ endif()
1919
message(STATUS "AMS Python Source files are ${pyfiles}")
2020
message(STATUS "AMS Python built cmd is : ${Python_EXECUTABLE} -m pip install ${_pip_args} ${AMS_PY_APP}")
2121

22+
add_custom_command(
23+
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/timestamp"
24+
COMMAND ${CMAKE_COMMAND} -E touch "${CMAKE_CURRENT_BINARY_DIR}/timestamp"
25+
COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${AMS_PY_APP}
26+
DEPENDS ${pyfiles}
27+
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
28+
COMMENT "Build AMS-WF Python Modules and Applications"
29+
BYPRODUCTS "${CMAKE_CURRENT_BINARY_DIR}/timestamp"
30+
)
31+
2232
add_custom_target(PyAMS ALL
23-
COMMAND ${Python_EXECUTABLE} -m pip install ${_pip_args} ${AMS_PY_APP}
24-
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
25-
COMMENT "Build AMS-WF Python Modules and Applications"
26-
DEPENDS ${pyfiles})
33+
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/timestamp"
34+
)
35+

0 commit comments

Comments
 (0)