Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Makefile: generate and install requirements.txt files for Python plugins #7864

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
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
3 changes: 2 additions & 1 deletion .github/workflows/macos.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 [email protected] 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==2.0.0 wheel pip mako
python3.10 -m poetry install
python3.10 -m poetry self add poetry-plugin-export

- name: Build and install CLN
run: |
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions plugins/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ cln-askrene
recklessrpc
exposesecret
cln-xpay
wss-proxy-requirements.txt
9 changes: 9 additions & 0 deletions plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading