From dfb3d3bb1fa8520664ddc24fbcd065c2aa571605 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 6 Feb 2025 14:49:40 +1030 Subject: [PATCH 1/3] ci: install poetry-plugin-export for MacOS so it can create requirements.txt Without this: ``` cd plugins/wss-proxy && poetry export --without-hashes > ../../plugins/wss-proxy-requirements.txt The command "export" does not exist. make: *** [plugins/wss-proxy-requirements.txt] Error 1 ``` Signed-off-by: Rusty Russell --- .github/workflows/macos.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index 37543b064a6e..c383dcd1fa9d 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -30,8 +30,9 @@ jobs: export PATH="/usr/local/opt:/Users/runner/.local/bin:/opt/homebrew/bin/python3.10/bin:$PATH" brew install gnu-sed python@3.10 autoconf automake libtool protobuf - python3.10 -m pip install -U --user poetry==1.8.0 wheel pip mako + python3.10 -m pip install -U --user poetry==1.9.0 wheel pip mako python3.10 -m poetry install + python3.10 -m poetry self add poetry-plugin-export - name: Build and install CLN run: | From 498238b04fe4f7bc6b7644fe8f3f3e1636e54563 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Thu, 6 Feb 2025 14:49:58 +1030 Subject: [PATCH 2/3] Makefile: generate and install requirements.txt files for Python plugins. Doesn't automate the install, but at least provides some tools for users to install the requirements on their systems Changelog-Added: Install: we now supply requirements.txt file for Python plugin (i.e. wss-proxy). See-also: https://github.com/ElementsProject/lightning/issues/7665 Signed-off-by: Rusty Russell --- Makefile | 8 ++++++-- plugins/.gitignore | 1 + plugins/Makefile | 9 +++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fb585396e6c8..b101afedc2ba 100644 --- a/Makefile +++ b/Makefile @@ -812,10 +812,10 @@ installdirs: # $(PLUGINS) is defined in plugins/Makefile. -install-program: installdirs $(BIN_PROGRAMS) $(PKGLIBEXEC_PROGRAMS) $(PLUGINS) $(PY_PLUGINS) +install-program: installdirs $(BIN_PROGRAMS) $(PKGLIBEXEC_PROGRAMS) $(PLUGINS) $(PY_PLUGINS) $(PLUGIN_REQUIREMENTS_TXT) @$(NORMAL_INSTALL) $(INSTALL_PROGRAM) $(BIN_PROGRAMS) $(DESTDIR)$(bindir) - $(INSTALL_PROGRAM) $(PKGLIBEXEC_PROGRAMS) $(DESTDIR)$(pkglibexecdir) + $(INSTALL_PROGRAM) $(PKGLIBEXEC_PROGRAMS) $(PLUGIN_REQUIREMENTS_TXT) $(DESTDIR)$(pkglibexecdir) [ -z "$(PLUGINS)" ] || $(INSTALL_PROGRAM) $(PLUGINS) $(DESTDIR)$(plugindir) for PY in $(PY_PLUGINS); do DIR=`dirname $$PY`; DST=$(DESTDIR)$(plugindir)/`basename $$DIR`; if [ -d $$DST ]; then rm -rf $$DST; fi; $(INSTALL_PROGRAM) -d $$DIR; cp -a $$DIR $$DST ; done @@ -894,6 +894,10 @@ uninstall: $(ECHO) rm -f $(DESTDIR)$(docdir)/`basename $$f`; \ rm -f $(DESTDIR)$(docdir)/`basename $$f`; \ done + @for f in $(PLUGIN_REQUIREMENTS_TXT); do \ + $(ECHO) rm -f $(DESTDIR)$(pkglibexecdir)/`basename $$f`; \ + rm -f $(DESTDIR)$(pkglibexecdir)/`basename $$f`; \ + done installcheck: all-programs @rm -rf testinstall || true diff --git a/plugins/.gitignore b/plugins/.gitignore index ae3fd1fb98c6..58496b3ce311 100644 --- a/plugins/.gitignore +++ b/plugins/.gitignore @@ -20,3 +20,4 @@ cln-askrene recklessrpc exposesecret cln-xpay +wss-proxy-requirements.txt diff --git a/plugins/Makefile b/plugins/Makefile index f7e35e613a51..1a171266d6c5 100644 --- a/plugins/Makefile +++ b/plugins/Makefile @@ -311,8 +311,17 @@ include plugins/rest-plugin/Makefile DEFAULT_TARGETS += $(CLN_PLUGIN_EXAMPLES) plugins/cln-grpc plugins/clnrest endif +ifneq ($(NO_PYTHON), 1) +PLUGIN_REQUIREMENTS_TXT := plugins/wss-proxy-requirements.txt +plugins/wss-proxy-requirements.txt: plugins/wss-proxy/pyproject.toml plugins/wss-proxy/poetry.lock + cd plugins/wss-proxy && poetry export --without-hashes > ../../$@ + +all-programs: $(PLUGIN_REQUIREMENTS_TXT) +endif + clean: plugins-clean plugins-clean: + $(RM) $(PLUGIN_REQUIREMENTS_TXT) $(RM) $(PLUGINS) $(CLN_PLUGIN_EXAMPLES) $(RM) plugins/sql-schema_gen.h From 148e91815fa5d10fe20da40e0c849be7c4926cd1 Mon Sep 17 00:00:00 2001 From: Alex Myers Date: Thu, 13 Feb 2025 20:00:44 -0600 Subject: [PATCH 3/3] CI: testing poetry v2.0.0 on MacOS --- .github/workflows/macos.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/macos.yaml b/.github/workflows/macos.yaml index c383dcd1fa9d..945da91abc80 100644 --- a/.github/workflows/macos.yaml +++ b/.github/workflows/macos.yaml @@ -30,7 +30,7 @@ jobs: export PATH="/usr/local/opt:/Users/runner/.local/bin:/opt/homebrew/bin/python3.10/bin:$PATH" brew install gnu-sed python@3.10 autoconf automake libtool protobuf - python3.10 -m pip install -U --user poetry==1.9.0 wheel pip mako + python3.10 -m pip install -U --user poetry==2.0.0 wheel pip mako python3.10 -m poetry install python3.10 -m poetry self add poetry-plugin-export