Skip to content

Commit 8958ba0

Browse files
committed
support Python 3.10
1 parent 202b77a commit 8958ba0

File tree

9 files changed

+66
-47
lines changed

9 files changed

+66
-47
lines changed

.flake8

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[flake8]
2+
ignore = E203, E266, E501, W503, E211, E731
3+
max-line-length = 88
4+
select = B,C,E,F,W,T4,B9

.github/workflows/ci-tests.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
concurrency:
10+
group: build-${{ github.event.pull_request.number || github.ref }}
11+
cancel-in-progress: true
12+
913
jobs:
1014

1115
tox:
@@ -16,7 +20,7 @@ jobs:
1620
strategy:
1721
matrix:
1822
py-ver-major: [3]
19-
py-ver-minor: [6, 7, 8, 9]
23+
py-ver-minor: [6, 7, 8, 9, 10]
2024
step: [lint, unit, mypy]
2125

2226
env:
@@ -54,7 +58,7 @@ jobs:
5458

5559
- name: Upload coverage to Codecov
5660
if: ${{ matrix.step == 'unit' }}
57-
uses: codecov/codecov-action@v1
61+
uses: codecov/codecov-action@v2.1.0
5862
with:
5963
fail_ci_if_error: true
6064

@@ -65,11 +69,11 @@ jobs:
6569

6670
strategy:
6771
matrix:
68-
step: [lint-readme, pydocstyle]
72+
step: [lintreadme, pydocstyle]
6973

7074
env:
71-
py-semver: 3.9
72-
TOXENV: ${{ format('py39-{0}', matrix.step) }}
75+
py-semver: "3.10"
76+
TOXENV: ${{ format('py310-{0}', matrix.step) }}
7377

7478
steps:
7579
- uses: actions/checkout@v2
@@ -110,7 +114,7 @@ jobs:
110114
- name: Set up Python
111115
uses: actions/setup-python@v2
112116
with:
113-
python-version: 3.9
117+
python-version: "3.10" # quoted, otherwise that turns into the number 3.1
114118

