-
Notifications
You must be signed in to change notification settings - Fork 9
/
Makefile
64 lines (48 loc) · 1.16 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
COVERAGE_MIN = 50
env:
@python3 -m venv env
####################
# run local server
####################
server:
@FLASK_APP=run.py flask run
server-debug:
@$(shell FLASK_DEBUG=1 make server)
server-docker:
@FLASK_APP=run.py flask run --host 0.0.0.0
####################
# dependencies
####################
deps:
@pip install -r requirements.txt
@pre-commit install
deps-update:
@pip install -r requirements-to-freeze.txt --upgrade
@pip freeze > requirements.txt
deps-uninstall:
@pip uninstall -yr requirements.txt
@pip freeze > requirements.txt
####################
# lint
####################
lint:
@pre-commit run \
--allow-unstaged-config \
--all-files \
--verbose
autopep8:
@autopep8 . --recursive --in-place --pep8-passes 2000 --verbose
autopep8-stats:
@pep8 --quiet --statistics .
####################
# tests
####################
test: config/testing.py
@pytest --cov-fail-under $(COVERAGE_MIN) --cov=app --cov-report html:htmlcov
test-debug:
@pytest --pdb
test-deploy:
@http-prompt $(shell cd terraform && terraform output api_url)
clean:
@find . -name '__pycache__' | xargs rm -rf
.PHONY: deps* lint test* clean autopep8* migrate server*