From 05d33086a9b48efae2068f4ca39572bcb1a189a5 Mon Sep 17 00:00:00 2001 From: Xuwznln <18435084+Xuwznln@users.noreply.github.com> Date: Sun, 1 Mar 2026 11:17:15 +0800 Subject: [PATCH] ci: update Python version in CI workflows to 3.11 - Changed Python version from 3.10 to 3.11 in ci.yml and publish.yml workflows. - Updated cache keys and build names accordingly. - Simplified conditional logic in ros2_instance.py for interface determination. --- .github/workflows/ci.yml | 16 ++++++++-------- .github/workflows/publish.yml | 16 ++++++++-------- msgcenterpy/instances/ros2_instance.py | 6 +----- pyproject.toml | 1 + 4 files changed, 18 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 46881c0..cca0379 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: "3.10" # Use minimum version for consistency + python-version: "3.10" - name: Install dependencies run: | @@ -33,27 +33,27 @@ jobs: with: extra_args: --all-files - # Step 2: Basic build and test with minimum Python version (3.10) + # Step 2: Basic build and test basic-build: - name: Basic build (Python 3.10, Ubuntu) + name: Basic build (Python 3.11, Ubuntu) runs-on: ubuntu-latest needs: [code-format] # Only run after code formatting passes steps: - uses: actions/checkout@v6 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v6 with: - python-version: "3.10" + python-version: "3.11" - name: Cache pip dependencies uses: actions/cache@v5 with: path: ~/.cache/pip - key: ubuntu-pip-3.10-${{ hashFiles('**/pyproject.toml') }} + key: ubuntu-pip-3.11-${{ hashFiles('**/pyproject.toml') }} restore-keys: | - ubuntu-pip-3.10- + ubuntu-pip-3.11- - name: Install dependencies run: | @@ -173,7 +173,7 @@ jobs: exclude: # Skip the combination we already tested in basic-build - os: ubuntu-latest - python-version: "3.10" + python-version: "3.11" steps: - uses: actions/checkout@v6 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0078dab..cdddb2f 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -34,7 +34,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v6 with: - python-version: "3.10" # Use minimum version for consistency + python-version: "3.10" - name: Install dependencies run: | @@ -46,27 +46,27 @@ jobs: with: extra_args: --all-files - # Step 2: Basic build and test with minimum Python version (3.10) + # Step 2: Basic build and test basic-build: - name: Basic build (Python 3.10, Ubuntu) + name: Basic build (Python 3.11, Ubuntu) runs-on: ubuntu-latest needs: [code-format] # Only run after code formatting passes steps: - uses: actions/checkout@v6 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v6 with: - python-version: "3.10" + python-version: "3.11" - name: Cache pip dependencies uses: actions/cache@v5 with: path: ~/.cache/pip - key: ubuntu-pip-3.10-${{ hashFiles('**/pyproject.toml') }} + key: ubuntu-pip-3.11-${{ hashFiles('**/pyproject.toml') }} restore-keys: | - ubuntu-pip-3.10- + ubuntu-pip-3.11- - name: Install dependencies run: | @@ -78,7 +78,7 @@ jobs: run: | pytest -v - # Step 3: ROS2 integration test + # Step 3: ROS2 integration test test-with-ros2: name: ROS2 integration test runs-on: ubuntu-latest diff --git a/msgcenterpy/instances/ros2_instance.py b/msgcenterpy/instances/ros2_instance.py index 2804b07..b8bcf7a 100644 --- a/msgcenterpy/instances/ros2_instance.py +++ b/msgcenterpy/instances/ros2_instance.py @@ -40,11 +40,7 @@ class ROS2MessageInstance(MessageInstance[Any]): interface = ( "msg" if ".msg" in module_name - else "srv" - if ".srv" in module_name - else "action" - if ".action" in module_name - else "msg" + else "srv" if ".srv" in module_name else "action" if ".action" in module_name else "msg" ) return f"{package}/{interface}/{class_name}" if package and class_name else f"{module_name}.{class_name}" diff --git a/pyproject.toml b/pyproject.toml index b03fce3..7af4f68 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -131,6 +131,7 @@ skips = ["B101", "B601"] current_version = "0.1.6" commit = true tag = true +push = true tag_name = "v{new_version}" message = "release: bump version {current_version} → {new_version}"