Skip to content

Commit c74e030

Browse files
committed
Drop Python 3.6 & 3.7
1 parent 139c64b commit c74e030

File tree

11 files changed

+37
-57
lines changed

11 files changed

+37
-57
lines changed

.github/workflows/ci-tests.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,13 @@ jobs:
1515
tox:
1616
name: CI tests via Tox
1717

18-
runs-on: ubuntu-20.04 # 22.04 doesn't support Python 3.6
18+
runs-on: ubuntu-22.04
1919

2020
strategy:
2121
matrix:
2222
py-ver-major: [3]
23-
py-ver-minor: [6, 7, 8, 9, 10, 11, 12]
23+
py-ver-minor: [8, 9, 10, 11, 12]
2424
step: [lint, unit, bandit, mypy]
25-
exclude:
26-
- py-ver-major: 3
27-
py-ver-minor: 6
28-
step: mypy
29-
- py-ver-major: 3
30-
py-ver-minor: 6
31-
step: lint
32-
- py-ver-major: 3
33-
py-ver-minor: 7
34-
step: lint
3525

3626
env:
3727
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
@@ -83,7 +73,7 @@ jobs:
8373
tox-style:
8474
name: CI linters via Tox
8575

86-
runs-on: ubuntu-20.04
76+
runs-on: ubuntu-22.04
8777

8878
strategy:
8979
matrix:

.github/workflows/tag_to_publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
release_to_pypi:
1616
name: cwl-utils release test
1717

18-
runs-on: ubuntu-20.04
18+
runs-on: ubuntu-22.04
1919

2020
steps:
2121
- uses: actions/checkout@v3

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Style guide:
22
- PEP-8 / format with ``black`` via ``make format``
3-
- Python 3.6+ compatible code
3+
- Python 3.8+ compatible code
44
- PEP-484 type hints
55

66
It is suggested that you run `git config blame.ignoreRevsFile .git-blame-ignore-revs`

