This repository has been archived by the owner on Feb 21, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
85 lines (63 loc) · 2.62 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
82
83
84
85
PYPI_URL = https://pypi.python.org/pypi
tarball = `ls -1rt ./dist/*.tar* | tail -1`
all: flakes smoke README.rst
test: tox-command README.txt
@tox
smoke: develop coverage-command
@coverage erase
@coverage run run_tests.py --failfast
@coverage report --show-missing --include=jeni.py,test_jeni*.py
flakes: pyflakes-command
@pyflakes *.py
dist: README.txt flakes
python setup.py sdist --formats=bztar
@echo
@echo 'Use `make publish` to publish to PyPI.'
@echo
@echo Tarball for manual distribution:
@echo $(tarball)
publish: README.txt flakes
python setup.py sdist --formats=bztar,zip upload -r $(PYPI_URL)
publish-test: README.txt flakes
python setup.py register -r $(PYPI_URL)
python setup.py sdist --formats=bztar,zip upload -r $(PYPI_URL)
# Set a test PYPI_URL for the publish-test target.
publish-test : PYPI_URL = https://testpypi.python.org/pypi
develop: README.txt setup.py
@python setup.py develop
@touch develop
install: README.txt
python setup.py install
clean:
rm -fr __pycache__ build dist .tox *.egg-info
rm -f *.pyc MANIFEST README.txt .coverage .in_virtualenv.py
# README.rst is for repository distribution.
# README.txt is for source distribution.
RST_WARNING = 'DO NOT EDIT THIS FILE. EDIT README.rst.in.' # README.rst warning
README.rst: README.rst.in jeni.py bin/build_rst.py
@RST_WARNING=$(RST_WARNING) python bin/build_rst.py README.rst.in > $@
README.txt: README.rst.in jeni.py bin/build_rst.py
@python bin/build_rst.py README.rst.in > $@
README.html: README.rst rst2html-command
@rst2html README.rst > README.html
tox-command: virtualenv
@which tox >/dev/null 2>&1 || pip install tox
coverage-command: virtualenv
@which coverage >/dev/null 2>&1 || pip install coverage
pyflakes-command: virtualenv
@which pyflakes >/dev/null 2>&1 || pip install pyflakes
rst2html-command: virtualenv
@which rst2html >/dev/null 2>&1 || pip install docutils
virtualenv: .in_virtualenv.py
@python $<
.in_virtualenv.py: Makefile
@echo '# Generated by Makefile, written by rduplain.' > $@
@echo 'import sys' >> $@
@echo 'if hasattr(sys, "real_prefix"):' >> $@
@echo ' sys.exit(0)' >> $@
@echo 'elif getattr(sys, "base_prefix", sys.prefix) != sys.prefix:' >> $@
@echo ' sys.exit(0)' >> $@
@echo 'else:' >> $@
@echo ' sys.stderr.write("Use a virtualenv, 2.7 or 3.3+.\\n")' >> $@
@echo ' sys.exit(1)' >> $@
.PHONY: dist