-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (42 loc) · 1.99 KB
/
Makefile
File metadata and controls
75 lines (42 loc) · 1.99 KB
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
APP_NAME = tfj
VENV_PREFIX = $(shell echo $(APP_NAME) | tr [a-z] [A-Z])
VENV_NAME = py36-$(APP_NAME)
VERSION = $(shell python setup.py --version)
PIP = $(WORKON_HOME)/$(VENV_NAME)/bin/pip3
PYTHON = $(WORKON_HOME)/$(VENV_NAME)/bin/python3
VIRTUALENV = $(PYENV_ROOT)/versions/3.6.0/bin/virtualenv
# avoid flake8 default ignore list
LINT_OPTION = --max-line-length 180 --ignore _ --import-order-style=edited --application-package-names=ma --application-import-names=core --exclude=vendors/
init: init-venv update-venv init-runtime
init-dev: init
$(PIP) install -Ur requirements-dev.txt
init-venv:
test -d $(WORKON_HOME)/$(VENV_NAME) || $(VIRTUALENV) $(WORKON_HOME)/$(VENV_NAME)
update-venv:
true || true
deinit:
rm -rf $(WORKON_HOME)/$(VENV_NAME)
rm -rf vendors
lint:
$(WORKON_HOME)/$(VENV_NAME)/bin/flake8 $(LINT_OPTION) .
test: lint
PYTHONPATH=.:vendors $(WORKON_HOME)/$(VENV_NAME)/bin/py.test tests
test-debug: lint
$(WORKON_HOME)/$(VENV_NAME)/bin/py.test --ipdb tests
assets:
true || true
coverage: lint
PYTHONPATH=.:vendors $(WORKON_HOME)/$(VENV_NAME)/bin/py.test --cov . --cov-report term-missing --cov-report xml --junitxml=junit-coverage.xml --cov-config .coveragerc tests
clean:
true || true
init-runtime: ## Initialize application vendors dependencies
mkdir -p vendors && $(PIP) install -t vendors -Ur requirements.txt
build: init-runtime
echo $(VERSION) > VERSION
echo $(VERSION) > latest
test -e dist/$(APP_NAME)-$(VERSION).tar.gz || ($(PYTHON) setup.py sdist)
test -e dist/$(APP_NAME)-$(VERSION).tar.gz || (mv dist/$(APP_NAME)-$(shell python setup.py --version).tar.gz dist/$(APP_NAME)-$(VERSION).tar.gz)
get-artifact-name: ## Return the build artifact filename
echo $(APP_NAME)-$(VERSION).tar.gz
.SILENT: deinit init init-venv update-venv init-dev -prod build distribute run lint test test-debug coverage clean get-artifact-name build
.PHONY: deinit init init-venv update-venv init-dev -prod build distribute run lint test test-debug coverage clean get-artifact-name build