From 4eb39a635b297778aa0104163af68c03fb6fb637 Mon Sep 17 00:00:00 2001 From: David Anthony Date: Mon, 11 Sep 2023 14:36:37 -0500 Subject: [PATCH] Fixing Buildfarm Issues (#716) * Cleaning up code to fix build farm errors --- swri_cli_tools/CMakeLists.txt | 24 --------------- swri_cli_tools/package.xml | 13 ++++++--- swri_cli_tools/setup.py | 12 ++++---- .../swri_cli_tools/api/_node_info.py | 29 +++++++++++++++++-- swri_cli_tools/swri_cli_tools/command/swri.py | 26 ++++++++++++++++- .../swri_cli_tools/document/_document.py | 25 ++++++++++++++++ .../swri_cli_tools/verb/document.py | 25 +++++++++++++++- swri_console_util/package.xml | 2 ++ swri_dbw_interface/package.xml | 1 + swri_geometry_util/package.xml | 2 ++ swri_image_util/package.xml | 2 ++ swri_math_util/package.xml | 2 ++ swri_opencv_util/package.xml | 2 ++ swri_prefix_tools/package.xml | 7 +++-- swri_roscpp/package.xml | 3 +- swri_route_util/package.xml | 1 + swri_serial_util/package.xml | 2 ++ swri_system_util/package.xml | 2 ++ swri_transform_util/package.xml | 2 ++ 19 files changed, 140 insertions(+), 42 deletions(-) delete mode 100644 swri_cli_tools/CMakeLists.txt diff --git a/swri_cli_tools/CMakeLists.txt b/swri_cli_tools/CMakeLists.txt deleted file mode 100644 index f24807e95..000000000 --- a/swri_cli_tools/CMakeLists.txt +++ /dev/null @@ -1,24 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(swri_cli_tools) - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -find_package(marti_introspection_msgs REQUIRED) - -if(BUILD_TESTING) - find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # comment the line when a copyright and license is added to all source files - set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # comment the line when this package is in a git repo and when - # a copyright and license is added to all source files - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/swri_cli_tools/package.xml b/swri_cli_tools/package.xml index 598256c41..5814dedb1 100644 --- a/swri_cli_tools/package.xml +++ b/swri_cli_tools/package.xml @@ -4,17 +4,22 @@ swri_cli_tools 3.6.0 Command line tools for introspecting ROS systems + Southwest Research Institute David Anthony - BSD 3 Clause - ament_cmake + BSD 3 Clause marti_introspection_msgs python3-natsort + rcl_interfaces + rclpy + ros2cli - ament_lint_auto - ament_lint_common + ament_copyright + ament_flake8 + ament_pep257 + ament_xmllint ament_python diff --git a/swri_cli_tools/setup.py b/swri_cli_tools/setup.py index 79e936b1a..10ae910be 100644 --- a/swri_cli_tools/setup.py +++ b/swri_cli_tools/setup.py @@ -1,5 +1,5 @@ -from setuptools import find_packages -from setuptools import setup +import os +from setuptools import find_packages, setup package_name = 'swri_cli_tools' @@ -8,11 +8,10 @@ version='3.6.0', packages=find_packages(exclude=['test']), data_files=[ - ('share/' + package_name, ['package.xml']), - ('share/ament_index/resource_index/packages', - ['resource/' + package_name]) + ('share/ament_index/resource_index/packages', ['resource/' + package_name]), + (os.path.join('share', package_name), ['package.xml']), ], - install_requires=['ros2cli'], + install_requires=['ros2cli', 'setuptools'], zip_safe=True, author='David Anthony', author_email='david.anthony@swri.org', @@ -21,6 +20,7 @@ url='https://github.com/swri-robotics/marti_common', keywords=['ROS'], classifiers=[ + 'Environment :: Console', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD 3 Clause', 'Programming Language :: Python', diff --git a/swri_cli_tools/swri_cli_tools/api/_node_info.py b/swri_cli_tools/swri_cli_tools/api/_node_info.py index 07b72cbc7..f7e659719 100644 --- a/swri_cli_tools/swri_cli_tools/api/_node_info.py +++ b/swri_cli_tools/swri_cli_tools/api/_node_info.py @@ -1,11 +1,36 @@ -"""Holds information about node in ROS 2 system.""" +# Copyright (c) 2023, Southwest Research Institute® (SwRI®) +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Southwest Research Institute® (SwRI®) nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -from __future__ import annotations from typing import List from rcl_interfaces.msg import ParameterType from ros2node.api import TopicInfo +from swri_cli_tools.api._node_info import NodeInfo +from swri_cli_tools.api._node_info import ParameterInfo + def print_node_infos(nodes: List(NodeInfo)): """Print information about nodes.""" diff --git a/swri_cli_tools/swri_cli_tools/command/swri.py b/swri_cli_tools/swri_cli_tools/command/swri.py index 5a5032250..4d2779f08 100644 --- a/swri_cli_tools/swri_cli_tools/command/swri.py +++ b/swri_cli_tools/swri_cli_tools/command/swri.py @@ -1,10 +1,34 @@ +# Copyright (c) 2023, Southwest Research Institute® (SwRI®) +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Southwest Research Institute® (SwRI®) nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + from ros2cli.command import add_subparsers_on_demand from ros2cli.command import CommandExtension class SwriCommand(CommandExtension): """Execute SwRI CLI command""" - def add_arguments(self, parser, cli_name): """Add arguments""" self._subparser = parser diff --git a/swri_cli_tools/swri_cli_tools/document/_document.py b/swri_cli_tools/swri_cli_tools/document/_document.py index d9caa13f0..ccd88caa2 100644 --- a/swri_cli_tools/swri_cli_tools/document/_document.py +++ b/swri_cli_tools/swri_cli_tools/document/_document.py @@ -1,3 +1,28 @@ +# Copyright (c) 2023, Southwest Research Institute® (SwRI®) +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Southwest Research Institute® (SwRI®) nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + from natsort import natsorted from swri_cli_tools.api._node_info import NodeInfo diff --git a/swri_cli_tools/swri_cli_tools/verb/document.py b/swri_cli_tools/swri_cli_tools/verb/document.py index ef8a1bdfb..0d9b8de8e 100644 --- a/swri_cli_tools/swri_cli_tools/verb/document.py +++ b/swri_cli_tools/swri_cli_tools/verb/document.py @@ -1,4 +1,27 @@ -import sys +# Copyright (c) 2023, Southwest Research Institute® (SwRI®) +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of Southwest Research Institute® (SwRI®) nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. from ros2cli.node.strategy import add_arguments as add_strategy_node_arguments from swri_cli_tools.document import document_system diff --git a/swri_console_util/package.xml b/swri_console_util/package.xml index 9e5dc1642..5c6d4c217 100644 --- a/swri_console_util/package.xml +++ b/swri_console_util/package.xml @@ -1,3 +1,5 @@ + + swri_console_util 3.6.0 diff --git a/swri_dbw_interface/package.xml b/swri_dbw_interface/package.xml index b96c856b0..f6426f099 100644 --- a/swri_dbw_interface/package.xml +++ b/swri_dbw_interface/package.xml @@ -1,4 +1,5 @@ + swri_dbw_interface 3.6.0 diff --git a/swri_geometry_util/package.xml b/swri_geometry_util/package.xml index 1a4e47780..113e39dd6 100644 --- a/swri_geometry_util/package.xml +++ b/swri_geometry_util/package.xml @@ -1,3 +1,5 @@ + + swri_geometry_util 3.6.0 diff --git a/swri_image_util/package.xml b/swri_image_util/package.xml index dc6b0e27d..60d2f6f48 100644 --- a/swri_image_util/package.xml +++ b/swri_image_util/package.xml @@ -1,3 +1,5 @@ + + swri_image_util 3.6.0 diff --git a/swri_math_util/package.xml b/swri_math_util/package.xml index 1759121ad..ea6a40c14 100644 --- a/swri_math_util/package.xml +++ b/swri_math_util/package.xml @@ -1,3 +1,5 @@ + + swri_math_util 3.6.0 diff --git a/swri_opencv_util/package.xml b/swri_opencv_util/package.xml index 7374976a3..0611c17c9 100644 --- a/swri_opencv_util/package.xml +++ b/swri_opencv_util/package.xml @@ -1,3 +1,5 @@ + + swri_opencv_util 3.6.0 diff --git a/swri_prefix_tools/package.xml b/swri_prefix_tools/package.xml index c1fa01582..79a5880ae 100644 --- a/swri_prefix_tools/package.xml +++ b/swri_prefix_tools/package.xml @@ -1,3 +1,5 @@ + + swri_prefix_tools 3.6.0 @@ -8,14 +10,13 @@ Elliot Johnson - P. J. Reed + Southwest Research Institute BSD https://github.com/swri-robotics/marti_common ament_cmake - python-psutil - python3-psutil + python3-psutil ament_cmake diff --git a/swri_roscpp/package.xml b/swri_roscpp/package.xml index e937b6d9b..58808ad01 100644 --- a/swri_roscpp/package.xml +++ b/swri_roscpp/package.xml @@ -1,4 +1,5 @@ - + + swri_roscpp 3.6.0 diff --git a/swri_route_util/package.xml b/swri_route_util/package.xml index 1184dbaeb..2eedbb3dc 100644 --- a/swri_route_util/package.xml +++ b/swri_route_util/package.xml @@ -1,4 +1,5 @@ + swri_route_util 3.6.0 diff --git a/swri_serial_util/package.xml b/swri_serial_util/package.xml index 6c0b0a2c6..818c1fa46 100644 --- a/swri_serial_util/package.xml +++ b/swri_serial_util/package.xml @@ -1,3 +1,5 @@ + + swri_serial_util 3.6.0 diff --git a/swri_system_util/package.xml b/swri_system_util/package.xml index 16b69e241..28e29d95e 100644 --- a/swri_system_util/package.xml +++ b/swri_system_util/package.xml @@ -1,3 +1,5 @@ + + swri_system_util 3.6.0 diff --git a/swri_transform_util/package.xml b/swri_transform_util/package.xml index 94711521b..6fcc3b251 100644 --- a/swri_transform_util/package.xml +++ b/swri_transform_util/package.xml @@ -1,3 +1,5 @@ + + swri_transform_util 3.6.0