From 9349bed631a76e0f892eb90069a4b90810cc7679 Mon Sep 17 00:00:00 2001 From: Storm Knight Date: Sat, 28 Mar 2026 09:49:35 -0400 Subject: [PATCH] py: add pyln-grpc-proto to PyPI publishing CI (fixes #7929) Add pyln-grpc-proto to the pypi.yml publish matrix and create a dedicated update-pyln-grpc-version Makefile target that handles the package's non-standard directory layout (pyln/grpc/ instead of pyln/grpc-proto/) and strips the v-prefix from version tags. Also syncs the stale __version__ in pyln/grpc/__init__.py to match pyproject.toml. --- .github/workflows/pypi.yml | 2 ++ Makefile | 16 +++++++++++++--- contrib/pyln-grpc-proto/pyln/grpc/__init__.py | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index 7008297bb178..0ae1ea587db2 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -28,6 +28,8 @@ jobs: WORKDIR: contrib/pyln-testing - PACKAGE: pyln-proto WORKDIR: contrib/pyln-proto + - PACKAGE: pyln-grpc-proto + WORKDIR: contrib/pyln-grpc-proto steps: - name: Checkout repository uses: actions/checkout@v4 diff --git a/Makefile b/Makefile index fb9bd9110205..2fac21880d7b 100644 --- a/Makefile +++ b/Makefile @@ -848,13 +848,23 @@ PYLNS=client proto testing update-versions: update-pyln-versions update-reckless-version update-dot-version # FIXME: update-doc-examples @uv lock -update-pyln-versions: $(PYLNS:%=update-pyln-version-%) +update-pyln-versions: $(PYLNS:%=update-pyln-version-%) update-pyln-grpc-version update-pyln-version-%: @if [ -z "$(NEW_VERSION)" ]; then echo "Set NEW_VERSION!" >&2; exit 1; fi @echo "Updating contrib/pyln-$* to $(NEW_VERSION)" - @$(SED) -i.bak 's/^version = .*/version = "$(NEW_VERSION)"/' contrib/pyln-$*/pyproject.toml && rm contrib/pyln-$*/pyproject.toml.bak - @$(SED) -i.bak 's/^__version__ = .*/__version__ = "$(NEW_VERSION)"/' contrib/pyln-$*/pyln/$*/__init__.py && rm contrib/pyln-$*/pyln/$*/__init__.py.bak + @$(SED) -i.bak 's/^version = .*/version = "$(NEW_VERSION)"' contrib/pyln-$*/pyproject.toml && rm contrib/pyln-$*/pyproject.toml.bak + @$(SED) -i.bak 's/^__version__ = .*/__version__ = "$(NEW_VERSION)"' contrib/pyln-$*/pyln/$*/__init__.py && rm contrib/pyln-$*/pyln/$*/__init__.py.bak + +# pyln-grpc-proto uses a different directory layout (pyln/grpc/ not +# pyln/grpc-proto/) and publishes versions without the 'v' prefix on +# PyPI, so it needs its own update target. +update-pyln-grpc-version: + @if [ -z "$(NEW_VERSION)" ]; then echo "Set NEW_VERSION!" >&2; exit 1; fi + @GRPC_VERSION=$$(echo "$(NEW_VERSION)" | $(SED) 's/^v//'); \ + echo "Updating contrib/pyln-grpc-proto to $$GRPC_VERSION"; \ + $(SED) -i.bak 's/^version = .*/version = "'$$GRPC_VERSION'"/' contrib/pyln-grpc-proto/pyproject.toml && rm contrib/pyln-grpc-proto/pyproject.toml.bak; \ + $(SED) -i.bak 's/^__version__ = .*/__version__ = "'$$GRPC_VERSION'"/' contrib/pyln-grpc-proto/pyln/grpc/__init__.py && rm contrib/pyln-grpc-proto/pyln/grpc/__init__.py.bak pyln-release: $(PYLNS:%=pyln-release-%) diff --git a/contrib/pyln-grpc-proto/pyln/grpc/__init__.py b/contrib/pyln-grpc-proto/pyln/grpc/__init__.py index bd5a501f19a8..e54b116a20bb 100644 --- a/contrib/pyln-grpc-proto/pyln/grpc/__init__.py +++ b/contrib/pyln-grpc-proto/pyln/grpc/__init__.py @@ -1,4 +1,4 @@ from pyln.grpc.primitives_pb2 import * # noqa: F401,F403 from pyln.grpc.node_pb2 import * # noqa: F401,F403 from pyln.grpc.node_pb2_grpc import * # noqa: F401,F403 -__version__ = "0.1.1" +__version__ = "25.09"