This repository has been archived by the owner on Oct 19, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (52 loc) · 2.17 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
VIRTUALENV = virtualenv --python=python3
VENV := $(shell echo $${VIRTUAL_ENV-.venv})
PYTHON = $(VENV)/bin/python
TOX = $(VENV)/bin/tox
TEMPDIR := $(shell mktemp -d)
DEV_STAMP = $(VENV)/.dev_env_installed.stamp
INSTALL_STAMP = $(VENV)/.install.stamp
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 " 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 "Check the Makefile to know exactly what each target is doing."
install: $(INSTALL_STAMP)
$(INSTALL_STAMP): $(PYTHON) setup.py
$(VENV)/bin/pip install -U pip
$(VENV)/bin/pip install -Ue .
touch $(INSTALL_STAMP)
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 .
$(TEMPDIR)/bin/pip freeze | grep -v -- '^-e' > requirements.txt
tox: $(TOX)
$(TOX): virtualenv
$(VENV)/bin/pip install tox
tests: tox
$(VENV)/bin/tox
tests-once: install-dev
$(VENV)/bin/py.test --cov-report term-missing --cov-fail-under 100 --cov kinto_megaphone/
flake8: install-dev
$(VENV)/bin/flake8 \kinto_megaphone/
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/