Skip to content

Commit

Permalink
pyln: Add missing upgrade-version target to pyln-grpc
Browse files Browse the repository at this point in the history
  • Loading branch information
cdecker committed Oct 26, 2023
1 parent b7d286c commit 0ef1166
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions contrib/pyln-grpc-proto/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#!/usr/bin/make
PKG=grpc
VERSION := $(shell poetry version -s)

PROTOS = \
pyln/grpc/node_pb2.py \
pyln/grpc/node_pb2_grpc.py \
Expand Down Expand Up @@ -28,3 +32,10 @@ ${PROTOS} &: ${PROTOSRC}
# the references between the generated sources
sed -i 's/import primitives_pb2 as primitives__pb2/from pyln.grpc import primitives_pb2 as primitives__pb2/g' pyln/grpc/node_pb2.py
sed -i 's/import node_pb2 as node__pb2/from pyln.grpc import node_pb2 as node__pb2/g' pyln/grpc/node_pb2_grpc.py

# Having versions in two places sucks, but so does every other option :(
# See https://github.com/python-poetry/poetry/issues/144
upgrade-version:
if [ -z "$(NEW_VERSION)" ]; then echo "Set NEW_VERSION!" >&2; exit 1; fi
poetry version $(NEW_VERSION)
sed 's/^__version__ = .*/__version__ = "$(NEW_VERSION)"/' < pyln/$(PKG)/__init__.py > pyln/$(PKG)/__init__.py.new && mv pyln/$(PKG)/__init__.py.new pyln/$(PKG)/__init__.py
1 change: 1 addition & 0 deletions contrib/pyln-grpc-proto/pyln/grpc/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +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"

0 comments on commit 0ef1166

Please sign in to comment.