-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
97 lines (77 loc) · 3.07 KB
/
Makefile
File metadata and controls
97 lines (77 loc) · 3.07 KB
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
86
87
88
89
90
91
92
93
94
95
96
97
BUILDDIR ?= _build
PORT ?= 8000
SPHINXOPTS =
.PHONY: clean clean-build clean-docs clean-pyc clean-test coverage coverage-html develop apidoc \
docs isort open-docs serve-docs test test-all test-upload upload
help:
@echo "Please use 'make <target>' where <target> is one of"
@echo " clean to remove all build, test, coverage and Python artifacts"
@echo " clean-build to remove build artifacts"
@echo " clean-docs to remove documentation artifacts"
@echo " clean-pyc to remove Python file artifacts"
@echo " clean-test to remove test and coverage artifacts"
@echo " coverage to generate a coverage report with the default Python"
@echo " coverage-html to generate and open a HTML coverage report with the default Python"
@echo " develop to install (or update) all packages required for development"
@echo " dist to package a release"
@echo " apidoc to create automodule directives for the project documentation"
@echo " docs to build the project documentation as HTML"
@echo " isort to run isort on the whole project"
@echo " open-docs to open the project documentation in the default browser"
@echo " serve-docs to serve the project documentation in the default browser"
@echo " test to run unit tests quickly with the default Python"
@echo " test-all to run unit tests on every Python version with tox"
@echo " test-upload to upload a release to test PyPI using twine"
@echo " upload to upload a release using twine"
clean: clean-build clean-docs clean-pyc clean-test
clean-docs:
$(MAKE) -C docs clean BUILDDIR=$(BUILDDIR)
clean-build:
rm -fr build/
rm -fr dist/
rm -fr *.egg-info
clean-pyc:
find . -name '*.pyc' -exec rm -f {} +
find . -name '*.pyo' -exec rm -f {} +
find . -name '*~' -exec rm -f {} +
find . -name '__pycache__' -exec rm -fr {} +
clean-test:
rm -fr .cache/
rm -fr .tox/
coverage erase
rm -fr htmlcov/
coverage:
coverage run -m pytest tests/
coverage report
coverage-html: coverage
coverage html
python -c "import os, webbrowser; webbrowser.open('file://%s/htmlcov/index.html' % os.getcwd())"
develop:
pip install -U pip setuptools wheel
pip install -U -r requirements/dev.txt
pip install -U -e .[docs]
pip install -U -e .[tests]
dist: clean
python setup.py sdist bdist_wheel
ls -l dist
apidoc:
sphinx-apidoc -f -o docs/ durga
docs:
$(MAKE) -C docs html BUILDDIR=$(BUILDDIR) SPHINXOPTS='$(SPHINXOPTS)'
isort:
isort --recursive setup.py durga tests
open-docs:
python -c "import os, webbrowser; webbrowser.open('file://{}/docs/{}/html/index.html'.format(os.getcwd(), '$(BUILDDIR)'))"
serve-docs:
python -c "import webbrowser; webbrowser.open('http://127.0.0.1:$(PORT)')"
cd docs/$(BUILDDIR)/html; python -m SimpleHTTPServer $(PORT)
test:
py.test $(TEST_ARGS)
test-all:
tox
test-upload:
twine upload -r test -s dist/*
python -c "import webbrowser; webbrowser.open('https://testpypi.python.org/pypi/durga')"
upload:
twine upload -s dist/*
python -c "import webbrowser; webbrowser.open('https://pypi.python.org/pypi/durga')"