@@ -26,20 +26,18 @@ PACKAGE=schema-salad
26
26
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
27
27
# `[[` conditional expressions.
28
28
PYSOURCES =$(wildcard ${MODULE}/** .py ${MODULE}/avro/* .py ${MODULE}/tests/* .py) setup.py
29
- DEVPKGS =diff_cover black pylint coverage pep257 pydocstyle flake8 tox\
29
+ DEVPKGS =diff_cover black pylint pep257 pydocstyle flake8 tox tox-pyenv \
30
30
isort wheel autoflake flake8-bugbear pyupgrade bandit \
31
31
-rtest-requirements.txt -rmypy_requirements.txt
32
- COVBASE =coverage run --branch --append --source=${MODULE} \
33
- --omit=schema_salad/tests/*
32
+ COVBASE =coverage run --append
34
33
35
34
# Updating the Major & Minor version below?
36
35
# Don't forget to update setup.py as well
37
36
VERSION =7.1.$(shell date +% Y% m% d% H% M% S --utc --date=`git log --first-parent \
38
37
--max-count=1 --format=format:% cI`)
39
38
40
39
# # all : default task
41
- all :
42
- pip install -e .
40
+ all : dev
43
41
44
42
# # help : print this help message and exit
45
43
help : Makefile
@@ -48,7 +46,7 @@ help: Makefile
48
46
# # install-dep : install most of the development dependencies via pip
49
47
install-dep : install-dependencies
50
48
51
- install-dependencies :
49
+ install-dependencies : FORCE
52
50
pip install --upgrade $(DEVPKGS )
53
51
pip install -r requirements.txt
54
52
@@ -58,7 +56,7 @@ install: FORCE
58
56
59
57
# # dev : install the ${MODULE} module in dev mode
60
58
dev : install-dep
61
- pip install -e
59
+ pip install -e .
62
60
63
61
# # dist : create a module package for distribution
64
62
dist : dist/${MODULE}-$(VERSION ) .tar.gz
@@ -108,16 +106,15 @@ pylint: $(PYSOURCES)
108
106
pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
109
107
$^ -j0|| true
110
108
111
- pylint_report.txt : ${ PYSOURCES}
109
+ pylint_report.txt : $( PYSOURCES )
112
110
pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
113
111
$^ -j0> $@ || true
114
112
115
113
diff_pylint_report : pylint_report.txt
116
114
diff-quality --violations=pylint pylint_report.txt
117
115
118
- .coverage : $(PYSOURCES ) all
119
- rm -f .coverage
120
- $(COVBASE ) setup.py test
116
+ .coverage : testcov
117
+ python setup.py test --addopts " --cov --cov-config=.coveragerc --cov-report= -n auto"
121
118
$(COVBASE ) -m schema_salad.main \
122
119
--print-jsonld-context schema_salad/metaschema/metaschema.yml \
123
120
> /dev/null
@@ -162,34 +159,38 @@ diff-cover.html: coverage.xml
162
159
diff-cover $^ --html-report $@
163
160
164
161
# # test : run the ${MODULE} test suite
165
- test : FORCE
166
- python setup.py test --addopts " -n auto"
162
+ test : $(PYSOURCES )
163
+ python setup.py test
164
+
165
+ # # testcov : run the ${MODULE} test suite and collect coverage
166
+ testcov : $(PYSOURCES )
167
+ python setup.py test --addopts " --cov"
167
168
168
- sloccount.sc : ${ PYSOURCES} Makefile
169
+ sloccount.sc : $( PYSOURCES ) Makefile
169
170
sloccount --duplicates --wide --details $^ > $@
170
171
171
172
# # sloccount : count lines of code
172
- sloccount : ${ PYSOURCES} Makefile
173
+ sloccount : $( PYSOURCES ) Makefile
173
174
sloccount $^
174
175
175
176
list-author-emails :
176
177
@echo ' name, E-Mail Address'
177
178
@git log --format=' %aN,%aE' | sort -u | grep -v ' root'
178
179
179
180
mypy3 : mypy
180
- mypy : ${ PYSOURCES}
181
+ mypy : $( filter-out setup.py gittagger.py, $( PYSOURCES ) )
181
182
if ! test -f $( shell python3 -c ' import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))' ) /py.typed ; \
182
183
then \
183
184
rm -Rf typeshed/ruamel/yaml ; \
184
185
ln -s $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__) )' ) \
185
186
typeshed/ruamel/ ; \
186
187
fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
187
- MYPYPATH=$$ MYPYPATH:typeshed mypy schema_salad
188
+ MYPYPATH=$$ MYPYPATH:typeshed mypy $^
188
189
189
- mypyc : ${ PYSOURCES}
190
+ mypyc : $( PYSOURCES )
190
191
MYPYPATH=typeshed SCHEMA_SALAD_USE_MYPYC=1 python setup.py test
191
192
192
- pyupgrade : $(filter-out schema_salad/metaschema.py,${ PYSOURCES} )
193
+ pyupgrade : $(filter-out schema_salad/metaschema.py,$( PYSOURCES ) )
193
194
pyupgrade --exit-zero-even-if-changed --py36-plus $^
194
195
195
196
release-test : FORCE
@@ -204,7 +205,7 @@ release: release-test
204
205
twine upload testenv2/src/${PACKAGE} /dist/* && \
205
206
git tag ${VERSION} && git push --tags
206
207
207
- flake8 : ${ PYSOURCES}
208
+ flake8 : $( PYSOURCES )
208
209
flake8 $^
209
210
210
211
FORCE :
0 commit comments