diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index e331e72d..d42e2c8b 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -20,7 +20,7 @@ jobs: strategy: matrix: py-ver-major: [3] - py-ver-minor: [8, 9, 10, 11, 12] + py-ver-minor: [8, 9, 10, 11, 12, 13] step: [lint, unit, bandit, mypy] env: diff --git a/cwl_utils/__meta__.py b/cwl_utils/__meta__.py index 088ff715..32c28088 100644 --- a/cwl_utils/__meta__.py +++ b/cwl_utils/__meta__.py @@ -1,3 +1,3 @@ # SPDX-License-Identifier: Apache-2.0 """Global version number for the cwl_utils package.""" -__version__ = "0.33" +__version__ = "0.34" diff --git a/pyproject.toml b/pyproject.toml index 7d2e1f16..01ba0a89 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -29,7 +29,7 @@ classifiers = [ "Topic :: System :: Distributed Computing", "Typing :: Typed", ] -requires-python = ">=3.8" +requires-python = ">=3.8,<3.14" dynamic = ["version", "dependencies"] [project.urls] diff --git a/tests/test_etools_to_clt.py b/tests/test_etools_to_clt.py index bf5eb84c..378b281c 100644 --- a/tests/test_etools_to_clt.py +++ b/tests/test_etools_to_clt.py @@ -2,9 +2,10 @@ """Test the CWL Expression refactoring tool.""" import os import shutil +import sys import tarfile from pathlib import Path -from typing import Generator +from typing import TYPE_CHECKING, Generator, cast import pytest import requests @@ -22,6 +23,9 @@ from .util import get_data +if TYPE_CHECKING: + from http.client import HTTPResponse + def test_v1_0_workflow_top_level_format_expr() -> None: """Test for the correct error when converting a format expression in a workflow level input.""" @@ -244,11 +248,17 @@ def cwl_v1_0_dir( ) -> Generator[str, None, None]: """Download the CWL 1.0.2 specs and return a path to the directory.""" tmp_path = tmp_path_factory.mktemp("cwl_v1_0_dir") - with requests.get( - "https://github.com/common-workflow-language/common-workflow-language/archive/v1.0.2.tar.gz", - stream=True, - ).raw as specfileobj: + with cast( + "HTTPResponse", + requests.get( + "https://github.com/common-workflow-language/common-workflow-language/archive/v1.0.2.tar.gz", + stream=True, + ).raw, + ) as specfileobj: tf = tarfile.open(fileobj=specfileobj) - tf.extractall(path=tmp_path) + if sys.version_info > (3, 12): + tf.extractall(path=tmp_path, filter="data") + else: + tf.extractall(path=tmp_path) yield str(tmp_path / "common-workflow-language-1.0.2") shutil.rmtree(os.path.join(tmp_path)) diff --git a/tests/test_examples.py b/tests/test_examples.py index 4027f7e1..db2fe7c2 100644 --- a/tests/test_examples.py +++ b/tests/test_examples.py @@ -1,6 +1,7 @@ # SPDX-License-Identifier: Apache-2.0 """Tests of example Python scripts.""" import os +import runpy from pathlib import Path @@ -9,11 +10,7 @@ def test_load_example() -> None: cwd = Path.cwd() parent = Path(__file__).resolve().parent os.chdir(parent.parent) - exec( - open(parent / "load_cwl_by_path.py").read(), - globals(), - locals(), - ) + result_raw = runpy.run_path(str(parent / "load_cwl_by_path.py")) os.chdir(cwd) - result = locals()["saved_obj"] + result = result_raw["saved_obj"] assert result["class"] == "Workflow" diff --git a/tox.ini b/tox.ini index 651ba372..7f862333 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,9 @@ [tox] envlist = - py3{8,9,10,11,12}-lint, - py3{8,9,10,11,12}-unit, - py3{8,9,10,11,12}-bandit, - py3{8,9,10,11,12}-mypy, + py3{8,9,10,11,12,13}-lint, + py3{8,9,10,11,12,13}-unit, + py3{8,9,10,11,12,13}-bandit, + py3{8,9,10,11,12,13}-mypy, py312-lint-readme, py312-pydocstyle isolated_build = True @@ -19,13 +19,14 @@ python = 3.10: py310 3.11: py311 3.12: py312 + 3.13: py313 [testenv] description = - py3{8,9,10,11,12}-unit: Run the unit tests - py3{8,9,10,11,12}-lint: Lint the Python code - py3{8,9,10,11,12}-bandit: Search for common security issues - py3{8,9,10,11,12}-mypy: Check for type safety + py3{8,9,10,11,12,13}-unit: Run the unit tests + py3{8,9,10,11,12,13}-lint: Lint the Python code + py3{8,9,10,11,12,13}-bandit: Search for common security issues + py3{8,9,10,11,12,13}-mypy: Check for type safety py312-pydocstyle: docstring style checker py312-lint-readme: Lint the README.rst->.md conversion @@ -33,34 +34,34 @@ passenv = CI GITHUB_* deps = - py3{8,9,10,11,12}-{unit,mypy}: -rrequirements.txt - py3{8,9,10,11,12}-{unit,mypy}: -rtest-requirements.txt - py3{8,9,10,11,12}-lint: -rlint-requirements.txt - py3{8,9,10,11,12}-bandit: bandit - py3{8,9,10,11,12}-mypy: -rmypy-requirements.txt + py3{8,9,10,11,12,13}-{unit,mypy}: -rrequirements.txt + py3{8,9,10,11,12,13}-{unit,mypy}: -rtest-requirements.txt + py3{8,9,10,11,12,13}-lint: -rlint-requirements.txt + py3{8,9,10,11,12,13}-bandit: bandit + py3{8,9,10,11,12,13}-mypy: -rmypy-requirements.txt setenv = - py3{8,9,10,11,12}-unit: LC_ALL = C.UTF-8 + py3{8,9,10,11,12,13}-unit: LC_ALL = C.UTF-8 commands = - py3{8,9,10,11,12}-unit: python -m pip install -U pip setuptools wheel - py3{8,9,10,11,12}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs} - py3{8,9,10,11,12}-bandit: bandit --recursive cwl_utils - py3{8,9,10,11,12}-lint: make flake8 - py3{8,9,10,11,12}-lint: make format-check - py3{8,9,10,11,12}-mypy: make mypy + py3{8,9,10,11,12,13}-unit: python -m pip install -U pip setuptools wheel + py3{8,9,10,11,12,13}-unit: make coverage-report coverage.xml PYTEST_EXTRA={posargs} + py3{8,9,10,11,12,13}-bandit: bandit --recursive cwl_utils + py3{8,9,10,11,12,13}-lint: make flake8 + py3{8,9,10,11,12,13}-lint: make format-check + py3{8,9,10,11,12,13}-mypy: make mypy allowlist_externals = - py3{8,9,10,11,12}-lint: flake8 - py3{8,9,10,11,12}-lint: black - py3{8,9,10,11,12}-{mypy,shellcheck,lint,unit}: make + py3{8,9,10,11,12,13}-lint: flake8 + py3{8,9,10,11,12,13}-lint: black + py3{8,9,10,11,12,13}-{mypy,shellcheck,lint,unit}: make skip_install = - py3{8,9,10,11,12}-lint: true - py3{8,9,10,11,12}-bandit: true + py3{8,9,10,11,12,13}-lint: true + py3{8,9,10,11,12,13}-bandit: true extras = - py3{8,9,10,11,12}-unit: pretty + py3{8,9,10,11,12,13}-unit: pretty [testenv:py312-pydocstyle] allowlist_externals = make