-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
77 lines (61 loc) · 2.54 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
VIRTUALENV = virtualenv --python=python3
VENV := $(shell echo $${VIRTUAL_ENV-.venv})
PYTHON = $(VENV)/bin/python
DEV_STAMP = $(VENV)/.dev_env_installed.stamp
INSTALL_STAMP = $(VENV)/.install.stamp
TEMPDIR := $(shell mktemp -d)
.IGNORE: clean distclean maintainer-clean
.PHONY: all install virtualenv tests
OBJECTS = .venv .coverage
help:
@echo "Please use 'make <target>' where <target> is one of"
@echo " install install dependencies and prepare environment"
@echo " install-dev install dependencies and everything needed to run tests"
@echo " build-requirements install all requirements and freeze them in requirements.txt"
@echo " serve start the kinto server on default port"
@echo " migrate run the kinto migrations"
@echo " tests-once only run the tests once with the default python interpreter"
@echo " flake8 run the flake8 linter"
@echo " tests run all the tests with all the supported python interpreters (same as travis)"
@echo " clean remove *.pyc files and __pycache__ directory"
@echo " distclean remove *.egg-info files and *.egg, build and dist directories"
@echo " maintainer-clean remove the .tox and the .venv directories"
@echo " docs build the docs"
@echo "Check the Makefile to know exactly what each target is doing."
all: install
install: $(INSTALL_STAMP)
$(INSTALL_STAMP): $(PYTHON) setup.py
$(VENV)/bin/pip install -U pip
$(VENV)/bin/pip install -Ue .
touch $(INSTALL_STAMP)
install-postgres: $(INSTALL_STAMP) $(DEV_STAMP)
$(VENV)/bin/pip install -Ue ".[postgresql]"
install-dev: $(INSTALL_STAMP) $(DEV_STAMP)
$(DEV_STAMP): $(PYTHON) dev-requirements.txt
$(VENV)/bin/pip install -Ur dev-requirements.txt
touch $(DEV_STAMP)
virtualenv: $(PYTHON)
$(PYTHON):
$(VIRTUALENV) $(VENV)
build-requirements:
$(VIRTUALENV) $(TEMPDIR)
$(TEMPDIR)/bin/pip install -U pip
$(TEMPDIR)/bin/pip install -Ue ".[postgresql]"
$(TEMPDIR)/bin/pip freeze > requirements.txt
serve: install-dev migrate
$(VENV)/bin/python manage.py runserver
migrate: install
$(VENV)/bin/python manage.py migrate
tests-once: install-dev
$(VENV)/bin/python manage.py test
flake8: install-dev
$(VENV)/bin/flake8 laboite_erp
tests:
$(VENV)/bin/tox
clean:
find . -name '*.pyc' -delete
find . -name '__pycache__' -type d | xargs rm -fr
distclean: clean
rm -fr *.egg *.egg-info/ dist/ build/
maintainer-clean: distclean
rm -fr .venv/ .tox/