This repository has been archived by the owner on Nov 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
155 lines (134 loc) · 6.15 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
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
VENV=$(shell echo "$${VDIR:-'.env'}")
MODULE=pylama_pylint
SPHINXBUILD=sphinx-build
ALLSPHINXOPTS= -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
BUILDDIR=_build
all: $(VENV)
$(VENV): requirements.txt
@[ -d $(VENV) ] || virtualenv --no-site-packages $(VENV)
@$(VENV)/bin/pip install -r requirements.txt
.PHONY: help
# target: help - Display callable targets
help:
@egrep "^# target:" [Mm]akefile
.PHONY: clean
# target: clean - Display callable targets
clean:
@rm -rf build dist docs/_build
@find $(CURDIR) -name "*.orig" -delete
@find $(CURDIR) -name "*.pyc" -delete
# ==============
# 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
.PHONY: major
major:
make release VERSION=major
# ===============
# Build package
# ===============
.PHONY: register
# target: register - Register module on PyPi
register:
@python setup.py register
.PHONY: upload
# target: upload - Upload module on PyPi
upload:
@pip install twine wheel
@python setup.py sdist bdist_wheel
@twine upload dist/*.tar.gz || true
@twine upload dist/*.whl || true
# =============
# Development
# =============
.PHONY: t
# target: t - Runs tests
t: clean $(VENV)
@$(VENV)/bin/python setup.py test
.PHONY: audit
# target: audit - Audit code
audit:
@pylama $(MODULE) -i E501
.PHONY: doc
doc: 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: pep8
pep8:
find $(MODULE) -name "*.py" | xargs -n 1 autopep8 -i
$(CURDIR)/libs/astroid:
@mkdir -p libs
@hg clone https://bitbucket.org/logilab/astroid libs/astroid
$(CURDIR)/libs/logilab-common:
@mkdir -p libs
@hg clone https://bitbucket.org/logilab/logilab-common libs/logilab-common
$(CURDIR)/libs/pylint:
@mkdir -p libs
@hg clone https://bitbucket.org/logilab/pylint libs/pylint
.PHONY: libs
libs: $(CURDIR)/libs/astroid $(CURDIR)/libs/logilab-common $(CURDIR)/libs/pylint
@rm -rf $(CURDIR)/pylama_pylint/astroid $(CURDIR)/pylama_pylint/pylint $(CURDIR)/pylama_pylint/logilab
# Pylint
@mkdir -p $(CURDIR)/pylama_pylint/pylint
@cp -rf $(CURDIR)/libs/pylint/pylint/__init__.py $(CURDIR)/pylama_pylint/pylint/.
@cp -rf $(CURDIR)/libs/pylint/pylint/__pkginfo__.py $(CURDIR)/pylama_pylint/pylint/.
@cp -rf $(CURDIR)/libs/pylint/pylint/checkers $(CURDIR)/pylama_pylint/pylint/.
@cp -rf $(CURDIR)/libs/pylint/pylint/config.py $(CURDIR)/pylama_pylint/pylint/.
@cp -rf $(CURDIR)/libs/pylint/pylint/interfaces.py $(CURDIR)/pylama_pylint/pylint/.
@cp -rf $(CURDIR)/libs/pylint/pylint/lint.py $(CURDIR)/pylama_pylint/pylint/.
@cp -rf $(CURDIR)/libs/pylint/pylint/reporters $(CURDIR)/pylama_pylint/pylint/.
@cp -rf $(CURDIR)/libs/pylint/pylint/utils.py $(CURDIR)/pylama_pylint/pylint/.
# Astroid
@mkdir -p $(CURDIR)/pylama_pylint/astroid
@cp -rf $(CURDIR)/libs/astroid/astroid/__init__.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/__pkginfo__.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/exceptions.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/nodes.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/inference.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/raw_building.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/bases.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/node_classes.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/scoped_nodes.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/manager.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/mixins.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/modutils.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/helpers.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/protocols.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/brain $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/builder.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/rebuilder.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/astpeephole.py $(CURDIR)/pylama_pylint/astroid/.
@cp -rf $(CURDIR)/libs/astroid/astroid/objects.py $(CURDIR)/pylama_pylint/astroid/.
# Common
@mkdir -p $(CURDIR)/pylama_pylint/logilab/common
@touch $(CURDIR)/pylama_pylint/logilab/__init__.py
@cp -f $(CURDIR)/libs/logilab-common/__init__.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/__pkginfo__.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/changelog.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/compat.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/configuration.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/decorators.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/deprecation.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/graph.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/interface.py $(CURDIR)/pylama_pylint/logilab/common/
@cp -f $(CURDIR)/libs/logilab-common/modutils.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/optik_ext.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/textutils.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/tree.py $(CURDIR)/pylama_pylint/logilab/common/.
@cp -rf $(CURDIR)/libs/logilab-common/ureports $(CURDIR)/pylama_pylint/logilab/common/.
@cp -f $(CURDIR)/libs/logilab-common/visitor.py $(CURDIR)/pylama_pylint/logilab/common/.