-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
38 lines (30 loc) · 1.01 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
WITH_ENV = env `cat .env 2>/dev/null | xargs`
COMMANDS = help clean compile-deps pip lint test 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
@echo "[\033[94mlint\033[0m] complexity (warning only)"
@$(WITH_ENV) flake8 --max-complexity=12 gelyung || true
test:
@$(WITH_ENV) py.test tests
docs:
@$(WITH_ENV) $(MAKE) -C docs html