-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
41 lines (32 loc) · 1.11 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
WITH_ENV = env `cat .env 2>/dev/null | xargs`
COMMANDS = help clean compile-deps pip lint unittest apitest docs
.PHONY: $(COMMANDS)
help:
@echo "commands: $(COMMANDS)"
clean:
@find . -name '*.pyc' -type f -delete
@find . -name '__pycache__' -type d -delete
@find . -type d -empty -delete
@rm -rf build dist htmlcov
@rm -rf .cache
compile-deps:
@pip-compile --output-file requirements/base.txt requirements/base.in
@pip-compile --output-file requirements/dev.txt requirements/dev.in
@pip-compile --output-file requirements/testing.txt requirements/testing.in
pip:
@[ -n "$(VIRTUAL_ENV)" ] || (echo 'out of virtualenv'; exit 1)
@pip install -U pip setuptools
@pip install -r requirements/base.txt
@pip install -r requirements/dev.txt
@pip install -r requirements/testing.txt
lint:
@echo "[\033[94mlint\033[0m] basic"
@$(WITH_ENV) flake8 --immediate
@echo "[\033[94mlint\033[0m] complexity (warning only)"
@$(WITH_ENV) flake8 --immediate --max-complexity=12 saturn || true
unittest:
@$(WITH_ENV) py.test tests/unittests
apitest:
@$(WITH_ENV) py.test tests/apitests
docs:
@$(WITH_ENV) $(MAKE) -C docs html