Skip to content

Commit f9c8f1c

Browse files
committed
Drop Python 3.6 testing
This is now a Python 3.8+ codebase Default to Python 3.12 for release testing and others
1 parent 3a36d09 commit f9c8f1c

11 files changed

+45
-62
lines changed

.github/workflows/ci-tests.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,8 @@ jobs:
2121
matrix:
2222
# The README.rst file mentions the versions tested, please update it as well
2323
py-ver-major: [3]
24-
py-ver-minor: [6, 8, 9, 10, 11, 12]
24+
py-ver-minor: [8, 9, 10, 11, 12]
2525
step: [lint, unit, mypy, bandit]
26-
exclude:
27-
- py-ver-major: 3
28-
py-ver-minor: 6
29-
step: mypy
30-
- py-ver-major: 3
31-
py-ver-minor: 6
32-
step: lint
3326

3427
env:
3528
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
@@ -44,7 +37,6 @@ jobs:
4437
uses: actions/setup-python@v4
4538
with:
4639
python-version: ${{ env.py-semver }}
47-
allow-prereleases: true
4840
cache: pip
4941
cache-dependency-path: |
5042
requirements.txt
@@ -83,8 +75,8 @@ jobs:
8375
step: [lintreadme, pydocstyle]
8476

8577
env:
86-
py-semver: "3.11"
87-
TOXENV: ${{ format('py311-{0}', matrix.step) }}
78+
py-semver: "3.12"
79+
TOXENV: ${{ format('py312-{0}', matrix.step) }}
8880

8981
steps:
9082
- uses: actions/checkout@v4
@@ -124,7 +116,7 @@ jobs:
124116
- name: Set up Python
125117
uses: actions/setup-python@v4
126118
with:
127-
python-version: "3.11"
119+
python-version: "3.12"
128120
cache: pip
129121
cache-dependency-path: |
130122
requirements.txt

Makefile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,9 @@ mypy3: mypy
168168
mypy: $(filter-out setup.py gittagger.py,$(PYSOURCES))
169169
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^
170170

171-
mypy_3.6: $(filter-out setup.py gittagger.py,$(PYSOURCES))
172-
MYPYPATH=$$MYPYPATH:mypy-stubs mypy --python-version 3.6 $^
173-
174171
pyupgrade: $(filter-out schema_salad/metaschema.py,$(PYSOURCES))
175-
pyupgrade --exit-zero-even-if-changed --py36-plus $^
172+
pyupgrade --exit-zero-even-if-changed --py38-plus $^
173+
auto-walrus $^
176174

177175
release-test: FORCE
178176
git diff-index --quiet HEAD -- || ( echo You have uncommitted changes, please commit them and try again; false )

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ This is a testing tool for checking the output of Tools and Workflows described
3232
with the Common Workflow Language. Among other uses, it is used to run the CWL
3333
conformance tests.
3434

35-
This is written and tested for Python 3.6, 3.7, 3.8, 3.9, 3.10, and 3.11.
35+
This is written and tested for Python 3.8, 3.9, 3.10, 3.11, and 3.12.
3636

3737
.. contents:: Table of Contents
3838
:local:

cwltest/argparser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,7 @@ def arg_parser() -> argparse.ArgumentParser:
107107
help="Create JSON badges and store them in this directory.",
108108
)
109109

110-
pkg = pkg_resources.require("cwltest")
111-
if pkg:
110+
if pkg := pkg_resources.require("cwltest"):
112111
ver = f"{sys.argv[0]} {pkg[0].version}"
113112
else:
114113
ver = "{} {}".format(sys.argv[0], "unknown version")

