-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
100 lines (73 loc) · 1.49 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
.PHONY: all default test clean develop lint
SRC=olapy_web
PKG=$(SRC)
all: default
default: test lint
#
# testing
#
test:
pytest . --durations=10
test-with-coverage:
pytest --tb=short --cov $(PKG) --cov-report term-missing .
#
# setup
#
develop:
poetry install
cd front && yarn
#
# Linting
#
lint: lint-python lint-js
lint-python: lint-flake8 lint-mypy
lint-flake8:
@echo "--> Linting Python files (with Flake8)"
flake8 $(SRC)
lint-mypy:
@echo "--> Typechecking Python files"
mypy $(SRC)
lint-pylint:
@echo "Running pylint, some errors reported might be false positives"
-pylint -E --rcfile .pylint.rc $(SRC)
lint-js:
cd front && make lint
#
# Running web server
#
build-js:
cd front && yarn build
run: build-js
flask run
init:
flask initdb
clean:
find . -name "*.pyc" -delete
find . -name .DS_Store -delete
find . -name cache -type d -delete
find . -type d -empty -delete
rm -f migration.log
rm -rf build dist
rm -rf tests/data tests/integration/data
rm -rf tmp tests/tmp tests/integration/tmp
rm -rf cache tests/cache tests/integration/cache
rm -rf *.egg .coverage
rm -rf doc/_build
rm -rf static/gen static/.webassets-cache instance/webassets
rm -rf htmlcov junit-*.xml
rm -rf .mypy_cache
tidy: clean
rm -rf .tox
rm -rf front/dist front/node_modules
format: format-py format-js
format-py:
black $(SRC) tests *.py
isort $(SRC) tests *.py
format-js:
cd front && make format
update-deps:
poetry update
release:
poetry publish --build
doc:
cd docs && make html