-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (57 loc) · 1.71 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
# Default values for user options
PYTHON ?= python3
PARENT_DIR := $(realpath $(PWD)/..)
.PHONY: default
default: all
.PHONY: help
help:
@echo "= Development ="
@echo "make -- build everything that needs building"
@echo "make test -- run all tests"
@echo "make coverage -- compute test coverage with coverage.py"
@echo "make clean -- Remove runtime generated files."
@echo "make real-clean -- Remove all files not in Git."
@echo
@echo "= Deployment ="
@echo "make run -- run the server in foreground mode"
@echo "make run-uwsgi -- run the app using uwsgi"
.PHONY: clean
clean:
rm -rf ve/ pip-selfcheck.json .tox/
.PHONY: real-clean
real-clean:
git clean -dfx
rm -rf \
src/cipher.session src/duo-client-python src/duo-python \
src/img2pdf src/migrant src/pjpersist src/z3c.insist src/zodb \
src/zope.i18n src/zope.wfmc
ve: setup.py requirements.txt
rm -rf ve/
$(PYTHON) -m venv ve/
ve/bin/pip install --upgrade pip
ve/bin/pip install --upgrade setuptools
ve/bin/pip install -r ./requirements.txt
ve/bin/test:
printf "#!/bin/bash\n$(PWD)/ve/bin/zope-testrunner --test-path $(PWD)/src \$$@\n" > ve/bin/test
chmod 755 ve/bin/test
all: ve ve/bin/test
.PHONY: test
test: ve/bin/test
ve/bin/test -vvc1 --all
.PHONY: coverage
coverage: ve
rm -rf .coverage
ve/bin/coverage run $(PWD)/ve/bin/zope-testrunner --test-path $(PWD)/src --all
ve/bin/coverage xml
ve/bin/coverage html
ve/bin/coverage report -m
.PHONY: run
run: ve
ve/bin/sbx-mocks3-serve -c config/mocks3.cfg
.PHONY: run-uwsgi
run-uwsgi: ve
uwsgi ./config/uwsgi.ini --need-app
.PHONY: pip-compile
pip-compile: ve
ve/bin/pip install pip-tools
ve/bin/pip-compile ./requirements.in --upgrade