From 877f5dbd36a4476b5f57a35c7c4ad905ce734c4b Mon Sep 17 00:00:00 2001 From: Julian Oes Date: Tue, 24 Nov 2026 14:03:31 +1300 Subject: [PATCH] Pin code generator versions The bindings were generated with grpcio-tools 1.75.0 but requirements-dev.txt allowed any newer version. The release bot picked up 1.85.3, which changed every *_pb2*.py file and raised the minimum runtime to protobuf 7.35.1 and grpcio 1.85.3. Pin grpcio-tools, protoc-gen-mavsdk and ruff to the versions that reproduce the current bindings exactly. Old gencode works with newer runtimes, so this keeps the widest compatibility. grpcio-tools 1.75.0 has no wheels for Python > 3.13, so run the update workflow on 3.13 and stop installing requirements-dev.txt in the Windows job, which only builds wheels and doesn't need it. Also raise grpcio in requirements.txt to 1.75.0: the generated *_pb2_grpc.py files already raise at import time on anything older. --- .github/workflows/main.yml | 2 +- .github/workflows/mavsdk-update.yml | 3 ++- requirements-dev.txt | 14 +++++++++++--- requirements.txt | 2 +- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ebf6a95a..d0a2bfac 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -223,7 +223,7 @@ jobs: - name: Install prerequisites run: | - python3 -m pip install -r requirements.txt -r requirements-dev.txt + python3 -m pip install -r requirements.txt python3 -m pip install "setuptools<77" twine wheel - name: Create wheel diff --git a/.github/workflows/mavsdk-update.yml b/.github/workflows/mavsdk-update.yml index 813769c7..b99ae3cb 100644 --- a/.github/workflows/mavsdk-update.yml +++ b/.github/workflows/mavsdk-update.yml @@ -88,7 +88,8 @@ jobs: if: steps.check.outputs.update == 'true' uses: actions/setup-python@v7 with: - python-version: 3.x + # The pinned grpcio-tools in requirements-dev.txt has no wheels for newer Python. + python-version: '3.13' - name: Update and regenerate if: steps.check.outputs.update == 'true' diff --git a/requirements-dev.txt b/requirements-dev.txt index b9f7e4f8..bdb8b49a 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,11 @@ -grpcio-tools>=1.40.0 -protoc-gen-mavsdk~=2.0 -ruff>=0.12.12 +# Versions used to generate the bindings in mavsdk/. They are pinned so that +# regenerating (manually or by the mavsdk-update workflow) doesn't produce +# unrelated churn. +# +# grpcio-tools 1.75.0 generates code for protobuf 6.31.1 and grpcio 1.75.0, +# which then works with any newer protobuf/grpcio at runtime. Upgrading it +# raises the minimum runtime versions, so bump requirements.txt accordingly. +# It has wheels up to Python 3.13. +grpcio-tools==1.75.0 +protoc-gen-mavsdk==2.1.0 +ruff==0.17.6 diff --git a/requirements.txt b/requirements.txt index 3b3b7f38..4885347b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,2 +1,2 @@ protobuf>=6.32.1 -grpcio>=1.64.1 +grpcio>=1.75.0