From 464b2aff8b0260662489f93b386422affb9a876d Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Sun, 25 Oct 2026 06:57:22 +0100 Subject: [PATCH 1/4] Upgrade Python version to 3.15 in CI pipeline --- .github/workflows/pipeline.yml | 40 +++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index 4c8687a3..c997a125 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -52,7 +52,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v7 with: - python-version: "3.13" + python-version: "3.15" architecture: x64 - name: Checkout uses: actions/checkout@v7 @@ -68,7 +68,7 @@ jobs: - uses: actions/checkout@v7 - uses: conda-incubator/setup-miniconda@v4 with: - python-version: "3.13" + python-version: "3.15" miniforge-version: latest channels: conda-forge conda-remove-defaults: "true" @@ -88,7 +88,7 @@ jobs: - uses: actions/checkout@v7 - uses: conda-incubator/setup-miniconda@v4 with: - python-version: '3.14' + python-version: '3.15' miniforge-version: latest channels: conda-forge conda-remove-defaults: "true" @@ -121,11 +121,11 @@ jobs: matrix: include: - operating-system: ubuntu-latest - python-version: '3.14' + python-version: '3.15' environment-file: .ci_support/environment-openmpi.yml - operating-system: ubuntu-latest - python-version: '3.14' + python-version: '3.15' environment-file: .ci_support/environment-mpich.yml steps: @@ -165,7 +165,7 @@ jobs: - name: Setup Mambaforge uses: conda-incubator/setup-miniconda@v4 with: - python-version: "3.13" + python-version: "3.14" miniforge-version: latest channels: conda-forge conda-remove-defaults: "true" @@ -190,7 +190,7 @@ jobs: - name: Setup Mambaforge uses: conda-incubator/setup-miniconda@v4 with: - python-version: "3.13" + python-version: "3.14" miniforge-version: latest channels: conda-forge conda-remove-defaults: "true" @@ -218,7 +218,7 @@ jobs: cat .ci_support/environment-mpich.yml - uses: conda-incubator/setup-miniconda@v3 with: - python-version: '3.13' + python-version: '3.14' miniforge-version: latest channels: conda-forge conda-remove-defaults: "true" @@ -249,7 +249,7 @@ jobs: cat .ci_support/environment-openmpi.yml - uses: conda-incubator/setup-miniconda@v4 with: - python-version: '3.13' + python-version: '3.14' miniforge-version: latest channels: conda-forge conda-remove-defaults: "true" @@ -295,7 +295,7 @@ jobs: run: sudo apt install -y mpich - uses: conda-incubator/setup-miniconda@v4 with: - python-version: '3.13' + python-version: '3.14' miniforge-version: latest channels: conda-forge conda-remove-defaults: "true" @@ -318,13 +318,16 @@ jobs: matrix: include: - operating-system: macos-latest - python-version: '3.14' + python-version: '3.15' - operating-system: ubuntu-24.04-arm - python-version: '3.14' + python-version: '3.15' - operating-system: ubuntu-22.04-arm - python-version: '3.14' + python-version: '3.15' + + - operating-system: ubuntu-latest + python-version: '3.15' - operating-system: ubuntu-latest python-version: '3.14' @@ -362,15 +365,18 @@ jobs: matrix: include: - operating-system: macos-latest - python-version: '3.14' + python-version: '3.15' - operating-system: ubuntu-latest - python-version: '3.14' + python-version: '3.15' - operating-system: ubuntu-24.04-arm - python-version: '3.14' + python-version: '3.15' - operating-system: ubuntu-22.04-arm + python-version: '3.15' + + - operating-system: ubuntu-latest python-version: '3.14' - operating-system: ubuntu-latest @@ -406,7 +412,7 @@ jobs: - uses: actions/checkout@v7 - uses: conda-incubator/setup-miniconda@v4 with: - python-version: "3.14" + python-version: "3.15" miniforge-version: latest channels: conda-forge conda-remove-defaults: "true" From f887292e74d045aac35ad28425b2902f9e7e5f3b Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Sun, 25 Oct 2026 06:58:02 +0100 Subject: [PATCH 2/4] Update Python version requirement to <3.16 --- pyproject.toml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ec8278c3..e477bde2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ authors = [ readme = "README.md" license = { file = "LICENSE" } keywords = ["high performance computing", "hpc", "task scheduler", "slurm", "flux-framework", "executor", "python", "parallel computing", "distributed computing", "scientific computing", "concurrent.futures", "mpi4py", "gpu"] -requires-python = ">3.9, <3.15" +requires-python = ">3.9, <3.16" classifiers = [ "Development Status :: 5 - Production/Stable", "Topic :: Scientific/Engineering :: Physics", @@ -28,6 +28,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", ] dependencies = [ "cloudpickle==3.1.2", From d04d0d26c84ee53d7d29dbf07e54e407ec52b307 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 25 Oct 2026 10:19:49 +0000 Subject: [PATCH 3/4] Fix Executor.map typing for Python 3.15 Co-authored-by: jan-janssen <3854739+jan-janssen@users.noreply.github.com> --- src/executorlib/executor/base.py | 15 ++++++++++----- src/executorlib/task_scheduler/base.py | 24 ++++++++++++++++++++---- 2 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/executorlib/executor/base.py b/src/executorlib/executor/base.py index 72e25ffd..661489d3 100644 --- a/src/executorlib/executor/base.py +++ b/src/executorlib/executor/base.py @@ -6,10 +6,12 @@ from concurrent.futures import ( Future, ) -from typing import Callable, Optional +from typing import Any, Callable, Iterable, Iterator, Optional, TypeVar from executorlib.task_scheduler.base import TaskSchedulerBase +_T = TypeVar("_T") + class BaseExecutor(FutureExecutor, ABC): """ @@ -121,11 +123,12 @@ def submit( # type: ignore def map( self, - fn: Callable, - *iterables, + fn: Callable[..., _T], + *iterables: Iterable[Any], timeout: Optional[float] = None, chunksize: int = 1, - ): + buffersize: Optional[int] = None, + ) -> Iterator[_T]: """Returns an iterator equivalent to map(fn, iter). Args: @@ -149,9 +152,11 @@ def map( """ if self._is_active: return self._task_scheduler.map( - *([fn] + list(iterables)), + fn, + *iterables, timeout=timeout, chunksize=chunksize, + buffersize=buffersize, ) else: raise RuntimeError("cannot schedule new futures after shutdown") diff --git a/src/executorlib/task_scheduler/base.py b/src/executorlib/task_scheduler/base.py index fd58e958..65144a6b 100644 --- a/src/executorlib/task_scheduler/base.py +++ b/src/executorlib/task_scheduler/base.py @@ -1,5 +1,6 @@ import contextlib import queue +import sys from concurrent.futures import ( Executor as FutureExecutor, ) @@ -7,12 +8,14 @@ Future, ) from threading import Thread -from typing import Callable, Optional, Union +from typing import Any, Callable, Iterable, Iterator, Optional, TypeVar, Union from executorlib.standalone.inputcheck import check_resource_dict from executorlib.standalone.queue import cancel_items_in_queue from executorlib.standalone.serialize import cloudpickle_register +_T = TypeVar("_T") + def validate_resource_dict(resource_dict: dict): """ @@ -179,11 +182,12 @@ def submit( # type: ignore def map( self, - fn: Callable, - *iterables, + fn: Callable[..., _T], + *iterables: Iterable[Any], timeout: Optional[float] = None, chunksize: int = 1, - ): + buffersize: Optional[int] = None, + ) -> Iterator[_T]: """Returns an iterator equivalent to map(fn, iter). Args: @@ -212,6 +216,14 @@ def map( i.result() if isinstance(i, Future) else i for i in iterables ) + if sys.version_info >= (3, 14): + return super().map( + fn, + *iterables, + timeout=timeout, + chunksize=chunksize, + buffersize=buffersize, + ) return super().map(fn, *iterables, timeout=timeout, chunksize=chunksize) def shutdown(self, wait: bool = True, *, cancel_futures: bool = False): @@ -263,6 +275,10 @@ def __len__(self) -> int: queue_size = self._future_queue.qsize() return queue_size + def __bool__(self) -> bool: + """Return True regardless of the number of queued futures.""" + return True + def __del__(self): """ Clean-up the resources associated with the Executor. From 5d8a6fdfe05b801cb56b4461ad06b5abdce1c6c6 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 25 Oct 2026 10:26:22 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- src/executorlib/executor/base.py | 3 ++- src/executorlib/task_scheduler/base.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/executorlib/executor/base.py b/src/executorlib/executor/base.py index 661489d3..552f182f 100644 --- a/src/executorlib/executor/base.py +++ b/src/executorlib/executor/base.py @@ -1,12 +1,13 @@ import queue from abc import ABC +from collections.abc import Iterable, Iterator from concurrent.futures import ( Executor as FutureExecutor, ) from concurrent.futures import ( Future, ) -from typing import Any, Callable, Iterable, Iterator, Optional, TypeVar +from typing import Any, Callable, Optional, TypeVar from executorlib.task_scheduler.base import TaskSchedulerBase diff --git a/src/executorlib/task_scheduler/base.py b/src/executorlib/task_scheduler/base.py index 65144a6b..34534950 100644 --- a/src/executorlib/task_scheduler/base.py +++ b/src/executorlib/task_scheduler/base.py @@ -1,6 +1,7 @@ import contextlib import queue import sys +from collections.abc import Iterable, Iterator from concurrent.futures import ( Executor as FutureExecutor, ) @@ -8,7 +9,7 @@ Future, ) from threading import Thread -from typing import Any, Callable, Iterable, Iterator, Optional, TypeVar, Union +from typing import Any, Callable, Optional, TypeVar, Union from executorlib.standalone.inputcheck import check_resource_dict from executorlib.standalone.queue import cancel_items_in_queue