-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix copy manager functionality so it works under Python >= 3.8 on OS X #818
Conversation
In Python 3.8, local objects can't be pickled anymore which means we need to move that class definition to a top module level scope so it can be pickled by the multiprocess functionality. See https://gist.github.com/Kami/8386c79d2db7c95329e6c182ec639f49 and spack/spack#14102 for more details.
@Kami The copying manager-related test still fails. CPython switched to the spawn method from the fork in 3.8, I guess that's why |
@ArthurKamalov Thanks. Tests were passing locally after I made this change, but it looks like I missed the spawn change which is also needed. For now, I will indeed likely looking into skipping those tests on OS X. |
work there under Python 3.8.
@ArthurKamalov Pushed a change to also skip multiprocess copying manager worker tests under OS X. On a related note, does the same issue also exists on Linux? If so, we will want to fix this so we can still use multiprocess functionality on Linux under Python >= 3.8. |
Codecov Report
@@ Coverage Diff @@
## master #818 +/- ##
==========================================
- Coverage 78.42% 78.38% -0.04%
==========================================
Files 164 164
Lines 37884 37885 +1
Branches 4434 4434
==========================================
- Hits 29709 29693 -16
- Misses 7090 7098 +8
- Partials 1085 1094 +9
|
I pushed the commit which enables smoke and unit tests for python 3.8. The smoke test seems like working, but the unit test hasn't appeared in CircleCI for some reason. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This pull request fixes copy manager functionality and related tests so they work on OS X when using Python >= 3.8.
In Python 3.8, local scoped objects can't be pickled anymore so the code fails. The solution is to use
_SharedObjectManager
class definition which is used for communication and is pickled by the multiprocessing framework to a top level scope.Related links: