-
Notifications
You must be signed in to change notification settings - Fork 436
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
Avoid KernelManager.pre_start_kernel. Use kernel spec for the REPL instead. #1927
base: master
Are you sure you want to change the base?
Conversation
@devdanzin 👋 thank you so much (again) for your contributions. I've taken a quick look at the code and it seems obvious, clear, simple and smaller than the current solution, so I think we're making progress..! As the CI demonstrates, the test suite doesn't pass. Care to |
Discussion about this implementation can also be found here: #1517 (comment) Taking in consideration our luck with antiviruses interfering with Mu's ability to write and read files from disk it might be more robust if we could find a way that avoid a json file being written to disk. It would still be good to find out if we could use |
I don't have the Jupyter context to know for certain which are the best solutions. I'm happy to be guided by those in the know. @carlosperate I think the temporary pinning of Jupyter for Mu 1.1 might be a path-of-least-resistance option here, although if @devdanzin can confirm Thoughts..? |
It's not that we can't write files, I think the main issue is trying to read the files immediately after writing them to disk, as the antivirus might be locking access to the files while it is analysing them, and that's when Mu errors out. To be fair, this might not be an problem for a tiny JSON file (compare to a larger venv folder), as I would hope the antivirus would take almost no time to clear it, but this is also a case where we are trying to read the file immediately after writing it, and since we haven't replicated the other issues yet, we don't know if this will fall in the same trap. |
This is in response to a discussion in #1517:
KernelManager.pre_start_kernel()
, added in #1240, is not compatible with old versions ofjupyter_client
and is actively causing crashes for our users.This PR removes the subclassing of
QtKernelManager
andpre_start_kernel()
. It uses a kernel spec, which has to be saved to disk, to pass the correct interpreter tojupyter_client
.The whole design is up for discussion. One issue might be persisting invalid specs, because currently it's only created on disk if no kernel exists with the same name we'd use.