-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
61 lines (47 loc) · 1.5 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
HERE = $(shell pwd)
VENV = $(HERE)/venv
BIN = $(VENV)/bin
PYTHON = $(BIN)/python
PIP = $(BIN)/pip
INSTALL = $(PIP) install
SPHINX_BUILDDIR = docs/_build
INSTALL_STAMP = $(VENV)/.install.stamp
.PHONY: all build test run clean docs pypi testpypi pypi-register testpypi-register
all: build test
build: $(VENV)/COMPLETE
$(VENV)/COMPLETE: requirements.txt
virtualenv --no-site-packages --python=`which python` \
--distribute $(VENV)
$(INSTALL) -r requirements.txt
$(PYTHON) setup.py develop
touch $(VENV)/COMPLETE
test:
$(INSTALL) -r test-requirements.txt
tox
run:
$(BIN)/demo
clean:
rm -rf venv *egg* dist ./docs/_build .tox
find . -name '*.pyc' -delete
find . -name '__pycache__' -type d -exec rm -fr {} \;
docs:
$(VENV)/bin/sphinx-build -b html -d $(SPHINX_BUILDDIR)/doctrees docs $(SPHINX_BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(SPHINX_BUILDDIR)/html/index.html"
#---------------------------------------
# for dev branch only
#---------------------------------------
# Create dist, egg dirs, upload package to pypi
pypi:
$(PYTHON) setup.py sdist upload -r pypi
$(PYTHON) setup.py bdist_egg upload -r pypi
# Create dist, egg dirs, upload package to testpypi
testpypi:
$(PYTHON) setup.py sdist upload -r testpypi
$(PYTHON) setup.py bdist_egg upload -r testpypi
# Register this project to Python Package Index
pypi-register:
$(PYTHON) setup.py register -r pypi
# Register this project to Test Python Package Index
testpypi-register:
$(PYTHON) setup.py register -r testpypi