-
Notifications
You must be signed in to change notification settings - Fork 22
/
Makefile
36 lines (24 loc) · 924 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /usr/bin/make
PYTHONFILES := $(shell find * ! -path "build/*" ! -path "venv/*" -name '*.py')
POSSIBLE_PYTEST_NAMES=pytest-3 pytest3 pytest
PYTEST := $(shell for p in $(POSSIBLE_PYTEST_NAMES); do if type $$p > /dev/null; then echo $$p; break; fi done)
TEST_DIR=tests
default: check-source check check-quotes
check-pytest-found:
@if [ -z "$(PYTEST)" ]; then echo "Cannot find any pytest: $(POSSIBLE_PYTEST_NAMES)" >&2; exit 1; fi
check: check-pytest-found
$(PYTEST) $(PYTEST_ARGS) $(TEST_DIR)
check-source: check-fmt check-mypy check-internal-tests
check-mypy:
mypy --ignore-missing-imports --disallow-untyped-defs --disallow-incomplete-defs $(PYTHONFILES)
check-internal-tests: check-pytest-found
$(PYTEST) `find lnprototest -name '*.py'`
check-quotes/%: %
tools/check_quotes.py $*
check-quotes: $(PYTHONFILES:%=check-quotes/%)
check-fmt:
black --check .
fmt:
black .
TAGS:
etags `find . -name '*.py'`