-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resolve some todos #103
Resolve some todos #103
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,5 +14,3 @@ | |
|
||
# register package name for index | ||
ament_index_register_package() | ||
|
||
# TODO register plugins |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,14 +20,16 @@ | |
# :param DESTINATION_SUFFIX: the base package to install the module to | ||
# (default: empty, install as a top level module) | ||
# :type DESTINATION_SUFFIX: string | ||
# :param SKIP_COMPILE: if set do not compile the installed module | ||
# :type SKIP_COMPILE: option | ||
# | ||
macro(ament_python_install_module) | ||
_ament_cmake_python_register_environment_hook() | ||
_ament_cmake_python_install_module(${ARGN}) | ||
endmacro() | ||
|
||
function(_ament_cmake_python_install_module module_file) | ||
cmake_parse_arguments(ARG "" "DESTINATION_SUFFIX" "" ${ARGN}) | ||
cmake_parse_arguments(ARG "SKIP_COMPILE" "DESTINATION_SUFFIX" "" ${ARGN}) | ||
if(ARG_UNPARSED_ARGUMENTS) | ||
message(FATAL_ERROR "ament_python_install_module() called with unused " | ||
"arguments: ${ARG_UNPARSED_ARGUMENTS}") | ||
|
@@ -55,7 +57,16 @@ function(_ament_cmake_python_install_module module_file) | |
FILES "${module_file}" | ||
DESTINATION "${destination}" | ||
) | ||
# TODO optionally compile Python file | ||
if(NOT ARG_SKIP_COMPILE) | ||
# compile Python files | ||
install(CODE | ||
"execute_process( | ||
COMMAND | ||
\"${PYTHON_EXECUTABLE}\" \"-m\" \"compileall\" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: should this accept a custom executable like add_nose_test ? (same below) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It could, but until there is a use case when this is needed I wouldn't implement it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fair enough, windows will tell us soon enough if we need to pass a debug interpreter here |
||
\"${CMAKE_INSTALL_PREFIX}/${destination}/${module_file}\" | ||
)" | ||
) | ||
endif() | ||
|
||
if(destination IN_LIST AMENT_CMAKE_PYTHON_INSTALL_INSTALLED_NAMES) | ||
message(FATAL_ERROR "ament_python_install_module() a Python module file " | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what this TODO means exactly, and where has the function it refers to been implemented. Can you provide a pointer to that function ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea was to introspect nosetest and register each individual test function as a separate CTest. I don't think we will purpose the idea though since that make reporting the results in separate JUnit files much more difficult and the runtime would be worse since each test would use a separate Python interpreter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could such a function provide the ability to flag / label test functions independently (in the vein of what is suggested in ros2/build_farmer#41 (comment)) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests can already be labels within Python. No need for CTest to get involved for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 cool
@nuclearsandwich FYI