Skip to content

Commit 978e375

Browse files
committed
general build/test upgrades
1 parent 40579be commit 978e375

File tree

5 files changed

+19
-18
lines changed

5 files changed

+19
-18
lines changed

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ EXTRAS=
2828
# `[[` conditional expressions.
2929
PYSOURCES=$(wildcard cwlupgrader/**.py tests/*.py) setup.py
3030
DEVPKGS=diff_cover black pylint pep257 pydocstyle flake8 tox tox-pyenv \
31-
isort wheel autoflake flake8-bugbear pyupgrade bandit \
31+
isort wheel autoflake flake8-bugbear pyupgrade bandit build\
3232
-rtest-requirements.txt -rmypy-requirements.txt
3333
DEBDEVPKGS=pylint python3-coverage sloccount \
3434
python3-flake8 shellcheck
@@ -57,13 +57,14 @@ install: FORCE
5757

5858
## dev : install the cwlupgrader package in dev mode
5959
dev: install-dep
60+
pip install -U pip setuptools wheel
6061
pip install -e .$(EXTRAS)
6162

6263
## dist : create a module package for distribution
6364
dist: dist/${MODULE}-$(VERSION).tar.gz
6465

6566
dist/${MODULE}-$(VERSION).tar.gz: $(SOURCES)
66-
python setup.py sdist bdist_wheel
67+
python -m build
6768

6869
## clean : clean up all temporary / machine-generated files
6970
clean: FORCE
@@ -74,7 +75,7 @@ clean: FORCE
7475

7576
# Linting and code style related targets
7677
## sort_import : sorting imports using isort: https://github.com/timothycrosley/isort
77-
sort_imports: $(PYSOURCES)
78+
sort_imports: $(PYSOURCES) mypy-stubs
7879
isort $^
7980

8081
remove_unused_imports: $(PYSOURCES)
@@ -98,10 +99,10 @@ codespell:
9899

99100
## format : check/fix all code indentation and formatting (runs black)
100101
format:
101-
black setup.py cwlupgrader tests
102+
black setup.py cwlupgrader tests mypy-stubs
102103

103104
format-check:
104-
black --diff --check cwlupgrader setup.py
105+
black --diff --check cwlupgrader setup.py mypy-stubs
105106

106107
## pylint : run static code analysis on Python code
107108
pylint: $(PYSOURCES)
@@ -136,11 +137,11 @@ diff-cover: coverage.xml
136137
diff-cover --compare-branch=main $^
137138

138139
diff-cover.html: coverage.xml
139-
diff-cover --compare-branch main $^ --html-report $@
140+
diff-cover --compare-branch=main $^ --html-report $@
140141

141142
## test : run the cwlupgrader test suite
142143
test: $(PYSOURCES)
143-
python -m pytest -rs
144+
python -m pytest -rs ${PYTEST_EXTRA}
144145

145146
## testcov : run the cwlupgrader test suite and collect coverage
146147
testcov: $(PYSOURCES)
@@ -187,8 +188,8 @@ release: release-test
187188
twine upload testenv2/src/${MODULE}/dist/* && \
188189
git tag v${VERSION} && git push --tags
189190

190-
flake8: $(PYSOURCES)
191-
flake8 $^
191+
flake8: FORCE
192+
flake8 $(PYSOURCES)
192193

193194
FORCE:
194195

release-test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ then
3535
rm -f testenv1/lib/python-wheels/setuptools* \
3636
&& pip install --force-reinstall -U pip==${pipver} \
3737
&& pip install setuptools==${setuptoolsver} wheel
38-
pip install -rtest-requirements.txt ".${extras}"
38+
pip install -rtest-requirements.txt ".${extras}" build
3939
make test
4040
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
4141
mkdir testenv1/not-${module}
@@ -63,7 +63,7 @@ rm -f lib/python-wheels/setuptools* \
6363
# The following can fail if you haven't pushed your commits to ${repo}
6464
pip install -e "git+${repo}@${HEAD}#egg=${package}${extras}"
6565
pushd src/${package}
66-
pip install -rtest-requirements.txt
66+
pip install -rtest-requirements.txt build
6767
make dist
6868
make test
6969
cp dist/${package}*tar.gz ../../../testenv3/
@@ -84,7 +84,7 @@ rm -f lib/python-wheels/setuptools* \
8484
&& pip install --force-reinstall -U pip==${pipver} \
8585
&& pip install setuptools==${setuptoolsver} wheel
8686
package_tar=$(find . -name "${package}*tar.gz")
87-
pip install "-r${DIR}/test-requirements.txt"
87+
pip install "-r${DIR}/test-requirements.txt" build
8888
pip install "${package_tar}${extras}"
8989
mkdir out
9090
tar --extract --directory=out -z -f ${package}*.tar.gz

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ use_parentheses = True
1414
line_length = 88
1515

1616
[metadata]
17-
license_file = LICENSE.txt
17+
license_files = LICENSE.txt

testing.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/bin/bash
22
git clone https://github.com/common-workflow-language/common-workflow-language.git cwl-v1.0
3-
cd cwl-v1.0/v1.0
3+
cd cwl-v1.0/v1.0 || exit
44
cp -r v1.0 v1.1
55
rm v1.1/*.cwl
6-
for cwl in v1.0/*.cwl; do echo ${cwl}; cwl-upgrader ${cwl} > v1.1/${cwl##v1.0/}; done
6+
for cwl in v1.0/*.cwl; do echo "${cwl}"; cwl-upgrader "${cwl}" > v1.1/"${cwl##v1.0/}"; done
77
cp conformance_test_v1.0.yaml conformance_test_v1.0_to_v1_1.yaml
88
sed -i 's=v1.0/=v1.1/=g' conformance_test_v1.0_to_v1_1.yaml
9-
cwltest --test conformance_test_v1.0_to_v1_1.yaml --tool cwltool -j$(nproc)
9+
cwltest --test conformance_test_v1.0_to_v1_1.yaml --tool cwltool "-j$(nproc)"
1010
if
11-
find v1.1/ -type f | xargs grep cwlVersion | grep -v basename-fields-job.yml | grep v1.0
11+
find v1.1/ -type f -print0 | xargs -0 grep cwlVersion | grep -v basename-fields-job.yml | grep v1.0
1212
then false
1313
else true
1414
fi

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ setenv =
4444

4545
commands =
4646
py{36,37,38,39,310,311}-unit: python -m pip install -U pip setuptools wheel
47-
py{36,37,38,39,310,311}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
47+
py{36,37,38,39,310,311}-unit: make coverage-report coverage.xml PYTEST_EXTRA="{posargs}"
4848
py{36,37,38,39,310,311}-lint: make flake8
4949
py{36,37,38,39,310,311}-lint: make format-check
5050
py{37,38,39,310,311}-mypy: make mypy

0 commit comments

Comments
 (0)