From a74b0225fca80112267d685f30a1a20b6e2556e3 Mon Sep 17 00:00:00 2001 From: Max Muoto Date: Sat, 10 May 2025 15:23:02 -0500 Subject: [PATCH 1/4] Update ProcessPoolExecutor for 3.14 --- stdlib/@tests/stubtest_allowlists/py314.txt | 6 ------ stdlib/concurrent/futures/_base.pyi | 16 +++++++++++++--- stdlib/concurrent/futures/process.pyi | 4 ++++ 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index e9a9bb9ad501..8d2270ebb446 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -317,17 +317,11 @@ compression.zstd concurrent.futures.__all__ concurrent.futures.Executor.map concurrent.futures.InterpreterPoolExecutor -concurrent.futures.ProcessPoolExecutor.kill_workers -concurrent.futures.ProcessPoolExecutor.map -concurrent.futures.ProcessPoolExecutor.terminate_workers concurrent.futures.ThreadPoolExecutor.BROKEN concurrent.futures.ThreadPoolExecutor.prepare_context concurrent.futures.__all__ concurrent.futures._base.Executor.map concurrent.futures.interpreter -concurrent.futures.process.ProcessPoolExecutor.kill_workers -concurrent.futures.process.ProcessPoolExecutor.map -concurrent.futures.process.ProcessPoolExecutor.terminate_workers concurrent.futures.thread.ThreadPoolExecutor.BROKEN concurrent.futures.thread.ThreadPoolExecutor.prepare_context concurrent.futures.thread.WorkerContext diff --git a/stdlib/concurrent/futures/_base.pyi b/stdlib/concurrent/futures/_base.pyi index 7294b69567d6..f5a007117463 100644 --- a/stdlib/concurrent/futures/_base.pyi +++ b/stdlib/concurrent/futures/_base.pyi @@ -54,9 +54,19 @@ class Future(Generic[_T]): class Executor: def submit(self, fn: Callable[_P, _T], /, *args: _P.args, **kwargs: _P.kwargs) -> Future[_T]: ... - def map( - self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = None, chunksize: int = 1 - ) -> Iterator[_T]: ... + if sys.version_info >= (3, 14): + def map( + self, + fn: Callable[..., _T], + *iterables: Iterable[Any], + timeout: float | None = None, + chunksize: int = 1, + buffersize: int | None = None, + ) -> Iterator[_T]: ... + else: + def map( + self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = None, chunksize: int = 1 + ) -> Iterator[_T]: ... def shutdown(self, wait: bool = True, *, cancel_futures: bool = False) -> None: ... def __enter__(self) -> Self: ... def __exit__( diff --git a/stdlib/concurrent/futures/process.pyi b/stdlib/concurrent/futures/process.pyi index 9c904f793fa9..607990100369 100644 --- a/stdlib/concurrent/futures/process.pyi +++ b/stdlib/concurrent/futures/process.pyi @@ -236,3 +236,7 @@ class ProcessPoolExecutor(Executor): def _start_executor_manager_thread(self) -> None: ... def _adjust_process_count(self) -> None: ... + + if sys.version_info >= (3, 14): + def kill_workers(self) -> None: ... + def terminate_workers(self) -> None: ... From 2cf7b342005facaf0b66217f757bd40cd917744b Mon Sep 17 00:00:00 2001 From: Max Muoto Date: Sat, 10 May 2025 15:24:58 -0500 Subject: [PATCH 2/4] Remove additional ignores --- stdlib/@tests/stubtest_allowlists/py314.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 223984bc7550..94fe1ca367bd 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -303,11 +303,10 @@ compression.lzma compression.zlib compression.zstd concurrent.futures.__all__ -concurrent.futures.Executor.map concurrent.futures.InterpreterPoolExecutor concurrent.futures.ThreadPoolExecutor.BROKEN concurrent.futures.ThreadPoolExecutor.prepare_context -concurrent.futures._base.Executor.map +concurrent.futures.__all__ concurrent.futures.interpreter concurrent.futures.thread.ThreadPoolExecutor.BROKEN concurrent.futures.thread.ThreadPoolExecutor.prepare_context From d254b9d46a13f7c35f4ffd8ac7d2be7d3ada5f9a Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 10 May 2025 20:25:16 +0000 Subject: [PATCH 3/4] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/concurrent/futures/_base.pyi | 1 + 1 file changed, 1 insertion(+) diff --git a/stdlib/concurrent/futures/_base.pyi b/stdlib/concurrent/futures/_base.pyi index f5a007117463..fbf07a3fc78f 100644 --- a/stdlib/concurrent/futures/_base.pyi +++ b/stdlib/concurrent/futures/_base.pyi @@ -67,6 +67,7 @@ class Executor: def map( self, fn: Callable[..., _T], *iterables: Iterable[Any], timeout: float | None = None, chunksize: int = 1 ) -> Iterator[_T]: ... + def shutdown(self, wait: bool = True, *, cancel_futures: bool = False) -> None: ... def __enter__(self) -> Self: ... def __exit__( From 0ccd94042eed29ba728bc2d18f2eb5e13b7459b8 Mon Sep 17 00:00:00 2001 From: Max Muoto Date: Sat, 10 May 2025 15:25:24 -0500 Subject: [PATCH 4/4] Remove extra --- stdlib/@tests/stubtest_allowlists/py314.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/@tests/stubtest_allowlists/py314.txt b/stdlib/@tests/stubtest_allowlists/py314.txt index 94fe1ca367bd..084d866182f6 100644 --- a/stdlib/@tests/stubtest_allowlists/py314.txt +++ b/stdlib/@tests/stubtest_allowlists/py314.txt @@ -306,7 +306,6 @@ concurrent.futures.__all__ concurrent.futures.InterpreterPoolExecutor concurrent.futures.ThreadPoolExecutor.BROKEN concurrent.futures.ThreadPoolExecutor.prepare_context -concurrent.futures.__all__ concurrent.futures.interpreter concurrent.futures.thread.ThreadPoolExecutor.BROKEN concurrent.futures.thread.ThreadPoolExecutor.prepare_context