From 971ae6edcf51ee7564fb113991c87f8d9272685b Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 29 Nov 2023 11:39:11 -0700 Subject: [PATCH 1/3] Enable python 3.12 build action --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 84a448fd..55a31eb7 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.11"] + python-version: ["3.11", "3.12"] steps: - uses: actions/checkout@v3 From 06e5cf3baa35383eb27b88dd43300f59e8dff442 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 29 Nov 2023 12:09:07 -0700 Subject: [PATCH 2/3] Remove fork from start method testing fork is no longer supported and so should not be included in the tests. --- tests/test_executors.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_executors.py b/tests/test_executors.py index df4091d6..92dccea7 100644 --- a/tests/test_executors.py +++ b/tests/test_executors.py @@ -274,7 +274,6 @@ def test_mpexec_mp(self): methods = ["spawn"] if sys.platform == "linux": - methods.append("fork") methods.append("forkserver") for method in methods: From 4511f12ad35410a5fe96e51112d33cf942ced7fe Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Wed, 29 Nov 2023 13:38:38 -0700 Subject: [PATCH 3/3] Force the default start method to spawn This will no longer be necessary in python 3.14 but for now doing this removes some deprecation warnings from the multiprocessing tests. --- tests/test_executors.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_executors.py b/tests/test_executors.py index 92dccea7..26b1d58f 100644 --- a/tests/test_executors.py +++ b/tests/test_executors.py @@ -30,6 +30,7 @@ import faulthandler import logging +import multiprocessing import os import signal import sys @@ -704,5 +705,15 @@ def test_clobber_outputs_execute(self) -> None: self.assertEqual(dataset_id_1, dataset_id_3) +def setup_module(module): + """Force spawn to be used if no method given explicitly. + + This can be removed when Python 3.14 changes the default. + """ + multiprocessing.set_start_method("spawn", force=True) + + if __name__ == "__main__": + # Do not need to force start mode when running standalone. + multiprocessing.set_start_method("spawn") unittest.main()