Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions tools/abi_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,12 @@ def headers(prefix):


def _is_compatibility_package(rec: dict) -> bool:
"""vinca's ros-<distro>-<pkg> packages (package_name_mode: both) are empty and
only depend on ros2-<pkg> of the same version."""
"""vinca's ros-<distro>-<pkg> packages (package_name_mode: both) are empty and only
depend on ros2-<pkg> of the same version (and, since RoboStack/vinca#171, on the
distribution's mutex)."""
deps = rec.get("depends", [])
return len(deps) == 1 and deps[0].startswith("ros2-") and "==" in deps[0]
return (bool(deps) and deps[0].startswith("ros2-") and "==" in deps[0]
and all(d.startswith("ros2-distro-mutex") for d in deps[1:]))


def short_name(name: str, distro: str) -> str | None:
Expand Down
10 changes: 10 additions & 0 deletions tools/tests/test_abi_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,13 @@ def test_next_build_number_is_above_vinca_and_every_published_build(tmp_path, mo
monkeypatch.setattr(rs, "DISTROS", tmp_path)
assert abi_check.next_build_number({"a": {"1": {"build_number": 30}}, "b": {"2": {"build_number": 7}}}, "jazzy") == 31
assert abi_check.next_build_number({"a": {"1": {"build_number": 3}}}, "jazzy") == 26


def test_compatibility_packages_with_and_without_the_mutex():
assert abi_check._is_compatibility_package({"depends": ["ros2-rclcpp ==28.1.22"]})
assert abi_check._is_compatibility_package(
{"depends": ["ros2-rclcpp ==28.1.22", "ros2-distro-mutex 0.19.* jazzy_*"]})
assert not abi_check._is_compatibility_package(
{"depends": ["ros2-rclcpp ==28.1.22", "libboost >=1.90"]})
assert not abi_check._is_compatibility_package({"depends": ["ros2-distro-mutex 0.19.* jazzy_*", "libfoo"]})
assert not abi_check._is_compatibility_package({"depends": []})
Loading