From 2740f2eccbe0d53f9fc572c09537b6f2d38c8edd Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Fri, 25 Sep 2020 12:34:37 +0200 Subject: [PATCH] pyln: Use pyln-client Makefile for checks Kinda uses an antipattern of `cd`ing into the directory and calling `make` there, but this keeps the contrib dirs self-contained so we can split them out eventually. --- Makefile | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 4d4199652..d1e386038 100644 --- a/Makefile +++ b/Makefile @@ -386,14 +386,20 @@ check-spelling: PYSRC=$(shell git ls-files "*.py" | grep -v /text.py) contrib/pylightning/lightning-pay -check-python: +# Some tests in pyln will need to find lightningd to run, so have a PATH that +# allows it to find that +PYLN_PATH=$(shell pwd)/lightningd:$(PATH) +check-pyln-%: $(BIN_PROGRAMS) + @(cd contrib/$(shell echo $@ | cut -b 7-) && PATH=$(PYLN_PATH) PYTHONPATH=$(PYTHONPATH) $(MAKE) check) + +check-python: check-pyln-client @# E501 line too long (N > 79 characters) @# E731 do not assign a lambda expression, use a def @# W503: line break before binary operator @flake8 --ignore=E501,E731,W503 ${PYSRC} - PYTHONPATH=contrib/pyln-client:$$PYTHONPATH $(PYTEST) contrib/pyln-client/ - PYTHONPATH=contrib/pyln-proto:$$PYTHONPATH $(PYTEST) contrib/pyln-proto/ + PYTHONPATH=$(PYTHONPATH) $(PYTEST) contrib/pyln-testing/tests/ + PYTHONPATH=$(PYTHONPATH) $(PYTEST) contrib/pyln-proto/tests/ check-includes: @tools/check-includes.sh