-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
86 lines (68 loc) · 2.03 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
VENV = venv
all: help
venv:
python3 -m venv $(VENV)
$(VENV)/bin/pip install --upgrade pip
rmenv:
rm -rf $(VENV)
db-init: venv
$(VENV)/bin/unsafe-initdb
db-reset:
$(VENV)/bin/unsafe-initdb --reset
db-clean:
rm -rf *.db
bdist build check develop install sdist: venv
$(VENV)/bin/python setup.py $@
# Install extras (se setup.cfg for aliases)
dev docs qa: venv
$(VENV)/bin/python setup.py $@
test:
$(VENV)/bin/pytest
coverage cov:
$(VENV)/bin/pytest --cov
run run-dev:
$(VENV)/bin/unsafe --reload development.ini
run-prod:
$(VENV)/bin/unsafe production.ini
evil:
$(VENV)/bin/python -m http.server --bind 127.0.0.1 --directory evil-site
clean:
rm -rf build .coverage dist .eggs .pytest_cache .pytype .mypy_cache test*.db sessions.db *.log
find . -name __pycache__ -delete
reallyclean: clean db-clean
distclean: reallyclean rmenv
rm -rf *.egg-info
help:
@echo "Setup:"
@echo " > make dev"
@echo
@echo "Run:"
@echo " > make run"
@echo
@echo "Setup targets:"
@echo " dev install extras for development"
@echo " docs install extras for documentation"
@echo " qa install extras for quality assurance"
@echo " venv create virtual environment and upgrade pip"
@echo
@echo "Test targets:"
@echo " cov, coverage run unit tests with coverage"
@echo " test run unit tests"
@echo
@echo "Database targets:"
@echo " db-clean remove database files"
@echo " db-init create and initialize database if it does not exist"
@echo " db-reset recreate database from scratch"
@echo
@echo "Running:"
@echo " run, run-dev run with development.ini (or make run)"
@echo " run-prod run with production.ini"
@echo
@echo "Cleaning:"
@echo " clean remove build files and temporary data"
@echo " reallyclean clean + db-clean"
@echo " distclean remove everything not part of the distribution"
@echo " rmenv remove virtual environment"
@echo
@echo "Setuptools commands:"
@echo " bdist, build, check, develop, install, sdist"