-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
49 lines (41 loc) · 1.31 KB
/
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
37
38
39
40
41
42
43
44
45
46
47
48
49
LINE_WIDTH=129
NAME := $(shell python setup.py --name)
UNAME := $(shell uname -s)
ISORT_FLAGS=--line-width=${LINE_WIDTH} --profile black
FLAKE_FLAGS=--remove-unused-variables --ignore-init-module-imports --recursive
# "" is for multi-lang strings (comments, logs), '' is for everything else.
BLACK_FLAGS=--skip-string-normalization --line-length=${LINE_WIDTH}
PYTEST_FLAGS=-p no:warnings
export FLASK_APP=patronus.tdk.rise
install:
pip install -e '.[all]'
setup-pre-commit:
pip install -q pre-commit
pre-commit install
# To check whole pipeline.
pre-commit run --all-files
format:
isort ${ISORT_FLAGS} --check-only --diff ${NAME} patronus test
black ${BLACK_FLAGS} --check --diff ${NAME} patronus test
autoflake ${FLAKE_FLAGS} --in-place ${NAME} patronus test
format-fix:
isort ${ISORT_FLAGS} ${NAME} patronus test
black ${BLACK_FLAGS} ${NAME} patronus test
autoflake ${FLAKE_FLAGS} ${NAME} patronus test
run:
flask run --host=0.0.0.0 --port=7777
test:
pytest test ${PYTEST_FLAGS} --testmon --suppress-no-test-exit-code
test-all:
pytest test ${PYTEST_FLAGS}
clean:
rm -rf .ipynb_checkpoints
rm -rf **/.ipynb_checkpoints
rm -rf .pytest_cache
rm -rf build
rm -rf dist
rm -rf downloads
rm -rf wandb
find . -name ".DS_Store" -print -delete
rm -rf .cache
pyclean .