Skip to content
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

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

Merged
merged 8 commits into from
Aug 9, 2024
28 changes: 15 additions & 13 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ 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-rolling-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
Expand Down Expand Up @@ -43,10 +43,11 @@ jobs:
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
Expand All @@ -67,17 +68,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-rolling-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 }}
Expand All @@ -88,14 +90,14 @@ 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-rolling-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
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ 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
Expand Down Expand Up @@ -91,8 +91,7 @@ jobs:
- 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
16 changes: 7 additions & 9 deletions rosbag2_py/rosbag2_py/_transport.pyi
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
from typing import Any, ClassVar, List

from typing import overload
import datetime
import rosbag2_py._storage
from _typeshed import Incomplete
from typing import ClassVar, List, overload

class PlayOptions:
clock_publish_frequency: float
Expand All @@ -22,7 +21,7 @@ class PlayOptions:
rate: float
read_ahead_queue_size: int
regex_to_filter: str
service_requests_source: Any
service_requests_source: Incomplete
services_to_filter: List[str]
start_offset: float
start_paused: bool
Expand All @@ -38,7 +37,8 @@ class Player:
@overload
def __init__(self, arg0: str) -> None: ...
def burst(self, storage_options: rosbag2_py._storage.StorageOptions, play_options: PlayOptions, num_messages: int) -> None: ...
def cancel(self, *args, **kwargs) -> Any: ...
@staticmethod
def cancel() -> None: ...
def play(self, storage_options: rosbag2_py._storage.StorageOptions, play_options: PlayOptions) -> None: ...

class RecordOptions:
Expand Down Expand Up @@ -75,23 +75,21 @@ class Recorder:
def __init__(self) -> None: ...
@overload
def __init__(self, arg0: str) -> None: ...
def cancel(self, *args, **kwargs) -> Any: ...
@staticmethod
def cancel() -> None: ...
def record(self, storage_options: rosbag2_py._storage.StorageOptions, record_options: RecordOptions, node_name: str = ...) -> None: ...

class ServiceRequestsSource:
__doc__: ClassVar[str] = ... # read-only
__members__: ClassVar[dict] = ... # read-only
CLIENT_INTROSPECTION: ClassVar[ServiceRequestsSource] = ...
SERVICE_INTROSPECTION: ClassVar[ServiceRequestsSource] = ...
__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
2 changes: 1 addition & 1 deletion rosbag2_py/rosbag2_py/_writer.pyi
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import overload
import rosbag2_py._compression_options
import rosbag2_py._storage
from typing import overload

class SequentialCompressionWriter:
def __init__(self, arg0: rosbag2_py._compression_options.CompressionOptions) -> None: ...
Expand Down
Loading