@@ -26,12 +26,12 @@ MODULE=cwltest
2626# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2727# `[[` conditional expressions.
2828PYSOURCES =$(wildcard ${MODULE}/** .py tests/* .py) setup.py
29- DEVPKGS =pycodestyle diff_cover autopep8 pylint coverage pydocstyle flake8 \
29+ DEVPKGS =pycodestyle diff_cover pylint coverage pydocstyle flake8 \
3030 pytest pytest-xdist isort
3131DEBDEVPKGS =pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
3232 python-flake8 python-mock shellcheck
33- VERSION =1 .0.$(shell date + % Y % m % d % H % M % S --utc --date=` git log --first-parent \
34- --max-count=1 --format =format: % cI` )
33+ VERSION =2 .0.$(shell TZ=UTC git log --first-parent --max-count=1 \
34+ --format=format: % cd --date =format-local: % Y % m % d % H % M % S )
3535mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST ) ) ) )
3636
3737# # all : default task
@@ -74,47 +74,29 @@ clean: FORCE
7474sort_imports :
7575 isort ${MODULE} /* .py tests/* .py setup.py
7676
77- pep8 : pycodestyle
78- # # pycodestyle : check Python code style
79- pycodestyle : $(PYSOURCES )
80- pycodestyle --exclude=_version.py --show-source --show-pep8 $^ || true
81-
82- pep8_report.txt : pycodestyle_report.txt
83- pycodestyle_report.txt : $(PYSOURCES )
84- pycodestyle --exclude=_version.py $^ > $@ || true
85-
86- diff_pep8_report : diff_pycodestyle_report
87- diff_pycodestyle_report : pycodestyle_report.txt
88- diff-quality --violations=pycodestyle $^
89-
9077pep257 : pydocstyle
9178# # pydocstyle : check Python code style
9279pydocstyle : $(PYSOURCES )
93- pydocstyle --ignore=D100,D101,D102,D103 $^ || true
80+ pydocstyle --add- ignore=D100,D101,D102,D103 $^ || true
9481
9582pydocstyle_report.txt : $(PYSOURCES )
9683 pydocstyle setup.py $^ > $@ 2>&1 || true
9784
9885diff_pydocstyle_report : pydocstyle_report.txt
99- diff-quality --violations=pycodestyle $^
100-
101- # # autopep8 : fix most Python code indentation and formatting
102- autopep8 : $(PYSOURCES )
103- autopep8 --recursive --in-place --ignore E309 $^
86+ diff-quality --violations=pycodestyle --fail-under=100 $^
10487
105- # A command to automatically run astyle and autopep8 on appropriate files
106- # # format : check/fix all code indentation and formatting (runs autopep8)
107- format : autopep8
108- # Do nothing
88+ # # format : check/fix all code indentation and formatting (runs black)
89+ format :
90+ black --exclude cwltool/schemas setup.py cwltest
10991
11092# # pylint : run static code analysis on Python code
11193pylint : $(PYSOURCES )
11294 pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
113- $^ || true
95+ $^ -j0 || true
11496
11597pylint_report.txt : ${PYSOURCES}
11698 pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
117- $^ > pylint_report.txt || true
99+ $^ -j 0> $@ || true
118100
119101diff_pylint_report : pylint_report.txt
120102 diff-quality --violations=pylint pylint_report.txt
@@ -156,37 +138,29 @@ list-author-emails:
156138 @echo ' name, E-Mail Address'
157139 @git log --format=' %aN,%aE' | sort -u | grep -v ' root'
158140
159- mypy2 : ${PYSOURCES}
160- rm -Rf typeshed/2.7/ruamel/yaml
161- ln -s $(shell python -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__) )' ) \
162- typeshed/2.7/ruamel/yaml
163- rm -Rf typeshed/2.7/schema_salad
164- ln -s $(shell python -c 'from __future__ import print_function; import schema_salad; import os.path; print(os.path.dirname(schema_salad.__file__) )' ) \
165- typeshed/2.7/schema_salad
166- MYPYPATH=typeshed/2.7:typeshed/2and3 mypy --py2 --disallow-untyped-calls \
167- --warn-redundant-casts --warn-unused-ignores \
168- ${MODULE}
169-
170- mypy3 : ${PYSOURCES}
171- rm -Rf typeshed/2and3/ruamel/yaml
172- ln -s $(shell python3 -c 'from __future__ import print_function; import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__) )' ) \
173- typeshed/2and3/ruamel/yaml
174- rm -Rf typeshed/2and3/schema_salad
175- ln -s $(shell python3 -c 'from __future__ import print_function; import schema_salad; import os.path; print(os.path.dirname(schema_salad.__file__) )' ) \
176- typeshed/2and3/schema_salad
141+ mypy3 : mypy
142+ mypy : ${PYSOURCES}
143+ if ! test -f $( shell python3 -c ' import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))' ) /py.typed ; \
144+ then \
145+ rm -Rf typeshed/2and3/ruamel/yaml ; \
146+ ln -s $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__) )' ) \
147+ typeshed/2and3/ruamel/ ; \
148+ fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
177149 MYPYPATH=$$ MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
178150 --warn-redundant-casts \
179151 ${MODULE}
180152
153+ release-test : FORCE
154+ git diff-index --quiet HEAD -- || ( echo You have uncommited changes, please commit them and try again; false )
155+ ./release-test.sh
156+
181157release : FORCE
182- PYVER=2.7 ./release-test.sh
183158 PYVER=3 ./release-test.sh
184- . testenv2.7_2 /bin/activate && \
185- testenv2.7_2 /src/${MODULE} /setup.py sdist bdist_wheel
186- . testenv2.7_2 /bin/activate && \
159+ . testenv3_2 /bin/activate && \
160+ testenv3_2 /src/${MODULE} /setup.py sdist bdist_wheel
161+ . testenv3_2 /bin/activate && \
187162 pip install twine && \
188- twine upload testenv2.7_2/src/${MODULE} /dist/* \
189- testenv3_2/src/${MODULE} /dist/* whl && \
163+ twine upload testenv3_2/src/${MODULE} /dist/* whl && \
190164 git tag ${VERSION} && git push --tags
191165
192166FORCE :
0 commit comments