@@ -26,12 +26,12 @@ MODULE=cwltest
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 tests/* .py) setup.py
29
- DEVPKGS =pycodestyle diff_cover autopep8 pylint coverage pydocstyle flake8 \
29
+ DEVPKGS =pycodestyle diff_cover pylint coverage pydocstyle flake8 \
30
30
pytest pytest-xdist isort
31
31
DEBDEVPKGS =pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
32
32
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 )
35
35
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST ) ) ) )
36
36
37
37
# # all : default task
@@ -74,47 +74,29 @@ clean: FORCE
74
74
sort_imports :
75
75
isort ${MODULE} /* .py tests/* .py setup.py
76
76
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
-
90
77
pep257 : pydocstyle
91
78
# # pydocstyle : check Python code style
92
79
pydocstyle : $(PYSOURCES )
93
- pydocstyle --ignore=D100,D101,D102,D103 $^ || true
80
+ pydocstyle --add- ignore=D100,D101,D102,D103 $^ || true
94
81
95
82
pydocstyle_report.txt : $(PYSOURCES )
96
83
pydocstyle setup.py $^ > $@ 2>&1 || true
97
84
98
85
diff_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 $^
104
87
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
109
91
110
92
# # pylint : run static code analysis on Python code
111
93
pylint : $(PYSOURCES )
112
94
pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
113
- $^ || true
95
+ $^ -j0 || true
114
96
115
97
pylint_report.txt : ${PYSOURCES}
116
98
pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
117
- $^ > pylint_report.txt || true
99
+ $^ -j 0> $@ || true
118
100
119
101
diff_pylint_report : pylint_report.txt
120
102
diff-quality --violations=pylint pylint_report.txt
@@ -156,37 +138,29 @@ list-author-emails:
156
138
@echo ' name, E-Mail Address'
157
139
@git log --format=' %aN,%aE' | sort -u | grep -v ' root'
158
140
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
177
149
MYPYPATH=$$ MYPYPATH:typeshed/3:typeshed/2and3 mypy --disallow-untyped-calls \
178
150
--warn-redundant-casts \
179
151
${MODULE}
180
152
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
+
181
157
release : FORCE
182
- PYVER=2.7 ./release-test.sh
183
158
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 && \
187
162
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 && \
190
164
git tag ${VERSION} && git push --tags
191
165
192
166
FORCE :
0 commit comments