@@ -26,20 +26,18 @@ PACKAGE=schema-salad
2626# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2727# `[[` conditional expressions.
2828PYSOURCES =$(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 \
3030 isort wheel autoflake flake8-bugbear pyupgrade bandit \
3131 -rtest-requirements.txt -rmypy_requirements.txt
32- COVBASE =coverage run --branch --append --source=${MODULE} \
33- --omit=schema_salad/tests/*
32+ COVBASE =coverage run --append
3433
3534# Updating the Major & Minor version below?
3635# Don't forget to update setup.py as well
3736VERSION =7.1.$(shell date +% Y% m% d% H% M% S --utc --date=`git log --first-parent \
3837 --max-count=1 --format=format:% cI`)
3938
4039# # all : default task
41- all :
42- pip install -e .
40+ all : dev
4341
4442# # help : print this help message and exit
4543help : Makefile
@@ -48,7 +46,7 @@ help: Makefile
4846# # install-dep : install most of the development dependencies via pip
4947install-dep : install-dependencies
5048
51- install-dependencies :
49+ install-dependencies : FORCE
5250 pip install --upgrade $(DEVPKGS )
5351 pip install -r requirements.txt
5452
@@ -58,7 +56,7 @@ install: FORCE
5856
5957# # dev : install the ${MODULE} module in dev mode
6058dev : install-dep
61- pip install -e
59+ pip install -e .
6260
6361# # dist : create a module package for distribution
6462dist : dist/${MODULE}-$(VERSION ) .tar.gz
@@ -108,16 +106,15 @@ pylint: $(PYSOURCES)
108106 pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
109107 $^ -j0|| true
110108
111- pylint_report.txt : ${ PYSOURCES}
109+ pylint_report.txt : $( PYSOURCES )
112110 pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
113111 $^ -j0> $@ || true
114112
115113diff_pylint_report : pylint_report.txt
116114 diff-quality --violations=pylint pylint_report.txt
117115
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"
121118 $(COVBASE ) -m schema_salad.main \
122119 --print-jsonld-context schema_salad/metaschema/metaschema.yml \
123120 > /dev/null
@@ -162,34 +159,38 @@ diff-cover.html: coverage.xml
162159 diff-cover $^ --html-report $@
163160
164161# # 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"
167168
168- sloccount.sc : ${ PYSOURCES} Makefile
169+ sloccount.sc : $( PYSOURCES ) Makefile
169170 sloccount --duplicates --wide --details $^ > $@
170171
171172# # sloccount : count lines of code
172- sloccount : ${ PYSOURCES} Makefile
173+ sloccount : $( PYSOURCES ) Makefile
173174 sloccount $^
174175
175176list-author-emails :
176177 @echo ' name, E-Mail Address'
177178 @git log --format=' %aN,%aE' | sort -u | grep -v ' root'
178179
179180mypy3 : mypy
180- mypy : ${ PYSOURCES}
181+ mypy : $( filter-out setup.py gittagger.py, $( PYSOURCES ) )
181182 if ! test -f $( shell python3 -c ' import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))' ) /py.typed ; \
182183 then \
183184 rm -Rf typeshed/ruamel/yaml ; \
184185 ln -s $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__) )' ) \
185186 typeshed/ruamel/ ; \
186187 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 $^
188189
189- mypyc : ${ PYSOURCES}
190+ mypyc : $( PYSOURCES )
190191 MYPYPATH=typeshed SCHEMA_SALAD_USE_MYPYC=1 python setup.py test
191192
192- pyupgrade : $(filter-out schema_salad/metaschema.py,${ PYSOURCES} )
193+ pyupgrade : $(filter-out schema_salad/metaschema.py,$( PYSOURCES ) )
193194 pyupgrade --exit-zero-even-if-changed --py36-plus $^
194195
195196release-test : FORCE
@@ -204,7 +205,7 @@ release: release-test
204205 twine upload testenv2/src/${PACKAGE} /dist/* && \
205206 git tag ${VERSION} && git push --tags
206207
207- flake8 : ${ PYSOURCES}
208+ flake8 : $( PYSOURCES )
208209 flake8 $^
209210
210211FORCE :
0 commit comments