Skip to content

Commit 4d3e296

Browse files
committed
Merge remote-tracking branch 'origin/main' into skip_internal_imports
2 parents 59139ba + 978e375 commit 4d3e296

File tree

8 files changed

+39
-24
lines changed

8 files changed

+39
-24
lines changed

Diff for: .github/workflows/ci-tests.yml

+7
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ jobs:
2121
py-ver-major: [3]
2222
py-ver-minor: [6, 7, 8, 9, 10, 11]
2323
step: [lint, unit, mypy]
24+
exclude:
25+
- py-ver-major: 3
26+
py-ver-minor: 6
27+
step: mypy
28+
- py-ver-major: 3
29+
py-ver-minor: 6
30+
step: lint
2431

2532
env:
2633
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}

Diff for: Makefile

+16-9
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)
@@ -167,6 +168,12 @@ mypy: $(PYSOURCES)
167168
fi # if minimally required ruamel.yaml version is 0.15.99 or greater, than the above can be removed
168169
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^
169170

171+
mypy_3.6: $(filter-out setup.py,$(PYSOURCES))
172+
MYPYPATH=$$MYPYPATH:mypy-stubs mypy --python-version 3.6 $^
173+
174+
shellcheck: FORCE
175+
shellcheck testing.sh release-test.sh
176+
170177
pyupgrade: $(PYSOURCES)
171178
pyupgrade --exit-zero-even-if-changed --py36-plus $^
172179

@@ -181,8 +188,8 @@ release: release-test
181188
twine upload testenv2/src/${MODULE}/dist/* && \
182189
git tag v${VERSION} && git push --tags
183190

184-
flake8: $(PYSOURCES)
185-
flake8 $^
191+
flake8: FORCE
192+
flake8 $(PYSOURCES)
186193

187194
FORCE:
188195

Diff for: cwlupgrader/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
yaml = ruamel.yaml.main.YAML(typ="rt")
2626
yaml.allow_duplicate_keys = True
27-
yaml.preserve_quotes = True # type: ignore
27+
yaml.preserve_quotes = True
2828
yaml.default_flow_style = False
2929

3030

Diff for: mypy-requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
mypy==0.971
1+
mypy==1.3.0
22
types-setuptools

Diff for: release-test.sh

+3-3
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

Diff for: setup.cfg

+1-1
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

Diff for: testing.sh

+4-4
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

Diff for: tox.ini

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ envlist =
33
py{36,37,38,39,310,311}-lint,
44
py{36,37,38,39,310,311}-unit,
55

6-
py{36,37,38,39,310,311}-mypy,
6+
py{37,38,39,310,311}-mypy,
77
py39-lintreadme,
88
py39-pydocstyle
99

@@ -25,7 +25,7 @@ python =
2525
description =
2626
py{36,37,38,39,310,311}-unit: Run the unit tests
2727
py{36,37,38,39,310,311}-lint: Lint the Python code
28-
py{36,37,38,39,310,311}-mypy: Check for type safety
28+
py{37,38,39,310,311}-mypy: Check for type safety
2929
py311-pydocstyle: docstring style checker
3030
py311-lintreadme: Lint the README.rst->.md conversion
3131

@@ -37,22 +37,23 @@ deps =
3737
py{36,37,38,39,310,311}-{unit,mypy}: -rtest-requirements.txt
3838
py{36,37,38,39,310,311}-lint: flake8-bugbear
3939
py{36,37,38,39,310,311}-lint: black
40-
py{36,37,38,39,310,311}-mypy: -rmypy-requirements.txt
40+
py{37,38,39,310,311}-mypy: -rmypy-requirements.txt
4141

4242
setenv =
4343
py{36,37,38,39,310,311}-unit: LC_ALL = C.UTF-8
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
50-
py{36,37,38,39,310,311}-mypy: make mypy
50+
py{37,38,39,310,311}-mypy: make mypy
5151

5252
allowlist_externals =
5353
py{36,37,38,39,310,311}-lint: flake8
5454
py{36,37,38,39,310,311}-lint: black
5555
py{36,37,38,39,310,311}-{mypy,shellcheck,lint,unit}: make
56+
py37-mypy: make mypy_3.6
5657

5758
skip_install =
5859
py{36,37,38,39,310,311}-lint: true

0 commit comments

Comments
 (0)