forked from klen/mixer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
65 lines (54 loc) · 1.59 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
VIRTUALENV=$(shell echo "$${VDIR:-'.env'}")
MODULE=mixer
SPHINXBUILD=sphinx-build
ALLSPHINXOPTS= -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
BUILDDIR=_build
all: $(VIRTUALENV)
$(VIRTUALENV): requirements.txt
@virtualenv --no-site-packages $(VIRTUALENV)
@$(VIRTUALENV)/bin/pip install -M -r requirements.txt
touch $(VIRTUALENV)
.PHONY: help
# target: help - Display callable targets
help:
@egrep "^# target:" [Mm]akefile
.PHONY: clean
# target: clean - Clean repo
clean:
@rm -rf build dist docs/_build
find $(CURDIR)/$(MODULE) -name "*.pyc" -delete
find $(CURDIR)/$(MODULE) -name "*.orig" -delete
find $(CURDIR)/$(MODULE) -name "__pycache__" -delete
.PHONY: register
# target: register - Register module on PyPi
register:
@python setup.py register
.PHONY: upload
# target: upload - Upload module on PyPi
upload: docs
@git push --all
@git push --tags
@python setup.py sdist upload || echo 'Already uploaded'
@python setup.py bdist_wheel upload || echo 'Already uploaded'
.PHONY: t
# target: t - Runs tests
t: clean
$(VIRTUALENV)/bin/pip install -r requirements-tests.txt
$(VIRTUALENV)/bin/py.test $(TEST) -s
# @python setup.py test
.PHONY: audit
# target: audit - Audit code
audit:
@pylama $(MODULE) -i E501
.PHONY: docs
# target: docs - Compile the docs
docs: docs
python setup.py build_sphinx --source-dir=docs/ --build-dir=docs/_build --all-files
# python setup.py upload_sphinx --upload-dir=docs/_build/html
.PHONY: serve
# target: serve - Run HTTP server with compiled docs
serve:
pyserve docs/_build/html/
.PHONY: pep8
pep8:
find $(MODULE) -name "*.py" | xargs -n 1 autopep8 -i