-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathMakefile
81 lines (69 loc) · 2.29 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
78
79
80
81
# Makefile for the pip accelerator.
#
# Author: Peter Odding <[email protected]>
# Last Change: January 17, 2016
# URL: https://github.com/paylogic/pip-accel
WORKON_HOME ?= $(HOME)/.virtualenvs
VIRTUAL_ENV ?= $(WORKON_HOME)/pip-accel
PATH := $(VIRTUAL_ENV)/bin:$(PATH)
SHELL = /bin/bash
default:
@echo 'Makefile for the pip accelerator'
@echo
@echo 'Usage:'
@echo
@echo ' make install install the package in a virtual environment'
@echo ' make reset recreate the virtual environment'
@echo ' make test run the tests and collect coverage'
@echo ' make check check the coding style'
@echo ' make docs update documentation using Sphinx'
@echo ' make publish publish changes to GitHub/PyPI'
@echo ' make clean cleanup all temporary files'
@echo
install:
test -d "$(VIRTUAL_ENV)" || mkdir -p "$(VIRTUAL_ENV)"
test -x "$(VIRTUAL_ENV)/bin/python" || virtualenv "$(VIRTUAL_ENV)"
test -x "$(VIRTUAL_ENV)/bin/pip" || easy_install pip
pip uninstall --yes --quiet pip-accel &>/dev/null || true
pip install --quiet --editable .
pip-accel install --quiet --requirement=requirements-testing.txt
reset:
rm -Rf "$(VIRTUAL_ENV)"
make --no-print-directory clean install
test: install
scripts/prepare-test-environment.sh
scripts/collect-test-coverage.sh
coverage html
tox: install
(test -x "$(VIRTUAL_ENV)/bin/tox" \
|| pip-accel install --quiet tox) \
&& tox
detox: install
(test -x "$(VIRTUAL_ENV)/bin/detox" \
|| pip-accel install --quiet detox) \
&& COVERAGE=no detox
check: install
(test -x "$(VIRTUAL_ENV)/bin/flake8" \
|| pip-accel install --quiet --requirement requirements-flake8.txt) \
&& flake8
docs: install
test -x "$(VIRTUAL_ENV)/bin/sphinx-build" || pip-accel install --quiet sphinx
cd docs && sphinx-build -b html -d build/doctrees . build/html
publish: install
git push origin && git push --tags origin
test -x "$(VIRTUAL_ENV)/bin/twine" || pip-accel install --quiet twine
make clean && python setup.py sdist && twine upload dist/*
clean:
rm -Rf \
*.egg \
.cache/ \
.coverage \
.coverage.* \
.tox/ \
build/ \
dist/ \
docs/build/ \
htmlcov/
find -name __pycache__ -exec rm -Rf {} \; &>/dev/null || true
find -type f -name '*.py[co]' -delete
.PHONY: default install reset test tox detox check docs publish clean