cwltest/compare.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,9 @@ def _check_keys(
3737

3838

3939
def _compare_contents(expected: Dict[str, Any], actual: Dict[str, Any]) -> None:
40-
expected_contents = expected["contents"]
4140
with open(actual["path"]) as f:
4241
actual_contents = f.read()
43-
if expected_contents != actual_contents:
42+
if (expected_contents := expected["contents"]) != actual_contents:
4443
raise CompareFail.format(
4544
expected,
4645
actual,

cwltest/plugin.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Iterator,
1414
List,
1515
Optional,
16+
Protocol,
1617
Set,
1718
Tuple,
1819
Union,
@@ -21,7 +22,6 @@
2122

2223
import pytest
2324
from cwltest.compare import CompareFail, compare
24-
from typing_extensions import Protocol
2525

2626
from cwltest import REQUIRED, UNSUPPORTED_FEATURE, logger, utils
2727

@@ -207,8 +207,7 @@ def _add_global_properties(self) -> None:
207207
"""Nonfunctional if xdist is installed and anything besides "-n 0" is used."""
208208
from _pytest.junitxml import xml_key
209209

210-
xml = self.config._store.get(xml_key, None)
211-
if xml:
210+
if xml := self.config._store.get(xml_key, None):
212211
xml.add_global_property("runner", self.config.getoption("cwl_runner"))
213212
xml.add_global_property(
214213
"runner_extra_args", self.config.getoption("cwl_args")
@@ -381,8 +380,7 @@ def pytest_sessionfinish(session: pytest.Session, exitstatus: int) -> None:
381380
nunsupported,
382381
_,
383382
) = utils.parse_results(results, tests)
384-
cwl_badgedir = session.config.getoption("cwl_badgedir")
385-
if cwl_badgedir:
383+
if cwl_badgedir := session.config.getoption("cwl_badgedir"):
386384
utils.generate_badges(cwl_badgedir, ntotal, npassed)
387385

388386

dev-requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ autoflake
1212
flake8-bugbear
1313
pyupgrade
1414
bandit
15+
auto-walrus

release-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ else
1818
HEAD=$(git rev-parse HEAD)
1919
fi
2020
run_tests="bin/py.test -p pytester --pyargs ${module}"
21-
pipver=20.3.3 # minimum required version of pip for Python 3.10
22-
setuptoolsver=50.0.1 # required for Python 3.10
21+
pipver=23.1 # minimum required version of pip for Python 3.12
22+
setuptoolsver=67.6.1 # required for Python 3.12
2323
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
2424

2525
rm -Rf testenv? || /bin/true

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@ schema-salad >= 5.0.20200220195218, < 9
22
junit-xml >= 1.8
33
pytest >= 7, < 8
44
defusedxml
5-
typing-extensions

setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
url="https://github.com/common-workflow-language/cwltest",
3131
download_url="https://github.com/common-workflow-language/cwltest",
3232
license="Apache 2.0",
33-
python_requires=">=3.6, <4",
33+
python_requires=">=3.8, <4",
3434
setup_requires=[] + pytest_runner,
3535
packages=["cwltest", "cwltest.tests"],
3636
package_dir={"cwltest.tests": "tests"},
@@ -64,7 +64,6 @@
6464
"Operating System :: POSIX",
6565
"Operating System :: MacOS :: MacOS X",
6666
"Development Status :: 5 - Production/Stable",
67-
"Programming Language :: Python :: 3.6",
6867
"Programming Language :: Python :: 3.8",
6968
"Programming Language :: Python :: 3.9",
7069
"Programming Language :: Python :: 3.10",

tox.ini

Lines changed: 29 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[tox]
22
envlist =
33
py3{8,9,10,11,12}-lint,
4-
py3{6,8,9,10,11,12}-unit,
5-
py3{6,8,9,10,11,12}-bandit,
4+
py3{8,9,10,11,12}-unit,
5+
py3{8,9,10,11,12}-bandit,
66
py3{8,9,10,11,12}-mypy,
7-
py311-lintreadme,
8-
py311-pydocstyle
7+
py312-lintreadme,
8+
py312-pydocstyle
99

1010
skip_missing_interpreters = True
1111

@@ -16,7 +16,6 @@ testpaths = tests
1616

1717
[gh-actions]
1818
python =
19-
3.6: py36
2019
3.8: py38
2120
3.9: py39
2221
3.10: py310
@@ -25,64 +24,63 @@ python =
2524

2625
[testenv]
2726
skipsdist =
28-
py3{6,7,8,9,10,11}-!{unit,mypy,lintreadme} = True
27+
py3{8,9,10,11,12}-!{unit,mypy,lintreadme} = True
2928

3029
description =
31-
py3{6,8,9,10,11,12}-unit: Run the unit tests
32-
py3{6,8,9,10,11,12}-lint: Lint the Python code
33-
py3{6,8,9,10,11,12}-bandit: Search for common security issues
30+
py3{8,9,10,11,12}-unit: Run the unit tests
31+
py3{8,9,10,11,12}-lint: Lint the Python code
32+
py3{8,9,10,11,12}-bandit: Search for common security issues
3433
py3{8,9,10,11,12}-mypy: Check for type safety
35-
py311-pydocstyle: docstring style checker
36-
py311-lintreadme: Lint the README.rst->.md conversion
34+
py312-pydocstyle: docstring style checker
35+
py312-lintreadme: Lint the README.rst->.md conversion
3736

3837
passenv =
3938
CI
4039
GITHUB_*
4140

4241
deps =
43-
py3{6,8,9,10,11,12}-{unit,mypy}: -rrequirements.txt
44-
py3{6,8,9,10,11,12}-{unit,mypy}: -rtest-requirements.txt
45-
py3{6,8,9,10,11,12}-lint: flake8-bugbear
46-
py3{6,8,9,10,11,12}-lint: black~=23.1
47-
py3{6,8,9,10,11,12}-bandit: bandit
42+
py3{8,9,10,11,12}-{unit,mypy}: -rrequirements.txt
43+
py3{8,9,10,11,12}-{unit,mypy}: -rtest-requirements.txt
44+
py3{8,9,10,11,12}-lint: flake8-bugbear
45+
py3{8,9,10,11,12}-lint: black~=23.1
46+
py3{8,9,10,11,12}-bandit: bandit
4847
py3{8,9,10,11,12}-mypy: -rmypy-requirements.txt
4948

5049
setenv =
51-
py3{6,8,3,10,11,12}-unit: LC_ALL = C.UTF-8
50+
py3{8,3,10,11,12}-unit: LC_ALL = C.UTF-8
5251
COV_CORE_SOURCE=cwltest
5352
COV_CORE_CONFIG={toxinidir}/.coveragerc
5453
COV_CORE_DATAFILE={toxinidir}/.coverage.eager
5554

5655

5756
commands =
58-
py3{6,8,9,10,11,12}-unit: python -m pip install -U pip setuptools wheel
59-
py3{6,8,9,10,11,12}-unit: python -m pytest --cov --cov-config={toxinidir}/.coveragerc --cov-append {posargs}
60-
py3{6,8,9,10,11,12}-unit: coverage xml
61-
py3{6,8,9,10,11,12}-bandit: bandit --recursive cwltest
62-
py3{6,8,9,10,11,12}-lint: make flake8
63-
py3{6,8,9,10,11,12}-lint: make format-check
57+
py3{8,9,10,11,12}-unit: python -m pip install -U pip setuptools wheel
58+
py3{8,9,10,11,12}-unit: python -m pytest --cov --cov-config={toxinidir}/.coveragerc --cov-append {posargs}
59+
py3{8,9,10,11,12}-unit: coverage xml
60+
py3{8,9,10,11,12}-bandit: bandit --recursive cwltest
61+
py3{8,9,10,11,12}-lint: make flake8
62+
py3{8,9,10,11,12}-lint: make format-check
6463
py3{8,9,10,11,12}-mypy: make mypy
65-
py38-mypy: make mypy_3.6
6664

6765
allowlist_externals =
68-
py3{6,8,9,10,11,12}-lint: flake8
69-
py3{6,8,9,10,11,12}-lint: black
70-
py3{6,8,9,10,11,12}-{mypy,shellcheck,lint,unit}: make
66+
py3{8,9,10,11,12}-lint: flake8
67+
py3{8,9,10,11,12}-lint: black
68+
py3{8,9,10,11,12}-{mypy,shellcheck,lint,unit}: make
7169

7270
skip_install =
73-
py3{6,8,9,10,11,12}-lint: true
74-
py3{6,8,9,10,11,12}-bandit: true
71+
py3{8,9,10,11,12}-lint: true
72+
py3{8,9,10,11,12}-bandit: true
7573

7674

77-
[testenv:py311-pydocstyle]
75+
[testenv:py312-pydocstyle]
7876
allowlist_externals = make
7977
commands = make diff_pydocstyle_report
8078
deps =
8179
pydocstyle
8280
diff-cover
8381
skip_install = true
8482

85-
[testenv:py311-lintreadme]
83+
[testenv:py312-lintreadme]
8684
description = Lint the README.rst->.md conversion
8785
commands =
8886
python -m build --outdir {distdir}

0 commit comments

Comments
 (0)