Skip to content

Commit c755436

Browse files
committed
Add Makefile for tests, flake8 linting, formatting
1 parent 0d1bea7 commit c755436

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

Makefile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
PY_FILES= find . -type f -not -path '*/\.*' | grep -i '.*[.]py$$' 2> /dev/null
2+
3+
4+
entr_warn:
5+
@echo "----------------------------------------------------------"
6+
@echo " ! File watching functionality non-operational ! "
7+
@echo " "
8+
@echo "Install entr(1) to automatically run tasks on file change."
9+
@echo "See http://entrproject.org/ "
10+
@echo "----------------------------------------------------------"
11+
12+
isort:
13+
isort `${PY_FILES}`
14+
15+
black:
16+
black `${PY_FILES}` --skip-string-normalization
17+
18+
test:
19+
py.test $(test)
20+
21+
watch_test:
22+
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) test; else $(MAKE) test entr_warn; fi
23+
24+
build_docs:
25+
cd doc && $(MAKE) html
26+
27+
watch_docs:
28+
cd doc && $(MAKE) watch_docs
29+
30+
flake8:
31+
flake8 setup.py sample-code qencode tests
32+
33+
watch_flake8:
34+
if command -v entr > /dev/null; then ${PY_FILES} | entr -c $(MAKE) flake8; else $(MAKE) flake8 entr_warn; fi

0 commit comments

Comments
 (0)