@@ -32,70 +32,78 @@ DEVPKGS=diff_cover black pylint pep257 pydocstyle flake8 tox tox-pyenv \
3232 -rtest-requirements.txt -rmypy-requirements.txt
3333DEBDEVPKGS =pylint python3-coverage sloccount \
3434 python3-flake8 shellcheck
35- VERSION =1.2.2 # please also update setup.py
35+ VERSION =1.2.7 # please also update setup.py
3636
37- # # all : default task
37+ # # all : default task (install cwl-upgrader in dev mode)
3838all : dev
3939
40- # # help : print this help message and exit
40+ # # help : print this help message and exit
4141help : Makefile
4242 @sed -n ' s/^##//p' $<
4343
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
4548install-dep : install-dependencies
4649
4750install-dependencies : FORCE
4851 pip install --upgrade $(DEVPKGS )
4952 pip install -r requirements.txt -r mypy-requirements.txt
5053
51- # # install : install the ${MODULE} module and script(s)
54+ # # install : install the cwlupgrader package and scripts
5255install : FORCE
5356 pip install .$(EXTRAS )
5457
55- # # dev : install the ${MODULE} module in dev mode
58+ # # dev : install the cwlupgrader package in dev mode
5659dev : install-dep
5760 pip install -e .$(EXTRAS )
5861
59- # # dist : create a module package for distribution
62+ # # dist : create a module package for distribution
6063dist : dist/${MODULE}-$(VERSION ) .tar.gz
6164
6265dist/${MODULE}-$(VERSION ) .tar.gz : $(SOURCES )
6366 python setup.py sdist bdist_wheel
6467
65- # # clean : clean up all temporary / machine-generated files
68+ # # clean : clean up all temporary / machine-generated files
6669clean : FORCE
6770 rm -f ${MODILE} /* .pyc tests/* .pyc
6871 python setup.py clean --all || true
6972 rm -Rf .coverage
7073 rm -f diff-cover.html
7174
7275# 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
7477sort_imports : $(PYSOURCES )
75- isort $^ typeshed
78+ isort $^
7679
7780remove_unused_imports : $(PYSOURCES )
7881 autoflake --in-place --remove-all-unused-imports $^
7982
8083pep257 : pydocstyle
81- # # pydocstyle : check Python code style
84+ # # pydocstyle : check Python docstring style
8285pydocstyle : $(PYSOURCES )
8386 pydocstyle --add-ignore=D100,D101,D102,D103 $^ || true
8487
8588pydocstyle_report.txt : $(PYSOURCES )
8689 pydocstyle setup.py $^ > $@ 2>&1 || true
8790
91+ # # diff_pydocstyle_report : check Python docstring style for changed files only
8892diff_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)
9098
91- # # format : check/fix all code indentation and formatting (runs black)
99+ # # format : check/fix all code indentation and formatting (runs black)
92100format :
93101 black setup.py cwlupgrader tests
94102
95103format-check :
96- black --diff --check cwlupgrader setup.py typeshed
104+ black --diff --check cwlupgrader setup.py
97105
98- # # pylint : run static code analysis on Python code
106+ # # pylint : run static code analysis on Python code
99107pylint : $(PYSOURCES )
100108 pylint --msg-template=" {path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
101109 $^ -j0|| true
@@ -105,7 +113,7 @@ pylint_report.txt: $(PYSOURCES)
105113 $^ -j0> $@ || true
106114
107115diff_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
109117
110118.coverage : testcov
111119
@@ -125,23 +133,23 @@ coverage-report: .coverage
125133 coverage report
126134
127135diff-cover : coverage.xml
128- diff-cover --compare-branch main $^
136+ diff-cover --compare-branch= main $^
129137
130138diff-cover.html : coverage.xml
131139 diff-cover --compare-branch main $^ --html-report $@
132140
133- # # test : run the ${MODULE} test suite
141+ # # test : run the cwlupgrader test suite
134142test : $(PYSOURCES )
135- python setup.py test
143+ python -m pytest -rs
136144
137- # # testcov : run the ${MODULE} test suite and collect coverage
145+ # # testcov : run the cwlupgrader test suite and collect coverage
138146testcov : $(PYSOURCES )
139147 python setup.py test --addopts " --cov" ${PYTEST_EXTRA}
140148
141149sloccount.sc : $(PYSOURCES ) Makefile
142150 sloccount --duplicates --wide --details $^ > $@
143151
144- # # sloccount : count lines of code
152+ # # sloccount : count lines of code
145153sloccount : $(PYSOURCES ) Makefile
146154 sloccount $^
147155
@@ -153,17 +161,17 @@ mypy3: mypy
153161mypy : $(PYSOURCES )
154162 if ! test -f $( shell python3 -c ' import ruamel.yaml; import os.path; print(os.path.dirname(ruamel.yaml.__file__))' ) /py.typed ; \
155163 then \
156- rm -Rf typeshed /ruamel/yaml ; \
164+ rm -Rf mypy-stubs /ruamel/yaml ; \
157165 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/ ; \
159167 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 $^
161169
162170pyupgrade : $(PYSOURCES )
163171 pyupgrade --exit-zero-even-if-changed --py36-plus $^
164172
165173release-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 )
167175 ./release-test.sh
168176
169177release : release-test
0 commit comments