@@ -32,70 +32,78 @@ DEVPKGS=diff_cover black pylint pep257 pydocstyle flake8 tox tox-pyenv \
32
32
-rtest-requirements.txt -rmypy-requirements.txt
33
33
DEBDEVPKGS =pylint python3-coverage sloccount \
34
34
python3-flake8 shellcheck
35
- VERSION =1.2.2 # please also update setup.py
35
+ VERSION =1.2.7 # please also update setup.py
36
36
37
- # # all : default task
37
+ # # all : default task (install cwl-upgrader in dev mode)
38
38
all : dev
39
39
40
- # # help : print this help message and exit
40
+ # # help : print this help message and exit
41
41
help : Makefile
42
42
@sed -n ' s/^##//p' $<
43
43
44
- # # install-dep : install most of the development dependencies via pip
44
+ # # cleanup : shortcut for "make sort_imports format flake8 diff_pydocstyle_report"
45
+ cleanup : sort_imports format flake8 diff_pydocstyle_report
46
+
47
+ # # install-dep : install most of the development dependencies via pip
45
48
install-dep : install-dependencies
46
49
47
50
install-dependencies : FORCE
48
51
pip install --upgrade $(DEVPKGS )
49
52
pip install -r requirements.txt -r mypy-requirements.txt
50
53
51
- # # install : install the ${MODULE} module and script(s)
54
+ # # install : install the cwlupgrader package and scripts
52
55
install : FORCE
53
56
pip install .$(EXTRAS )
54
57
55
- # # dev : install the ${MODULE} module in dev mode
58
+ # # dev : install the cwlupgrader package in dev mode
56
59
dev : install-dep
57
60
pip install -e .$(EXTRAS )
58
61
59
- # # dist : create a module package for distribution
62
+ # # dist : create a module package for distribution
60
63
dist : dist/${MODULE}-$(VERSION ) .tar.gz
61
64
62
65
dist/${MODULE}-$(VERSION ) .tar.gz : $(SOURCES )
63
66
python setup.py sdist bdist_wheel
64
67
65
- # # clean : clean up all temporary / machine-generated files
68
+ # # clean : clean up all temporary / machine-generated files
66
69
clean : FORCE
67
70
rm -f ${MODILE} /* .pyc tests/* .pyc
68
71
python setup.py clean --all || true
69
72
rm -Rf .coverage
70
73
rm -f diff-cover.html
71
74
72
75
# Linting and code style related targets
73
- # # sorting imports using isort: https://github.com/timothycrosley/isort
76
+ # # sort_import : sorting imports using isort: https://github.com/timothycrosley/isort
74
77
sort_imports : $(PYSOURCES )
75
- isort $^ typeshed
78
+ isort $^
76
79
77
80
remove_unused_imports : $(PYSOURCES )
78
81
autoflake --in-place --remove-all-unused-imports $^
79
82
80
83
pep257 : pydocstyle
81
- # # pydocstyle : check Python code style
84
+ # # pydocstyle : check Python docstring style
82
85
pydocstyle : $(PYSOURCES )
83
86
pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true
84
87
85
88
pydocstyle_report.txt : $(PYSOURCES )
86
89
pydocstyle setup.py $^ > $@ 2>&1 || true
87
90
91
+ # # diff_pydocstyle_report : check Python docstring style for changed files only
88
92
diff_pydocstyle_report : pydocstyle_report.txt
89
- diff-quality --compare-branch=main --violations=pycodestyle --fail-under=100 $^
93
+ diff-quality --compare-branch=main --violations=pydocstyle --fail-under=100 $^
94
+
95
+ # # codespell : check for common misspellings
96
+ codespell :
97
+ codespell -w $(shell git ls-files | grep -v mypy-stubs | grep -v gitignore | grep -v EDAM.owl | grep -v pre.yml | grep -v test_schema)
90
98
91
- # # format : check/fix all code indentation and formatting (runs black)
99
+ # # format : check/fix all code indentation and formatting (runs black)
92
100
format :
93
101
black setup.py cwlupgrader tests
94
102
95
103
format-check :
96
- black --diff --check cwlupgrader setup.py typeshed
104
+ black --diff --check cwlupgrader setup.py
97
105
98
- # # pylint : run static code analysis on Python code
106
+ # # pylint : run static code analysis on Python code
99
107
pylint : $(PYSOURCES )
100
108
pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
101
109
$^ -j0|| true
@@ -105,7 +113,7 @@ pylint_report.txt: $(PYSOURCES)
105
113
$^ -j0> $@ || true
106
114
107
115
diff_pylint_report : pylint_report.txt
108
- diff-quality --compare-branch main --violations=pylint pylint_report.txt
116
+ diff-quality --compare-branch= main --violations=pylint pylint_report.txt
109
117
110
118
.coverage : testcov
111
119
@@ -125,23 +133,23 @@ coverage-report: .coverage
125
133
coverage report
126
134
127
135
diff-cover : coverage.xml
128
- diff-cover --compare-branch main $^
136
+ diff-cover --compare-branch= main $^
129
137
130
138
diff-cover.html : coverage.xml
131
139
diff-cover --compare-branch main $^ --html-report $@
132
140
133
- # # test : run the ${MODULE} test suite
141
+ # # test : run the cwlupgrader test suite
134
142
test : $(PYSOURCES )
135
- python setup.py test
143
+ python -m pytest -rs
136
144
137
- # # testcov : run the ${MODULE} test suite and collect coverage
145
+ # # testcov : run the cwlupgrader test suite and collect coverage
138
146
testcov : $(PYSOURCES )
139
147
python setup.py test --addopts " --cov" ${PYTEST_EXTRA}
140
148
141
149
sloccount.sc : $(PYSOURCES ) Makefile
142
150
sloccount --duplicates --wide --details $^ > $@
143
151
144
- # # sloccount : count lines of code
152
+ # # sloccount : count lines of code
145
153
sloccount : $(PYSOURCES ) Makefile
146
154
sloccount $^
147
155
@@ -153,17 +161,17 @@ mypy3: mypy
153
161
mypy : $(PYSOURCES )
154
162
if ! test -f $( shell python3 -c ' import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))' ) /py.typed ; \
155
163
then \
156
- rm -Rf typeshed /ruamel/yaml ; \
164
+ rm -Rf mypy-stubs /ruamel/yaml ; \
157
165
ln -s $(shell python3 -c 'import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__) )' ) \
158
- typeshed /ruamel/ ; \
166
+ mypy-stubs /ruamel/ ; \
159
167
fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
160
- MYPYPATH=$$ MYPYPATH:typeshed mypy $^
168
+ MYPYPATH=$$ MYPYPATH:mypy-stubs mypy $^
161
169
162
170
pyupgrade : $(PYSOURCES )
163
171
pyupgrade --exit-zero-even-if-changed --py36-plus $^
164
172
165
173
release-test : FORCE
166
- git diff-index --quiet HEAD -- || ( echo You have uncommited changes, please commit them and try again; false )
174
+ git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false )
167
175
./release-test.sh
168
176
169
177
release : release-test
0 commit comments