diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1fb57ef..7f7a5c0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -41,7 +41,7 @@ jobs: fail-fast: false matrix: os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] - python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] steps: - uses: actions/checkout@v6 diff --git a/docs/source/changes.md b/docs/source/changes.md index e2ab1c8..308df57 100644 --- a/docs/source/changes.md +++ b/docs/source/changes.md @@ -5,6 +5,10 @@ chronological order. Releases follow [semantic versioning](https://semver.org/) releases are available on [PyPI](https://pypi.org/project/pytask-parallel) and [Anaconda.org](https://anaconda.org/conda-forge/pytask-parallel). +## Unreleased + +- {pull}`129` drops support for Python 3.8 and 3.9 and adds support for Python 3.14. + ## 0.5.1 - 2025-03-09 - {pull}`114` drops support for Python 3.8 and adds support for Python 3.13. diff --git a/pyproject.toml b/pyproject.toml index 1b3452d..1b52840 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ classifiers = [ "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", ] -requires-python = ">=3.9" +requires-python = ">=3.10" dependencies = [ "attrs>=21.3.0", "click>=8.1.8,!=8.2.0", diff --git a/src/pytask_parallel/backends.py b/src/pytask_parallel/backends.py index 06a3f5e..f5aa6ee 100644 --- a/src/pytask_parallel/backends.py +++ b/src/pytask_parallel/backends.py @@ -8,14 +8,17 @@ from concurrent.futures import ProcessPoolExecutor from concurrent.futures import ThreadPoolExecutor from enum import Enum +from typing import TYPE_CHECKING from typing import Any -from typing import Callable from typing import ClassVar import cloudpickle from attrs import define from loky import get_reusable_executor +if TYPE_CHECKING: + from collections.abc import Callable + __all__ = ["ParallelBackend", "ParallelBackendRegistry", "WorkerType", "registry"] diff --git a/src/pytask_parallel/utils.py b/src/pytask_parallel/utils.py index 1db9ab2..7688b01 100644 --- a/src/pytask_parallel/utils.py +++ b/src/pytask_parallel/utils.py @@ -6,7 +6,6 @@ from functools import partial from typing import TYPE_CHECKING from typing import Any -from typing import Callable from pytask import NodeLoadError from pytask import PNode @@ -19,6 +18,7 @@ from pytask_parallel.typing import is_local_path if TYPE_CHECKING: + from collections.abc import Callable from concurrent.futures import Future from pathlib import Path from types import ModuleType diff --git a/tests/conftest.py b/tests/conftest.py index 084397a..5bc9dcf 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -2,13 +2,16 @@ import sys from contextlib import contextmanager -from typing import Callable +from typing import TYPE_CHECKING import pytest from click.testing import CliRunner from nbmake.pytest_items import NotebookItem from pytask import storage +if TYPE_CHECKING: + from collections.abc import Callable + class SysPathsSnapshot: """A snapshot for sys.path.""" diff --git a/tests/test_execute.py b/tests/test_execute.py index 761169a..c06919a 100644 --- a/tests/test_execute.py +++ b/tests/test_execute.py @@ -266,9 +266,11 @@ def test_task_without_path_that_return(runner, tmp_path, parallel_backend): @pytest.mark.parametrize("parallel_backend", _IMPLEMENTED_BACKENDS) def test_parallel_execution_is_deactivated(runner, tmp_path, flag, parallel_backend): tmp_path.joinpath("task_example.py").write_text("def task_example(): pass") + input_ = "c\n" if flag == "--trace" else None result = runner.invoke( cli, [tmp_path.as_posix(), "-n", "2", "--parallel-backend", parallel_backend, flag], + input=input_, ) assert result.exit_code == ExitCode.OK assert "Started 2 workers" not in result.output