forked from klen/pylama
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
120 lines (96 loc) · 2.73 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
MODULE=pylama
SPHINXBUILD=sphinx-build
ALLSPHINXOPTS= -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
BUILDDIR=_build
LIBSDIR=$(CURDIR)/libs
.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 *.egg
@find . -name "*.pyc" -delete
@find . -name "*.orig" -delete
@rm -rf $(CURDIR)/libs
# ==============
# Bump version
# ==============
.PHONY: release
VERSION?=minor
# target: release - Bump version
release:
@pip install bumpversion
@bumpversion $(VERSION)
@git checkout master
@git merge develop
@git checkout develop
@git push --all
@git push --tags
.PHONY: minor
minor: release
.PHONY: patch
patch:
make release VERSION=patch
# ===============
# Build package
# ===============
.PHONY: register
# target: register - Register module on PyPi
register:
python setup.py register
.PHONY: upload
# target: upload - Upload module on PyPi
upload: clean
@git push --all
@git push --tags
@pip install wheel
@python setup.py sdist upload || echo 'Already uploaded'
@python setup.py bdist_wheel upload || echo 'Already uploaded'
# =============
# Development
# =============
.PHONY: t
t:
@py.test -sx tests.py
.PHONY: audit
audit:
python -m "pylama.main"
.PHONY: docs
docs: docs
python setup.py build_sphinx --source-dir=docs/ --build-dir=docs/_build --all-files
.PHONY: libs
libs: pep257 pep8 pyflakes
$(LIBSDIR)/pep8:
mkdir -p $(LIBSDIR)
@git clone https://github.com/jcrocholl/pep8 $(LIBSDIR)/pep8
$(LIBSDIR)/pyflakes:
mkdir -p $(LIBSDIR)
@git clone https://github.com/pyflakes/pyflakes $(LIBSDIR)/pyflakes
$(LIBSDIR)/pep257:
mkdir -p $(LIBSDIR)
@git clone https://github.com/GreenSteam/pep257 $(LIBSDIR)/pep257
$(LIBSDIR)/pies:
mkdir -p $(LIBSDIR)
@git clone https://github.com/timothycrosley/pies $(LIBSDIR)/pies
.PHONY: pep257
pep257: $(LIBSDIR)/pep257
cd $(LIBSDIR)/pep257 && git pull --rebase
cp -f $(LIBSDIR)/pep257/pep257.py $(CURDIR)/pylama/lint/pylama_pep257/.
.PHONY: pep8
pep8: $(LIBSDIR)/pep8
cd $(LIBSDIR)/pep8 && git pull --rebase
cp -f $(LIBSDIR)/pep8/pep8.py $(CURDIR)/pylama/lint/pylama_pep8/.
.PHONY: pyflakes
pyflakes: $(LIBSDIR)/pyflakes
cd $(LIBSDIR)/pyflakes && git pull --rebase
cp -f $(LIBSDIR)/pyflakes/pyflakes/__init__.py $(CURDIR)/pylama/lint/pylama_pyflakes/pyflakes/.
cp -f $(LIBSDIR)/pyflakes/pyflakes/messages.py $(CURDIR)/pylama/lint/pylama_pyflakes/pyflakes/.
cp -f $(LIBSDIR)/pyflakes/pyflakes/checker.py $(CURDIR)/pylama/lint/pylama_pyflakes/pyflakes/.
# $(LIBSDIR)/frosted:
# mkdir -p $(LIBSDIR)
# @git clone https://github.com/timothycrosley/frosted $(LIBSDIR)/frosted
# .PHONY: frosted
# frosted: $(LIBSDIR)/frosted
# cd $(LIBSDIR)/frosted && git pull --rebase