Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 4 additions & 26 deletions .github/scripts/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,29 +71,7 @@ uv sync --all-extras --all-groups
# required for reckless till poetry to uv migration
uv tool install poetry

# We also need a relatively recent protobuf-compiler, at least 3.12.0,
# in order to support the experimental `optional` flag.

# BUT WAIT! Gentoo wants this to match the version from the Python protobuf,
# which comes from the same tree. Makes sense!

# And
# grpcio-tools-1.69.0` requires `protobuf = ">=5.26.1,<6.0dev"`

# Now, protoc changed to date-based releases, BUT Python protobuf
# didn't, so Python protobuf 4.21.12 (in Ubuntu 23.04) corresponds to
# protoc 21.12 (which, FYI, is packaged in Ubuntu as version 3.21.12).

# In general protobuf version x.y.z corresponds to protoc version y.z

# Honorable mention go to Matt Whitlock for spelunking this horror with me!

PROTOC_VERSION=29.4
PB_REL="https://github.com/protocolbuffers/protobuf/releases"
curl -LO $PB_REL/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip
sudo unzip protoc-${PROTOC_VERSION}-linux-x86_64.zip -d /usr/local/
sudo chmod a+x /usr/local/bin/protoc
export PROTOC=/usr/local/bin/protoc
export PATH=$PATH:/usr/local/bin
env
ls -lha /usr/local/bin
# Install protoc wrapper that uses grpcio-tools bundled compiler.
# This ensures the protoc version matches the protobuf Python package,
# avoiding version mismatches between generated code and runtime.
sudo install -m 755 contrib/protoc /usr/local/bin/protoc
4 changes: 4 additions & 0 deletions contrib/protoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
# Wrapper script that invokes protoc from grpcio-tools via uv
# This ensures the protoc version matches the Python protobuf package
exec uv run python3 -m grpc_tools.protoc "$@"
4 changes: 2 additions & 2 deletions contrib/pyln-grpc-proto/pyln/grpc/node_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

from pyln.grpc import node_pb2 as node__pb2

GRPC_GENERATED_VERSION = '1.75.1'
GRPC_GENERATED_VERSION = '1.76.0'
GRPC_VERSION = grpc.__version__
_version_not_supported = False

Expand All @@ -18,7 +18,7 @@
if _version_not_supported:
raise RuntimeError(
f'The grpc package installed is at version {GRPC_VERSION},'
+ f' but the generated code in node_pb2_grpc.py depends on'
+ ' but the generated code in node_pb2_grpc.py depends on'
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
Expand Down
4 changes: 2 additions & 2 deletions contrib/pyln-grpc-proto/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ authors = [{ name = "Christian Decker", email = "decker@blockstream.com" }]
license = { text = "MIT" }
readme = "README.md"
requires-python = ">=3.9,<4.0"
dependencies = ["grpcio==1.75.1", "protobuf==6.32.1"]
dependencies = ["grpcio>=1.76", "protobuf>=6.33,<7"]

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

[tool.hatch.build.targets.wheel]
packages = ["pyln"]
Expand Down
155 changes: 0 additions & 155 deletions contrib/pyln-grpc-proto/uv.lock

This file was deleted.

2 changes: 1 addition & 1 deletion contrib/pyln-testing/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ dependencies = [
dev = ["pyln-client", "pyln-grpc-proto"]

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

[tool.hatch.build.targets.wheel]
packages = ["pyln"]
Expand Down
7 changes: 3 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,9 @@ requires-python = ">=3.9.2,<4.0"
dependencies = [
"Mako>=1.1.6",
"websocket-client>=1.2.3",
"grpcio-tools==1.75.1",
"grpcio==1.75.1",
# We want a specific version of protobuf to match CI's .github/scripts/setup.sh
"protobuf==6.32.1",
"grpcio-tools>=1.76",
"grpcio>=1.76",
"protobuf>=6.33,<7",
"cryptography>=46",
"pyln-client",
"pyln-proto",
Expand Down
289 changes: 145 additions & 144 deletions uv.lock

Large diffs are not rendered by default.

Loading