-
Notifications
You must be signed in to change notification settings - Fork 24
/
Makefile
74 lines (54 loc) · 1.91 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
PY_VERSION := 2
WHEEL_DIR := /tmp/wheelhouse
PIP := env/bin/pip
PY := env/bin/python
USE_WHEELS := 0
ifeq ($(USE_WHEELS), 0)
WHEEL_INSTALL_ARGS := # void
else
WHEEL_INSTALL_ARGS := --use-wheel --no-index --find-links=$(WHEEL_DIR)
endif
help:
@echo "COMMANDS:"
@echo " clean Remove all generated files."
@echo " setup Setup development environment."
@echo " shell Open ipython from the development environment."
@echo " test Run tests."
@echo " wheel Build package wheel & save in $(WHEEL_DIR)."
@echo " wheels Build dependency wheels & save in $(WHEEL_DIR)."
@echo " publish Build and upload package to pypi.python.org"
@echo ""
@echo "VARIABLES:"
@echo " PY_VERSION Version of python to use. 2 or 3"
@echo " WHEEL_DIR Where you save your wheels. Default: $(WHEEL_DIR)."
@echo " USE_WHEELS Install packages from wheel dir, off by default."
clean:
rm -rf env
rm -rf build
rm -rf dist
rm -rf *.egg
rm -rf *.egg-info
find | grep -i ".*__pycache__.*$$" | xargs -r -L1 rm -rf
find | grep -i ".*\.pyc$$" | xargs -r -L1 rm
virtualenv: clean
virtualenv -p /usr/bin/python$(PY_VERSION) env
$(PIP) install wheel
wheels: virtualenv
$(PIP) wheel --find-links=$(WHEEL_DIR) --wheel-dir=$(WHEEL_DIR) -r requirements.txt
$(PIP) wheel --find-links=$(WHEEL_DIR) --wheel-dir=$(WHEEL_DIR) -r test_requirements.txt
$(PIP) wheel --find-links=$(WHEEL_DIR) --wheel-dir=$(WHEEL_DIR) -r develop_requirements.txt
wheel: test
$(PY) setup.py bdist_wheel
mv dist/*.whl $(WHEEL_DIR)
setup: virtualenv
$(PIP) install $(WHEEL_INSTALL_ARGS) -r requirements.txt
$(PIP) install $(WHEEL_INSTALL_ARGS) -r test_requirements.txt
$(PIP) install $(WHEEL_INSTALL_ARGS) -r develop_requirements.txt
shell: setup
env/bin/ipython
test: setup
bash run_tests.sh
publish: test
$(PY) setup.py register bdist_wheel upload
# Break in case of bug!
# import pudb; pu.db