Makefile

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ PYSOURCES=$(filter-out $(MODULE)/parser/cwl_v%,$(shell find $(MODULE) -name "*.p
3030
$(wildcard tests/*.py) create_cwl_from_objects.py load_cwl_by_path.py \
3131
setup.py ${MODULE}/parser/cwl_v1_?_utils.py docs/conf.py
3232
DEVPKGS=diff_cover pylint pep257 pydocstyle flake8 tox tox-pyenv \
33-
isort wheel autoflake pyupgrade bandit -rlint-requirements.txt \
34-
-rtest-requirements.txt -rmypy-requirements.txt
33+
isort wheel autoflake pyupgrade bandit auto-walrus \
34+
-rlint-requirements.txt -rtest-requirements.txt -rmypy-requirements.txt
3535
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
3636
python-flake8 python-mock shellcheck
3737
VERSION=v$(shell echo $$(tail -n 1 cwl_utils/__meta__.py | awk '{print $$3}'))
@@ -173,14 +173,12 @@ mypy3: mypy
173173
mypy: $(filter-out setup.py,${PYSOURCES})
174174
MYPYPATH=$$MYPYPATH:mypy-stubs mypy $^
175175

176-
mypy_3.6: $(filter-out setup.py,${PYSOURCES})
177-
MYPYPATH=$$MYPYPATH:mypy-stubs mypy --python-version 3.6 $^
178-
179176
shellcheck: FORCE
180177
shellcheck release-test.sh
181178

182179
pyupgrade: $(PYSOURCES)
183-
pyupgrade --exit-zero-even-if-changed --py36-plus $^
180+
pyupgrade --exit-zero-even-if-changed --py38-plus $^
181+
auto-walrus $^
184182

185183
release-test: FORCE
186184
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
@@ -19,7 +19,7 @@ and `CWL
1919
v1.2 <https://github.com/common-workflow-language/cwl-utils/blob/main/cwl_utils/parser/v1_2.py>`__
2020
documents.
2121

22-
Requires Python 3.6+
22+
Requires Python 3.8+
2323

2424
Installation
2525
------------

cwl_utils/expression.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,9 @@ def evaluator(
116116
**kwargs: Any,
117117
) -> Optional[CWLOutputType]:
118118
js_engine = js_engine or get_js_engine()
119-
match = param_re.match(ex)
120119
expression_parse_exception = None
121120

122-
if match is not None:
121+
if (match := param_re.match(ex)) is not None:
123122
first_symbol = match.group(1)
124123
first_symbol_end = match.end(1)
125124

cwl_utils/parser/cwl_v1_2_utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,7 @@ def _compare_type(type1: Any, type2: Any) -> bool:
8585
def _is_conditional_step(
8686
param_to_step: Dict[str, cwl.WorkflowStep], parm_id: str
8787
) -> bool:
88-
source_step = param_to_step.get(parm_id)
89-
if source_step is not None:
88+
if (source_step := param_to_step.get(parm_id)) is not None:
9089
if source_step.when is not None:
9190
return True
9291
return False

cwl_utils/sandboxjs.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ def check_js_threshold_version(self, working_alias: str) -> bool:
145145
"""
146146
# parse nodejs version into int Tuple: 'v4.2.6\n' -> [4, 2, 6]
147147
current_version_str = subprocess.check_output( # nosec
148-
[working_alias, "-v"], universal_newlines=True
148+
[working_alias, "-v"], text=True
149149
)
150150
current_version = [
151151
int(v) for v in current_version_str.strip().strip("v").split(".")
@@ -294,7 +294,7 @@ def new_js_proc(
294294
if (
295295
subprocess.check_output( # nosec
296296
[n, "--eval", "process.stdout.write('t')"],
297-
universal_newlines=True,
297+
text=True,
298298
)
299299
!= "t"
300300
):
@@ -326,7 +326,7 @@ def new_js_proc(
326326
if container_engine in ("docker", "podman"):
327327
dockerimgs = subprocess.check_output( # nosec
328328
[container_engine, "images", "-q", nodeimg],
329-
universal_newlines=True,
329+
text=True,
330330
)
331331
elif container_engine == "singularity":
332332
singularity_cache = os.environ.get("CWL_SINGULARITY_CACHE")
@@ -345,7 +345,7 @@ def new_js_proc(
345345
re.escape(nodeimg),
346346
subprocess.check_output( # nosec
347347
[container_engine, "images"],
348-
universal_newlines=True,
348+
text=True,
349349
),
350350
)
351351
if matches:
@@ -369,7 +369,7 @@ def new_js_proc(
369369
nodejs_pull_commands.append(nodeimg)
370370
cwd = singularity_cache if singularity_cache else os.getcwd()
371371
nodejsimg = subprocess.check_output( # nosec
372-
nodejs_pull_commands, universal_newlines=True, cwd=cwd
372+
nodejs_pull_commands, text=True, cwd=cwd
373373
)
374374
_logger.debug(
375375
"Pulled Docker image %s %s using %s",

cwl_utils/singularity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def get_version() -> Tuple[List[int], str]:
2929
global _SINGULARITY_FLAVOR # pylint: disable=global-statement
3030
if _SINGULARITY_VERSION is None:
3131
version_output = check_output( # nosec
32-
["singularity", "--version"], universal_newlines=True
32+
["singularity", "--version"], text=True
3333
).strip()
3434

3535
version_match = re.match(r"(.+) version ([0-9\.]+)", version_output)

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
author_email="[email protected]",
2424
url="https://github.com/common-workflow-language/cwl-utils",
2525
license="Apache 2.0",
26-
python_requires=">=3.6",
26+
python_requires=">=3.8",
2727
setup_requires=pytest_runner,
2828
packages=["cwl_utils", "cwl_utils.parser", "cwl_utils.tests", "cwl_utils.testdata"],
2929
package_dir={
@@ -55,8 +55,6 @@
5555
"License :: OSI Approved :: Apache Software License",
5656
"Operating System :: POSIX",
5757
"Operating System :: MacOS :: MacOS X",
58-
"Programming Language :: Python :: 3.6",
59-
"Programming Language :: Python :: 3.7",
6058
"Programming Language :: Python :: 3.8",
6159
"Programming Language :: Python :: 3.9",
6260
"Programming Language :: Python :: 3.10",

0 commit comments

Comments
 (0)