Use multiprocessing get_context
and python 3.12
#249
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Python 3.12 added a warning when the
fork
method (default of linux) was used for multiprocessing if a process contains threads:This warning can be seen in the logs for one of the
devdeps
jobs that uses python 3.12:https://github.com/spacetelescope/stcal/actions/runs/8110832059/job/22168896740#step:10:169
This PR switches the method to
forkserver
using aget_context
(to only effect the calls on the context).This PR will allow jwst to remove the global calls to
set_start_method
which as noted in spacetelescope/jwst#8306 can lead to unexpected behavior.This PR for jwst removes
set_start_method
(and requires the source branch for this PR for sctal):spacetelescope/jwst#8343
The python 3.12 run shows no
DeprecationWarning
mentioningfork
:https://github.com/spacetelescope/jwst/actions/runs/8253314996/job/22574879663?pr=8343
Finally this PR adds a non-devdeps python 3.12 test job to the CI (which illustrates that the above changes remove the warning from the test suite).
Checklist
CHANGES.rst
(either inBug Fixes
orChanges to API
)