115119
- name: Cache for pip
116120
uses: actions/cache@v2

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include Makefile gittaggers.py test-requirements.txt mypy_requirements.txt requirements.txt
1+
include Makefile gittaggers.py test-requirements.txt mypy-requirements.txt requirements.txt
22
include cwltest/cwltest-schema.yml
33
include cwltest/tests/*
44
include cwltest/tests/test-data/*

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ PACKAGE=cwltest
2828
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
2929
DEVPKGS=diff_cover black pylint pep257 pydocstyle flake8 tox tox-pyenv \
3030
isort wheel autoflake flake8-bugbear pyupgrade bandit \
31-
-rtest-requirements.txt -rmypy_requirements.txt
31+
-rtest-requirements.txt -rmypy-requirements.txt
3232
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
3333
python-flake8 python-mock shellcheck
3434
VERSION=2.2.$(shell TZ=UTC git log --first-parent --max-count=1 \

cwltest/utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def check_keys(keys, expected, actual):
111111
except CompareFail as e:
112112
raise CompareFail.format(
113113
expected, actual, f"field '{k}' failed comparison: {str(e)}"
114-
)
114+
) from e
115115

116116

117117
def compare_file(expected, actual):
@@ -159,7 +159,7 @@ def compare_dict(expected, actual):
159159
except CompareFail as e:
160160
raise CompareFail.format(
161161
expected, actual, f"failed comparison for key '{c}': {e}"
162-
)
162+
) from e
163163
extra_keys = set(actual.keys()).difference(list(expected.keys()))
164164
for k in extra_keys:
165165
if actual[k] is not None:
@@ -194,13 +194,13 @@ def compare(expected, actual): # type: (Any, Any) -> None
194194
try:
195195
compare(expected[c], actual[c])
196196
except CompareFail as e:
197-
raise CompareFail.format(expected, actual, e)
197+
raise CompareFail.format(expected, actual, e) from e
198198
else:
199199
if expected != actual:
200200
raise CompareFail.format(expected, actual)
201201

202202
except Exception as e:
203-
raise CompareFail(str(e))
203+
raise CompareFail(str(e)) from e
204204

205205

206206
def get_test_number_by_key(tests, key, value):
File renamed without changes.

release-test.sh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export LC_ALL=C
77

88
package=cwltest
99
module=cwltest
10+
extras=""
11+
1012
if [ "$GITHUB_ACTIONS" = "true" ]; then
1113
# We are running as a GH Action
1214
repo=${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git
@@ -16,8 +18,8 @@ else
1618
HEAD=$(git rev-parse HEAD)
1719
fi
1820
run_tests="bin/py.test --pyargs ${module}"
19-
pipver=20.3b1 # minimum required version of pip for Python 3.9
20-
setuptoolsver=41.1.0 # required for Python 3.9
21+
pipver=20.3.3 # minimum required version of pip for Python 3.10
22+
setuptoolsver=50.0.0 # required for Python 3.10
2123
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
2224

2325
rm -Rf testenv? || /bin/true
@@ -33,7 +35,7 @@ then
3335
rm -f testenv1/lib/python-wheels/setuptools* \
3436
&& pip install --force-reinstall -U pip==${pipver} \
3537
&& pip install setuptools==${setuptoolsver} wheel
36-
pip install -rtest-requirements.txt
38+
pip install -rtest-requirements.txt ".${extras}"
3739
make test
3840
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
3941
mkdir testenv1/not-${module}
@@ -59,7 +61,7 @@ rm -f lib/python-wheels/setuptools* \
5961
&& pip install --force-reinstall -U pip==${pipver} \
6062
&& pip install setuptools==${setuptoolsver} wheel
6163
# The following can fail if you haven't pushed your commits to ${repo}
62-
pip install -e "git+${repo}@${HEAD}#egg=${package}"
64+
pip install -e "git+${repo}@${HEAD}#egg=${package}${extras}"
6365
pushd src/${package}
6466
pip install -rtest-requirements.txt
6567
make dist
@@ -83,13 +85,13 @@ rm -f lib/python-wheels/setuptools* \
8385
&& pip install setuptools==${setuptoolsver} wheel
8486
package_tar=$(find . -name "${package}*tar.gz")
8587
pip install "-r${DIR}/test-requirements.txt"
86-
pip install "${package_tar}"
88+
pip install "${package_tar}${extras}"
8789
mkdir out
8890
tar --extract --directory=out -z -f ${package}*.tar.gz
8991
pushd out/${package}*
9092
make dist
9193
make test
92-
pip install "-r${DIR}/mypy_requirements.txt"
94+
pip install "-r${DIR}/mypy-requirements.txt"
9395
make mypy
9496
pip uninstall -y ${package} || true; pip uninstall -y ${package} || true; make install
9597
mkdir ../not-${module}
@@ -107,7 +109,7 @@ source bin/activate
107109
rm -f lib/python-wheels/setuptools* \
108110
&& pip install --force-reinstall -U pip==${pipver} \
109111
&& pip install setuptools==${setuptoolsver} wheel
110-
pip install ${module}*.whl
112+
pip install "$(ls ${module}*.whl)${extras}"
111113
pip install "-r${DIR}/test-requirements.txt"
112114
mkdir not-${module}
113115
pushd not-${module}

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
"Programming Language :: Python :: 3.7",
6262
"Programming Language :: Python :: 3.8",
6363
"Programming Language :: Python :: 3.9",
64+
"Programming Language :: Python :: 3.10",
6465
"Typing :: Typed",
6566
],
6667
)

tox.ini

Lines changed: 36 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
[tox]
22
envlist =
3-
py{36,37,38,39}-lint,
4-
py{36,37,38,39}-unit,
5-
py{36,37,38,39}-bandit,
6-
py{36,37,38,39}-mypy,
3+
py{36,37,38,39,310}-lint,
4+
py{36,37,38,39,310}-unit,
5+
py{36,37,38,39,310}-bandit,
6+
py{36,37,38,39,310}-mypy,
77
py39-pipconflictchecker,
8-
py39-lint-readme,
8+
py39-lintreadme,
99
py39-pydocstyle
1010

11-
skipsdist = True
1211
skip_missing_interpreters = True
1312

1413
[pytest]
@@ -21,49 +20,56 @@ python =
2120
3.7: py37
2221
3.8: py38
2322
3.9: py39
23+
3.10: py310
2424

2525
[testenv]
2626
description =
27-
py{36,37,38,39}-unit: Run the unit tests
28-
py{36,37,38,39}-lint: Lint the Python code
29-
py{36,37,38,39}-bandit: Search for common security issues
30-
py{36,37,38,39}-mypy: Check for type safety
27+
py{36,37,38,39,310}-unit: Run the unit tests
28+
py{36,37,38,39,310}-lint: Lint the Python code
29+
py{36,37,38,39,310}-bandit: Search for common security issues
30+
py{36,37,38,39,310}-mypy: Check for type safety
3131
py39-pydocstyle: docstring style checker
32-
py39-lint-readme: Lint the README.rst->.md conversion
32+
py39-lintreadme: Lint the README.rst->.md conversion
3333

3434
passenv =
3535
CI
3636
GITHUB_*
3737
deps =
38-
py{36,37,38,39}-{unit,lint,bandit,mypy}: -rrequirements.txt
39-
py{36,37,38,39}-{unit,mypy}: -rtest-requirements.txt
40-
py{36,37,38,39}-lint: flake8-bugbear
41-
py{36,37,38,39}-lint: black
42-
py{36,37,38,39}-bandit: bandit
43-
py{36,37,38,39}-mypy: -rmypy_requirements.txt
38+
py{36,37,38,39,310}-{unit,mypy}: -rrequirements.txt
39+
py{36,37,38,39,310}-{unit,mypy}: -rtest-requirements.txt
40+
py{36,37,38,39,310}-lint: flake8-bugbear
41+
py{36,37,38,39,310}-lint: black
42+
py{36,37,38,39,310}-bandit: bandit
43+
py{36,37,38,39,310}-mypy: -rmypy-requirements.txt
4444

4545
setenv =
46-
py{36,37,38,39}-unit: LC_ALL = C.UTF-8
46+
py{36,37,38,39,310}-unit: LC_ALL = C.UTF-8
4747

4848
commands =
49-
py{36,37,38,39}-unit: python -m pip install -U pip setuptools wheel
50-
py{36,37,38,39}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
51-
py{36,37,38,39}-bandit: bandit --recursive cwltest
52-
py{36,37,38,39}-lint: make flake8
53-
py{36,37,38,39}-lint: make format-check
54-
py{36,37,38,39}-mypy: make mypy
49+
py{36,37,38,39,310}-unit: python -m pip install -U pip setuptools wheel
50+
py{36,37,38,39,310}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs}
51+
py{36,37,38,39,310}-bandit: bandit --recursive cwltest --exclude cwltest/tests/*
52+
py{36,37,38,39,310}-lint: make flake8
53+
py{36,37,38,39,310}-lint: make format-check
54+
py{36,37,38,39,310}-mypy: make mypy
5555

5656
whitelist_externals =
57-
py{36,37,38,39}-lint: flake8
58-
py{36,37,38,39}-lint: black
59-
py{36,37,38,39}-{mypy,shellcheck,lint,unit}: make
57+
py{36,37,38,39,310}-lint: flake8
58+
py{36,37,38,39,310}-lint: black
59+
py{36,37,38,39,310}-{mypy,shellcheck,lint,unit}: make
60+
61+
skip_install =
62+
py{36,37,38,39,310}-lint: true
63+
py{36,37,38,39,310}-bandit: true
64+
6065

6166
[testenv:py39-pydocstyle]
6267
whitelist_externals = make
6368
commands = make diff_pydocstyle_report
6469
deps =
6570
pydocstyle
6671
diff-cover
72+
skip_install = true
6773

6874
[testenv:py39-pipconflictchecker]
6975
commands = pipconflictchecker
@@ -72,7 +78,8 @@ deps =
7278
pip-conflict-checker
7379
pip==9.0.3
7480

75-
[testenv:py39-lint-readme]
81+
[testenv:py39-lintreadme]
82+
description = Lint the README.rst->.md conversion
7683
commands =
7784
python setup.py sdist
7885
python setup.py bdist_wheel
@@ -81,3 +88,4 @@ deps =
8188
twine
8289
wheel
8390
readme_renderer[md]
91+
skip_install = true

0 commit comments

Comments
 (0)