Skip to content

Commit 3bee784

Browse files
committed
deps: upgrade protobuf to >=6.33 and grpcio to >=1.76
Update protobuf and grpcio dependencies to use floating version ranges, improving flexibility for downstream users. Dependency updates: - protobuf: ==6.32.1 -> >=6.33,<7 - grpcio: ==1.75.1 -> >=1.76 - grpcio-tools: ==1.75.1 -> >=1.76 Changes: - Update pyproject.toml, contrib/pyln-grpc-proto/pyproject.toml, and contrib/pyln-testing/pyproject.toml - Remove stale contrib/pyln-grpc-proto/uv.lock (referenced old protobuf3) - Regenerate protobuf files with grpcio-tools 1.76 - Remove manual protoc installation from CI setup.sh, now relies on grpcio-tools bundled protoc for version consistency Changelog-Changed: Upgraded protobuf to >=6.33 and grpcio to >=1.76 for better downstream compatibility
1 parent 96adac4 commit 3bee784

7 files changed

Lines changed: 157 additions & 334 deletions

File tree

.github/scripts/setup.sh

Lines changed: 4 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -71,29 +71,7 @@ uv sync --all-extras --all-groups
7171
# required for reckless till poetry to uv migration
7272
uv tool install poetry
7373

74-
# We also need a relatively recent protobuf-compiler, at least 3.12.0,
75-
# in order to support the experimental `optional` flag.
76-
77-
# BUT WAIT! Gentoo wants this to match the version from the Python protobuf,
78-
# which comes from the same tree. Makes sense!
79-
80-
# And
81-
# grpcio-tools-1.69.0` requires `protobuf = ">=5.26.1,<6.0dev"`
82-
83-
# Now, protoc changed to date-based releases, BUT Python protobuf
84-
# didn't, so Python protobuf 4.21.12 (in Ubuntu 23.04) corresponds to
85-
# protoc 21.12 (which, FYI, is packaged in Ubuntu as version 3.21.12).
86-
87-
# In general protobuf version x.y.z corresponds to protoc version y.z
88-
89-
# Honorable mention go to Matt Whitlock for spelunking this horror with me!
90-
91-
PROTOC_VERSION=29.4
92-
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
93-
curl -LO $PB_REL/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip
94-
sudo unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local/
95-
sudo chmod a+x /usr/local/bin/protoc
96-
export PROTOC=/usr/local/bin/protoc
97-
export PATH=$PATH:/usr/local/bin
98-
env
99-
ls -lha /usr/local/bin
74+
# We use grpcio-tools which bundles a compatible protoc compiler.
75+
# This ensures the protoc version matches the protobuf Python package,
76+
# avoiding version mismatches between generated code and runtime.
77+
# The Makefile uses `uv run python -m grpc_tools.protoc` for code generation.

contrib/pyln-grpc-proto/pyln/grpc/node_pb2_grpc.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from pyln.grpc import node_pb2 as node__pb2
77

8-
GRPC_GENERATED_VERSION = '1.75.1'
8+
GRPC_GENERATED_VERSION = '1.76.0'
99
GRPC_VERSION = grpc.__version__
1010
_version_not_supported = False
1111

@@ -18,7 +18,7 @@
1818
if _version_not_supported:
1919
raise RuntimeError(
2020
f'The grpc package installed is at version {GRPC_VERSION},'
21-
+ f' but the generated code in node_pb2_grpc.py depends on'
21+
+ ' but the generated code in node_pb2_grpc.py depends on'
2222
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
2323
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
2424
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'

contrib/pyln-grpc-proto/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ authors = [{ name = "Christian Decker", email = "decker@blockstream.com" }]
66
license = { text = "MIT" }
77
readme = "README.md"
88
requires-python = ">=3.9,<4.0"
9-
dependencies = ["grpcio==1.75.1", "protobuf==6.32.1"]
9+
dependencies = ["grpcio>=1.76", "protobuf>=6.33,<7"]
1010

1111
[dependency-groups]
12-
dev = ["grpcio==1.75.1", "mypy-protobuf<4", "grpcio-tools==1.75.1"]
12+
dev = ["grpcio>=1.76", "mypy-protobuf<4", "grpcio-tools>=1.76"]
1313

1414
[tool.hatch.build.targets.wheel]
1515
packages = ["pyln"]

contrib/pyln-grpc-proto/uv.lock

Lines changed: 0 additions & 155 deletions
This file was deleted.

contrib/pyln-testing/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ dependencies = [
2323
dev = ["pyln-client", "pyln-grpc-proto"]
2424

2525
[project.optional-dependencies]
26-
grpc = ["pyln-grpc-proto>=0.1", "grpcio>=1.75.0"]
26+
grpc = ["pyln-grpc-proto>=0.1", "grpcio>=1.76"]
2727

2828
[tool.hatch.build.targets.wheel]
2929
packages = ["pyln"]

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,9 @@ requires-python = ">=3.9.2,<4.0"
77
dependencies = [
88
"Mako>=1.1.6",
99
"websocket-client>=1.2.3",
10-
"grpcio-tools==1.75.1",
11-
"grpcio==1.75.1",
12-
# We want a specific version of protobuf to match CI's .github/scripts/setup.sh
13-
"protobuf==6.32.1",
10+
"grpcio-tools>=1.76",
11+
"grpcio>=1.76",
12+
"protobuf>=6.33,<7",
1413
"cryptography>=46",
1514
"pyln-client",
1615
"pyln-proto",

uv.lock

Lines changed: 145 additions & 144 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)