Skip to content

Commit

Permalink
[jazzy] Update CI scripts to use Ubuntu Noble distros and bump action…
Browse files Browse the repository at this point in the history
… scripts to latest versions (backport #1709) (#1779)

* Update CI scripts to use Ubuntu Noble distros and bump action scripts to latest versions (#1709)

* Use Ubuntu Noble distros for ci jobs on rolling

Signed-off-by: Michael Orlov <[email protected]>

* Bump actions-ros-lint to version 0.1.3 and actions/checkout to v4

Signed-off-by: Michael Orlov <[email protected]>

* Exclude cppcheck from CI due to known issue that it is very slow

See ament/ament_lint#345 for details.

Signed-off-by: Michael Orlov <[email protected]>

* Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble

- Also add `--break-system-packages` to avoid error during pip uninstall

Signed-off-by: Michael Orlov <[email protected]>

* Remove "sudo pip uninstall -y mypy" since it is not installed with pip

Addressing the error message:
Found existing installation: mypy 1.9.0
ERROR: Cannot uninstall mypy 1.9.0, RECORD file not found. Hint:
The package was installed by debian.

Signed-off-by: Michael Orlov <[email protected]>

* Revert "Bump mypy to version 1.9.0-4ubuntu1 to be aligned with Noble"

This reverts commit b5aa018

Signed-off-by: Michael Orlov <[email protected]>

* Fixes for new mypy (Ubuntu 24.04) (#1763)

* Apply new stubgen changes

Signed-off-by: Roman Sokolkov <[email protected]>

* Update CI script and README.md

Signed-off-by: Roman Sokolkov <[email protected]>

---------

Signed-off-by: Roman Sokolkov <[email protected]>

* Remove "--break-system-packages" flag from mypy install in README.md

- Rationale: On Ubuntu 22.04 is an older version of the pip3 and python
version which doesn't have this flag.
- Also removed sudo before "pip3 install -U mypy==1.9" in README.md

Signed-off-by: Michael Orlov <[email protected]>

---------

Signed-off-by: Michael Orlov <[email protected]>
Signed-off-by: Roman Sokolkov <[email protected]>
Co-authored-by: Roman <[email protected]>
(cherry picked from commit 27a6b60)

* Update github CI scripts to use jazzy instead of rolling

Signed-off-by: Michael Orlov <[email protected]>

---------

Signed-off-by: Michael Orlov <[email protected]>
Co-authored-by: Michael Orlov <[email protected]>
  • Loading branch information
mergify[bot] and MichaelOrlov authored Aug 9, 2024
1 parent c86a562 commit ea10111
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 71 deletions.
38 changes: 20 additions & 18 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ jobs:
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-focal-ros-rolling-ros-base-latest
image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest
strategy:
fail-fast: false
matrix:
linter: [copyright, xmllint]
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/action-ros-lint@v0.1
- uses: actions/checkout@v4
- uses: ros-tooling/action-ros-lint@0.1.3
with:
linter: ${{ matrix.linter }}
distribution: rolling
distribution: jazzy
package-name: |
ros2bag
rosbag2
Expand All @@ -39,17 +39,18 @@ jobs:
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-focal-ros-rolling-ros-base-latest
image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest
strategy:
fail-fast: false
matrix:
linter: [cppcheck, cpplint, uncrustify]
# We exclude cppcheck due to https://github.com/ament/ament_lint/pull/345
linter: [cpplint, uncrustify]
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/action-ros-lint@v0.1
- uses: actions/checkout@v4
- uses: ros-tooling/action-ros-lint@0.1.3
with:
linter: ${{ matrix.linter }}
distribution: rolling
distribution: jazzy
package-name: |
rosbag2_compression
rosbag2_compression_zstd
Expand All @@ -67,38 +68,39 @@ jobs:
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-focal-ros-rolling-ros-base-latest
image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest
strategy:
fail-fast: false
matrix:
linter: [cppcheck, cpplint, clang_format]
# We exclude cppcheck due to https://github.com/ament/ament_lint/pull/345
linter: [cpplint, clang_format]
include:
- linter: clang_format
arguments: "--config rosbag2_storage_mcap/.clang-format"
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/action-ros-lint@v0.1
- uses: actions/checkout@v4
- uses: ros-tooling/action-ros-lint@0.1.3
with:
linter: ${{ matrix.linter }}
arguments: ${{ matrix.arguments }}
distribution: rolling
distribution: jazzy
package-name: rosbag2_storage_mcap

ament_lint_python: # Linters applicable to Python packages
name: ament_${{ matrix.linter }}
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-focal-ros-rolling-ros-base-latest
image: rostooling/setup-ros-docker:ubuntu-noble-ros-jazzy-ros-base-latest
strategy:
fail-fast: false
matrix:
linter: [pep257, flake8]
steps:
- uses: actions/checkout@v2
- uses: ros-tooling/action-ros-lint@v0.1
- uses: actions/checkout@v4
- uses: ros-tooling/action-ros-lint@0.1.3
with:
linter: ${{ matrix.linter }}
distribution: rolling
distribution: jazzy
package-name: |
ros2bag
rosbag2_py
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
push:
branches:
- rolling
- jazzy
schedule:
# Run every hour. This helps detect flakiness,
# and broken external dependencies.
Expand All @@ -13,14 +13,14 @@ jobs:
build_and_test:
runs-on: ubuntu-latest
container:
image: rostooling/setup-ros-docker:ubuntu-jammy-latest
image: rostooling/setup-ros-docker:ubuntu-noble-latest
steps:
- name: Build and run tests
id: action-ros-ci
uses: ros-tooling/[email protected]
with:
target-ros2-distro: rolling
vcs-repo-file-url: https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos
target-ros2-distro: jazzy
vcs-repo-file-url: https://raw.githubusercontent.com/ros2/ros2/jazzy/ros2.repos
colcon-defaults: |
{
"build": {
Expand Down Expand Up @@ -85,14 +85,13 @@ jobs:
run: |
rosbag2_path=$(colcon list -p --packages-select rosbag2)/..
rosbag2_packages=$(colcon list -n --base-paths ${rosbag2_path})
source /opt/ros/rolling/setup.sh && colcon test --mixin linters-skip --packages-select ${rosbag2_packages} --packages-skip rosbag2_performance_benchmarking --event-handlers console_cohesion+ --return-code-on-test-failure --ctest-args "-L xfail" --pytest-args "-m xfail"
source /opt/ros/jazzy/setup.sh && colcon test --mixin linters-skip --packages-select ${rosbag2_packages} --packages-skip rosbag2_performance_benchmarking --event-handlers console_cohesion+ --return-code-on-test-failure --ctest-args "-L xfail" --pytest-args "-m xfail"
working-directory: ${{ steps.action-ros-ci.outputs.ros-workspace-directory-name }}
shell: bash
- name: Is regeneration of Python stubs required?
run: |
rosbag2_path=$(colcon list -p --packages-select rosbag2)/..
sudo pip uninstall -y mypy
sudo apt update && sudo apt -y install mypy=0.942-1ubuntu1
sudo apt update && sudo apt -y install mypy
source install/setup.sh
stubgen -p rosbag2_py -o ${rosbag2_path}/rosbag2_py
cd ${rosbag2_path}
Expand Down
7 changes: 6 additions & 1 deletion rosbag2_py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ source install/setup.sh
# Make sure rosbag2_py can be imported
python3 -c 'import rosbag2_py'
sudo apt update && sudo apt install mypy=0.942-1ubuntu1
# Ubuntu 24.04
sudo apt update && sudo apt install mypy
# Older Ubuntu
# pip3 install -U mypy==1.9
cd <rosbag2 git repo>
stubgen -p rosbag2_py -o rosbag2_py
```
2 changes: 2 additions & 0 deletions rosbag2_py/rosbag2_py/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ from rosbag2_py._reindexer import Reindexer as Reindexer
from rosbag2_py._storage import BagMetadata as BagMetadata, ConverterOptions as ConverterOptions, FileInformation as FileInformation, MessageDefinition as MessageDefinition, MetadataIo as MetadataIo, ReadOrder as ReadOrder, ReadOrderSortBy as ReadOrderSortBy, StorageFilter as StorageFilter, StorageOptions as StorageOptions, TopicInformation as TopicInformation, TopicMetadata as TopicMetadata, get_default_storage_id as get_default_storage_id, to_rclcpp_qos_vector as to_rclcpp_qos_vector
from rosbag2_py._transport import PlayOptions as PlayOptions, Player as Player, RecordOptions as RecordOptions, Recorder as Recorder, ServiceRequestsSource as ServiceRequestsSource, bag_rewrite as bag_rewrite
from rosbag2_py._writer import SequentialCompressionWriter as SequentialCompressionWriter, SequentialWriter as SequentialWriter, get_registered_compressors as get_registered_compressors, get_registered_serializers as get_registered_serializers, get_registered_writers as get_registered_writers

__all__ = ['bag_rewrite', 'CompressionMode', 'CompressionOptions', 'compression_mode_from_string', 'compression_mode_to_string', 'ConverterOptions', 'FileInformation', 'get_default_storage_id', 'get_registered_readers', 'get_registered_writers', 'get_registered_compressors', 'get_registered_serializers', 'to_rclcpp_qos_vector', 'ReadOrder', 'ReadOrderSortBy', 'Reindexer', 'SequentialCompressionReader', 'SequentialCompressionWriter', 'SequentialReader', 'SequentialWriter', 'StorageFilter', 'StorageOptions', 'TopicMetadata', 'TopicInformation', 'BagMetadata', 'MessageDefinition', 'MetadataIo', 'Info', 'Player', 'PlayOptions', 'ServiceRequestsSource', 'Recorder', 'RecordOptions', 'LocalMessageDefinitionSource']
3 changes: 0 additions & 3 deletions rosbag2_py/rosbag2_py/_compression_options.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,17 @@ MESSAGE: CompressionMode
NONE: CompressionMode

class CompressionMode:
__doc__: ClassVar[str] = ... # read-only
__members__: ClassVar[dict] = ... # read-only
FILE: ClassVar[CompressionMode] = ...
MESSAGE: ClassVar[CompressionMode] = ...
NONE: ClassVar[CompressionMode] = ...
__entries: ClassVar[dict] = ...
def __init__(self, value: int) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __setstate__(self, state: int) -> None: ...
@property
def name(self) -> str: ...
@property
Expand Down
4 changes: 1 addition & 3 deletions rosbag2_py/rosbag2_py/_message_definitions.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from typing import Any

class LocalMessageDefinitionSource:
def __init__(self) -> None: ...
def get_full_text(self, *args, **kwargs) -> Any: ...
def get_full_text(self, *args, **kwargs): ...
14 changes: 6 additions & 8 deletions rosbag2_py/rosbag2_py/_reader.pyi
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
from typing import Any

class SequentialCompressionReader:
def __init__(self) -> None: ...
def get_all_message_definitions(self, *args, **kwargs) -> Any: ...
def get_all_topics_and_types(self, *args, **kwargs) -> Any: ...
def get_metadata(self, *args, **kwargs) -> Any: ...
def get_all_message_definitions(self, *args, **kwargs): ...
def get_all_topics_and_types(self, *args, **kwargs): ...
def get_metadata(self, *args, **kwargs): ...
def has_next(self) -> bool: ...
def open(self, arg0, arg1) -> None: ...
def open_uri(self, arg0: str) -> None: ...
Expand All @@ -16,9 +14,9 @@ class SequentialCompressionReader:

class SequentialReader:
def __init__(self) -> None: ...
def get_all_message_definitions(self, *args, **kwargs) -> Any: ...
def get_all_topics_and_types(self, *args, **kwargs) -> Any: ...
def get_metadata(self, *args, **kwargs) -> Any: ...
def get_all_message_definitions(self, *args, **kwargs): ...
def get_all_topics_and_types(self, *args, **kwargs): ...
def get_metadata(self, *args, **kwargs): ...
def has_next(self) -> bool: ...
def open(self, arg0, arg1) -> None: ...
def open_uri(self, arg0: str) -> None: ...
Expand Down
26 changes: 5 additions & 21 deletions rosbag2_py/rosbag2_py/_storage.pyi
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
from typing import ClassVar, Dict, List

import datetime
from typing import ClassVar, Dict, List

class BagMetadata:
bag_size: int
compression_format: str
compression_mode: str
custom_data: Dict[str,str]
custom_data: Dict[str, str]
duration: object
files: List[FileInformation]
message_count: int
Expand All @@ -16,7 +15,7 @@ class BagMetadata:
storage_identifier: str
topics_with_message_count: List[TopicInformation]
version: int
def __init__(self, version: int = ..., bag_size: int = ..., storage_identifier: str = ..., relative_file_paths: List[str] = ..., files: List[FileInformation] = ..., duration: object = ..., starting_time: object = ..., message_count: int = ..., topics_with_message_count: List[TopicInformation] = ..., compression_format: str = ..., compression_mode: str = ..., custom_data: Dict[str,str] = ..., ros_distro: str = ...) -> None: ...
def __init__(self, version: int = ..., bag_size: int = ..., storage_identifier: str = ..., relative_file_paths: List[str] = ..., files: List[FileInformation] = ..., duration: object = ..., starting_time: object = ..., message_count: int = ..., topics_with_message_count: List[TopicInformation] = ..., compression_format: str = ..., compression_mode: str = ..., custom_data: Dict[str, str] = ..., ros_distro: str = ...) -> None: ...

class ConverterOptions:
input_serialization_format: str
Expand Down Expand Up @@ -71,20 +70,17 @@ class ReadOrder:
def __init__(self, sort_by: ReadOrderSortBy = ..., reverse: bool = ...) -> None: ...

class ReadOrderSortBy:
__doc__: ClassVar[str] = ... # read-only
__members__: ClassVar[dict] = ... # read-only
File: ClassVar[ReadOrderSortBy] = ...
PublishedTimestamp: ClassVar[ReadOrderSortBy] = ...
ReceivedTimestamp: ClassVar[ReadOrderSortBy] = ...
__entries: ClassVar[dict] = ...
def __init__(self, value: int) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __setstate__(self, state: int) -> None: ...
@property
def name(self) -> str: ...
@property
Expand All @@ -100,7 +96,7 @@ class StorageFilter:
def __init__(self, topics: List[str] = ..., services_events: List[str] = ..., regex: str = ..., exclude_topics: List[str] = ..., exclude_service_events: List[str] = ..., regex_to_exclude: str = ...) -> None: ...

class StorageOptions:
custom_data: Dict[str,str]
custom_data: Dict[str, str]
end_time_ns: int
max_bagfile_duration: int
max_bagfile_size: int
Expand All @@ -111,7 +107,7 @@ class StorageOptions:
storage_id: str
storage_preset_profile: str
uri: str
def __init__(self, uri: str, storage_id: str = ..., max_bagfile_size: int = ..., max_bagfile_duration: int = ..., max_cache_size: int = ..., storage_preset_profile: str = ..., storage_config_uri: str = ..., snapshot_mode: bool = ..., start_time_ns: int = ..., end_time_ns: int = ..., custom_data: Dict[str,str] = ...) -> None: ...
def __init__(self, uri: str, storage_id: str = ..., max_bagfile_size: int = ..., max_bagfile_duration: int = ..., max_cache_size: int = ..., storage_preset_profile: str = ..., storage_config_uri: str = ..., snapshot_mode: bool = ..., start_time_ns: int = ..., end_time_ns: int = ..., custom_data: Dict[str, str] = ...) -> None: ...

class TopicInformation:
message_count: int
Expand All @@ -129,7 +125,6 @@ class TopicMetadata:
def equals(self, arg0: TopicMetadata) -> bool: ...

class rmw_qos_durability_policy_t:
__doc__: ClassVar[str] = ... # read-only
__members__: ClassVar[dict] = ... # read-only
RMW_QOS_POLICY_DURABILITY_SYSTEM_DEFAULT: ClassVar[rmw_qos_durability_policy_t] = ...
RMW_QOS_POLICY_DURABILITY_TRANSIENT_LOCAL: ClassVar[rmw_qos_durability_policy_t] = ...
Expand All @@ -138,19 +133,16 @@ class rmw_qos_durability_policy_t:
__entries: ClassVar[dict] = ...
def __init__(self, value: int) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __setstate__(self, state: int) -> None: ...
@property
def name(self) -> str: ...
@property
def value(self) -> int: ...

class rmw_qos_history_policy_t:
__doc__: ClassVar[str] = ... # read-only
__members__: ClassVar[dict] = ... # read-only
RMW_QOS_POLICY_HISTORY_KEEP_ALL: ClassVar[rmw_qos_history_policy_t] = ...
RMW_QOS_POLICY_HISTORY_KEEP_LAST: ClassVar[rmw_qos_history_policy_t] = ...
Expand All @@ -159,19 +151,16 @@ class rmw_qos_history_policy_t:
__entries: ClassVar[dict] = ...
def __init__(self, value: int) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __setstate__(self, state: int) -> None: ...
@property
def name(self) -> str: ...
@property
def value(self) -> int: ...

class rmw_qos_liveliness_policy_t:
__doc__: ClassVar[str] = ... # read-only
__members__: ClassVar[dict] = ... # read-only
RMW_QOS_POLICY_LIVELINESS_AUTOMATIC: ClassVar[rmw_qos_liveliness_policy_t] = ...
RMW_QOS_POLICY_LIVELINESS_MANUAL_BY_TOPIC: ClassVar[rmw_qos_liveliness_policy_t] = ...
Expand All @@ -180,19 +169,16 @@ class rmw_qos_liveliness_policy_t:
__entries: ClassVar[dict] = ...
def __init__(self, value: int) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __setstate__(self, state: int) -> None: ...
@property
def name(self) -> str: ...
@property
def value(self) -> int: ...

class rmw_qos_reliability_policy_t:
__doc__: ClassVar[str] = ... # read-only
__members__: ClassVar[dict] = ... # read-only
RMW_QOS_POLICY_RELIABILITY_BEST_EFFORT: ClassVar[rmw_qos_reliability_policy_t] = ...
RMW_QOS_POLICY_RELIABILITY_RELIABLE: ClassVar[rmw_qos_reliability_policy_t] = ...
Expand All @@ -201,12 +187,10 @@ class rmw_qos_reliability_policy_t:
__entries: ClassVar[dict] = ...
def __init__(self, value: int) -> None: ...
def __eq__(self, other: object) -> bool: ...
def __getstate__(self) -> int: ...
def __hash__(self) -> int: ...
def __index__(self) -> int: ...
def __int__(self) -> int: ...
def __ne__(self, other: object) -> bool: ...
def __setstate__(self, state: int) -> None: ...
@property
def name(self) -> str: ...
@property
Expand Down
Loading

0 comments on commit ea10111

Please sign in to comment.