1
- .PHONY : build docs
1
+ ² .PHONY : build docs
2
2
3
3
# ==================================================================================================
4
4
# Variables
5
5
# ==================================================================================================
6
6
7
7
MODULES: ={{ cookiecutter.project_slug }}
8
8
PACKAGE_NAME: ={{ cookiecutter.project_slug }}
9
-
9
+ PIP: =/usr/bin/env python3 -m pip
10
+ PIPENV: =/usr/bin/env pipenv
10
11
11
12
# ==================================================================================================
12
13
# do-it-all targets
@@ -22,28 +23,28 @@ dev: ensure-pipenv pipenv-install-dev requirements ln-venv
22
23
# ==================================================================================================
23
24
24
25
ensure-pipenv :
25
- pip3 install --user --upgrade ' pipenv>=9.0' ' pip>=9.0'
26
+ $( PIP ) install --user --upgrade ' pipenv>=9.0' ' pip>=9.0'
26
27
@echo " ensure your local python install is in your PATH"
27
28
28
29
pipenv-install-dev :
29
- pipenv install --dev
30
+ $( PIPENV ) install --dev
30
31
31
32
ln-venv :
32
33
# use that to configure a symbolic link to the virtualenv in .venv
33
34
rm -rf .venv
34
- ln -s $$(pipenv --venv ) .venv
35
+ ln -s $$($( PIPENV ) --venv) .venv
35
36
36
37
.venv : ln-venv
37
38
38
39
install-local : install-local-only-deps install-local-only-curpackage
39
40
40
41
install-local-only-deps :
41
42
# Install only dependencies
42
- pipenv install
43
+ $( PIPENV ) install
43
44
44
45
install-local-only-curpackage :
45
46
# Install current package as well
46
- pipenv run pip install .
47
+ $( PIPENV ) run pip install .
47
48
48
49
49
50
# ==================================================================================================
@@ -53,13 +54,13 @@ install-local-only-curpackage:
53
54
style : isort autopep8 yapf
54
55
55
56
isort :
56
- pipenv run isort -y -rc $(MODULES )
57
+ $( PIPENV ) run isort -y -rc $(MODULES )
57
58
58
59
autopep8 :
59
- pipenv run autopep8 --in-place --recursive setup.py $(MODULES )
60
+ $( PIPENV ) run autopep8 --in-place --recursive setup.py $(MODULES )
60
61
61
62
yapf :
62
- pipenv run yapf --style .yapf --recursive -i $(MODULES )
63
+ $( PIPENV ) run yapf --style .yapf --recursive -i $(MODULES )
63
64
64
65
format : style
65
66
@@ -71,20 +72,20 @@ format: style
71
72
checks : pep508 isort-check flake8 pylint mypy
72
73
73
74
pep508 :
74
- pipenv check
75
+ $( PIPENV ) check
75
76
76
77
isort-check :
77
- pipenv run isort -c -rc $(MODULES )
78
+ $( PIPENV ) run isort -c -rc $(MODULES )
78
79
79
80
flake8 :
80
- pipenv run python setup.py flake8
81
+ $( PIPENV ) run python setup.py flake8
81
82
82
83
pylint :
83
- pipenv run pylint --rcfile=.pylintrc --output-format=colorized $(MODULES )
84
+ $( PIPENV ) run pylint --rcfile=.pylintrc --output-format=colorized $(MODULES )
84
85
85
86
mypy :
86
87
# Static type checker only enabled on methods that uses Python Type Annotations
87
- pipenv run mypy --config-file .mypy.ini $(MODULES )
88
+ $( PIPENV ) run mypy --config-file .mypy.ini $(MODULES )
88
89
89
90
clean-mypy :
90
91
rm -rf .venv .mypy_cache || true
@@ -98,13 +99,13 @@ sct: style check test
98
99
# ==================================================================================================
99
100
100
101
test :
101
- pipenv run pytest $(MODULES )
102
+ $( PIPENV ) run pytest $(MODULES )
102
103
103
104
test-v :
104
- pipenv run pytest -vv $(MODULES )
105
+ $( PIPENV ) run pytest -vv $(MODULES )
105
106
106
107
test-coverage :
107
- pipenv run py.test -v --cov $(PACKAGE_NAME ) --cov-report html:coverage_html --cov-report term $(MODULES )
108
+ $( PIPENV ) run py.test -v --cov $(PACKAGE_NAME ) --cov-report html:coverage_html --cov-report term $(MODULES )
108
109
109
110
110
111
# ==================================================================================================
@@ -116,13 +117,13 @@ dists: requirements sdist bdist wheels
116
117
build : dists
117
118
118
119
sdist :
119
- pipenv run python setup.py sdist
120
+ $( PIPENV ) run python setup.py sdist
120
121
121
122
bdist :
122
- pipenv run python setup.py bdist
123
+ $( PIPENV ) run python setup.py bdist
123
124
124
125
wheel :
125
- pipenv run python setup.py bdist_wheel
126
+ $( PIPENV ) run python setup.py bdist_wheel
126
127
127
128
clean-dist :
128
129
rm -rfv build dist/
@@ -143,29 +144,29 @@ docker:
143
144
# ==================================================================================================
144
145
145
146
shell :
146
- pipenv shell
147
+ $( PIPENV ) shell
147
148
148
149
ctags :
149
150
find -name ' *.py' -exec ctags -a {} \;
150
151
151
152
update : pipenv-update dev
152
153
153
154
pipenv-update :
154
- pipenv update
155
+ $( PIPENV ) update
155
156
156
157
requirements :
157
158
# needed until PBR supports `Pipfile`
158
159
{% if cookiecutter.is_application -%}
159
160
# Freeze requirements for applications
160
- pipenv run pipenv_to_requirements --freeze
161
+ $( PIPENV ) run pipenv_to_requirements --freeze
161
162
{% else -%}
162
- pipenv run pipenv_to_requirements
163
+ $( PIPENV ) run pipenv_to_requirements
163
164
{%- endif %}
164
165
165
166
update-recreate : update style check test
166
167
167
168
lock :
168
- pipenv lock
169
+ $( PIPENV ) lock
169
170
170
171
171
172
githook : style requirements
@@ -178,12 +179,12 @@ githook: style requirements
178
179
tag-pbr :
179
180
@{ \
180
181
set -e ; \
181
- export VERSION=$$(pipenv run python setup.py --version | cut -d. -f1,2,3 ) ; \
182
+ export VERSION=$$($( PIPENV ) run python setup.py --version | cut -d. -f1,2,3) ; \
182
183
echo " I: Computed new version: $$ VERSION" ; \
183
184
echo " I: presse ENTER to accept or type new version number:" ; \
184
185
read VERSION_OVERRIDE; \
185
186
VERSION=$$ {VERSION_OVERRIDE:-$$ VERSION}; \
186
- PROJECTNAME=$$(pipenv run python setup.py --name ) ; \
187
+ PROJECTNAME=$$($( PIPENV ) run python setup.py --name) ; \
187
188
echo " I: Tagging $$ PROJECTNAME in version $$ VERSION with tag: $$ VERSION" ; \
188
189
echo " $$ git tag -s $$ VERSION -m \" $$ PROJECTNAME $$ VERSION\" " ; \
189
190
echo " I: Pushing tag $$ VERSION, press ENTER to continue, C-c to interrupt" ; \
@@ -199,7 +200,7 @@ push: githook
199
200
git push origin --tags
200
201
201
202
publish : clean-dist dists
202
- pipenv run python setup.py sdist bdist_wheel upload -r pypi-test || true
203
+ $( PIPENV ) run python setup.py sdist bdist_wheel upload -r pypi-test || true
203
204
204
205
205
206
@@ -208,7 +209,7 @@ publish: clean-dist dists
208
209
# ==================================================================================================
209
210
210
211
clean : clean-dist clean-docs clean-mypy
211
- pipenv --rm || true
212
+ $( PIPENV ) --rm || true
212
213
find . -name ' __pycache__' -exec rm -rf {} \; || true
213
214
find . -name ' .cache' -exec rm -rf {} \; || true
214
215
find . -name ' *.egg-info' -exec rm -rf {} \; || true
@@ -220,13 +221,13 @@ clean: clean-dist clean-docs clean-mypy
220
221
# ==================================================================================================
221
222
222
223
docs : clean-docs sdist
223
- pipenv run make -C docs/ html
224
+ $( PIPENV ) run make -C docs/ html
224
225
225
226
clean-docs :
226
227
rm -rfv docs/_build
227
228
228
229
docs-apidoc :
229
- pipenv run sphinx-apidoc \
230
+ $( PIPENV ) run sphinx-apidoc \
230
231
-f \
231
232
-o docs/source/reference \
232
233
-e \
@@ -245,7 +246,7 @@ docs-open:
245
246
246
247
run :
247
248
# add you run commands here
248
- # pipenv run ...
249
+ # $(PIPENV) run ...
249
250
250
251
251
252
# ==================================================================================================
0 commit comments