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 1 commit 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
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -800,10 +800,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 @@ -882,6 +882,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
2 changes: 2 additions & 0 deletions plugins/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ recover
cln-askrene
recklessrpc
exposesecret
clnrest-requirements.txt
wss-proxy-requirements.txt
13 changes: 13 additions & 0 deletions plugins/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -303,8 +303,21 @@ ifneq ($(RUST),0)
DEFAULT_TARGETS += $(CLN_PLUGIN_EXAMPLES) plugins/cln-grpc
endif

ifneq ($(NO_PYTHON), 1)
PLUGIN_REQUIREMENTS_TXT := plugins/wss-proxy-requirements.txt plugins/clnrest-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 > ../../$@


plugins/clnrest-requirements.txt: plugins/clnrest/pyproject.toml plugins/clnrest/poetry.lock
cd plugins/clnrest && 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