@@ -26,7 +26,9 @@ MODULE=schema_salad
2626# `SHELL=bash` Will break Titus's laptop, so don't use BASH-isms like
2727# `[[` conditional expressions.
2828PYSOURCES =$(wildcard ${MODULE}/** .py tests/* .py) setup.py
29- DEVPKGS =pep8 diff_cover autopep8 pylint coverage pep257
29+ DEVPKGS =pep8 diff_cover autopep8 pylint coverage pep257 pytest flake8
30+ COVBASE =coverage run --branch --append --source=${MODULE} \
31+ --omit=schema_salad/tests/*
3032
3133VERSION =$(shell git describe --tags --dirty | sed s/v//)
3234
@@ -46,7 +48,7 @@ install-dependencies:
4648
4749# # install : install the ${MODULE} module and schema-salad-tool
4850install : FORCE
49- ./setup.py build install
51+ pip install .
5052
5153# # dist : create a module package for distribution
5254dist : dist/${MODULE}-$(VERSION ) .tar.gz
@@ -103,37 +105,31 @@ diff_pylint_report: pylint_report.txt
103105 diff-quality --violations=pylint pylint_report.txt
104106
105107.coverage : $(PYSOURCES )
106- coverage run --branch --source= ${MODULE} setup.py test
107- coverage run --append --branch --source= ${MODULE} \
108- -m schema_salad.main \
108+ rm -f .coverage
109+ $( COVBASE ) setup.py test
110+ $( COVBASE ) -m schema_salad.main \
109111 --print-jsonld-context schema_salad/metaschema/metaschema.yml \
110112 > /dev/null
111- coverage run --append --branch --source=${MODULE} \
112- -m schema_salad.main \
113+ $(COVBASE ) -m schema_salad.main \
113114 --print-rdfs schema_salad/metaschema/metaschema.yml \
114115 > /dev/null
115- coverage run --append --branch --source=${MODULE} \
116- -m schema_salad.main \
116+ $(COVBASE ) -m schema_salad.main \
117117 --print-avro schema_salad/metaschema/metaschema.yml \
118118 > /dev/null
119- coverage run --append --branch --source=${MODULE} \
120- -m schema_salad.main \
119+ $(COVBASE ) -m schema_salad.main \
121120 --print-rdf schema_salad/metaschema/metaschema.yml \
122121 > /dev/null
123- coverage run --append --branch --source=${MODULE} \
124- -m schema_salad.main \
122+ $(COVBASE ) -m schema_salad.main \
125123 --print-pre schema_salad/metaschema/metaschema.yml \
126124 > /dev/null
127- coverage run --append --branch --source=${MODULE} \
128- -m schema_salad.main \
125+ $(COVBASE ) -m schema_salad.main \
129126 --print-index schema_salad/metaschema/metaschema.yml \
130127 > /dev/null
131- coverage run --append --branch --source=${MODULE} \
132- -m schema_salad.main \
128+ $(COVBASE ) -m schema_salad.main \
133129 --print-metadata schema_salad/metaschema/metaschema.yml \
134130 > /dev/null
135- coverage run --append --branch --source= ${MODULE} \
136- -m schema_salad.makedoc schema_salad/metaschema/metaschema.yml \
131+ $( COVBASE ) -m schema_salad.makedoc \
132+ schema_salad/metaschema/metaschema.yml \
137133 > /dev/null
138134
139135coverage.xml : .coverage
@@ -169,17 +165,33 @@ list-author-emails:
169165 @echo ' name, E-Mail Address'
170166 @git log --format=' %aN,%aE' | sort -u | grep -v ' root'
171167
172- mypy : ${PYSOURCES}
173- MYPYPATH=typeshed/2.7 mypy --py2 --disallow-untyped-calls schema_salad
168+ mypy2 : ${PYSOURCES}
169+ rm -Rf typeshed/2and3/ruamel/yaml
170+ ln -s $(shell python -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__) )' ) \
171+ typeshed/2and3/ruamel/
172+ MYPYPATH=$MYPYPATH :typeshed/2.7:typeshed/2and3 mypy --py2 --disallow-untyped-calls \
173+ --warn-redundant-casts \
174+ schema_salad
175+
176+ mypy3 : ${PYSOURCES}
177+ rm -Rf typeshed/2and3/ruamel/yaml
178+ ln -s $(shell python -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__) )' ) \
179+ typeshed/2and3/ruamel/
180+ MYPYPATH=$MYPYPATH :typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
181+ --warn-redundant-casts \
182+ schema_salad
174183
175184jenkins :
176- if ! test -d env ; then virtualenv env ; fi
185+ rm -Rf env && virtualenv env
177186 . env/bin/activate ; \
178187 pip install -U setuptools pip wheel ; \
179188 ${MAKE} install-dep coverage.html coverage.xml pep257_report.txt \
180189 sloccount.sc pep8_report.txt pylint_report.txt
181190 if ! test -d env3 ; then virtualenv -p python3 env3 ; fi
182191 . env3/bin/activate ; \
183- pip install -U mypy-lang; ${MAKE} mypy
192+ pip install -U setuptools pip wheel ; \
193+ ${MAKE} install-dep ; \
194+ pip install -U -r mypy_requirements.txt ; ${MAKE} mypy2
195+ # pip install -U -r mypy_requirements.txt ; ${MAKE} mypy3
184196
185197FORCE :
0 commit comments