Skip to content

Commit

Permalink
Add ament_xmllint to the ament_python packages. (#423)
Browse files Browse the repository at this point in the history
While we are here, also change all package.xml dependencies
for the ament_python packages to "exec_depend", which only
makes sense for Python packages.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Nov 1, 2024
1 parent dc71eae commit a13359b
Show file tree
Hide file tree
Showing 8 changed files with 109 additions and 13 deletions.
17 changes: 9 additions & 8 deletions launch_ros/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,19 @@
<author email="[email protected]">Michel Hidalgo</author>
<author email="[email protected]">William Woodall</author>

<depend>ament_index_python</depend>
<depend>launch</depend>
<depend>lifecycle_msgs</depend>
<depend>osrf_pycommon</depend>
<depend>rclpy</depend>
<depend>python3-importlib-metadata</depend>
<depend>python3-yaml</depend>
<depend>composition_interfaces</depend>
<exec_depend>ament_index_python</exec_depend>
<exec_depend>composition_interfaces</exec_depend>
<exec_depend>launch</exec_depend>
<exec_depend>lifecycle_msgs</exec_depend>
<exec_depend>osrf_pycommon</exec_depend>
<exec_depend>python3-importlib-metadata</exec_depend>
<exec_depend>python3-yaml</exec_depend>
<exec_depend>rclpy</exec_depend>

<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
<test_depend>ament_xmllint</test_depend>
<test_depend>python3-pytest</test_depend>

<export>
Expand Down
23 changes: 23 additions & 0 deletions launch_ros/test/test_xmllint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_xmllint.main import main
import pytest


@pytest.mark.linter
@pytest.mark.xmllint
def test_xmllint():
rc = main(argv=[])
assert rc == 0, 'Found errors'
1 change: 1 addition & 0 deletions launch_testing_ros/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
<test_depend>ament_xmllint</test_depend>
<test_depend>python3-pytest</test_depend>
<test_depend>std_msgs</test_depend>

Expand Down
23 changes: 23 additions & 0 deletions launch_testing_ros/test/test_xmllint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_xmllint.main import main
import pytest


@pytest.mark.linter
@pytest.mark.xmllint
def test_xmllint():
rc = main(argv=[])
assert rc == 0, 'Found errors'
11 changes: 6 additions & 5 deletions ros2launch/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
<author email="[email protected]">Michel Hidalgo</author>
<author email="[email protected]">William Woodall</author>

<depend>ament_index_python</depend>
<depend>launch</depend>
<depend>launch_ros</depend>
<depend>ros2cli</depend>
<depend>ros2pkg</depend>
<exec_depend>ament_index_python</exec_depend>
<exec_depend>launch</exec_depend>
<exec_depend>launch_ros</exec_depend>
<exec_depend>ros2cli</exec_depend>
<exec_depend>ros2pkg</exec_depend>

<!-- Explicit group resolution - see ros-infrastructure/catkin_pkg#369 -->
<exec_depend condition="$DISABLE_GROUPS_WORKAROUND != 1">launch_xml</exec_depend>
Expand All @@ -32,6 +32,7 @@
<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
<test_depend>ament_xmllint</test_depend>
<test_depend>python3-pytest</test_depend>

<group_depend>launch_frontend_packages</group_depend>
Expand Down
23 changes: 23 additions & 0 deletions ros2launch/test/test_xmllint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_xmllint.main import main
import pytest


@pytest.mark.linter
@pytest.mark.xmllint
def test_xmllint():
rc = main(argv=[])
assert rc == 0, 'Found errors'
1 change: 1 addition & 0 deletions test_launch_ros/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<test_depend>ament_copyright</test_depend>
<test_depend>ament_flake8</test_depend>
<test_depend>ament_pep257</test_depend>
<test_depend>ament_xmllint</test_depend>
<test_depend>builtin_interfaces</test_depend>
<test_depend>composition</test_depend>
<test_depend>demo_nodes_py</test_depend>
Expand Down
23 changes: 23 additions & 0 deletions test_launch_ros/test/test_xmllint.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2019 Open Source Robotics Foundation, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from ament_xmllint.main import main
import pytest


@pytest.mark.linter
@pytest.mark.xmllint
def test_xmllint():
rc = main(argv=[])
assert rc == 0, 'Found errors'

0 comments on commit a13359b

Please sign in to comment.