Load CondaPkg lazily, and drop Pkg as a dependency#752
Load CondaPkg lazily, and drop Pkg as a dependency#752JamesWrigley wants to merge 3 commits intoJuliaPy:mainfrom
Conversation
This shaves ~0.5s off the load time if `JULIA_PYTHONCALL_EXE` is set.
This removes ~0.4s from the load time.
|
(bump) |
|
Thanks, it's a nice idea, however doing runtime imports like this is not allowed in Julia as it breaks precompilation. I don't totally understand how but there are issues/PRs about it somewhere... What we CAN do though is, once the PR for using Preferences.jl is merged, avoid loading CondaPkg if the Closing as the approach is unsound but happy to take a PR for the preferences way. |
|
Ok, that works for me too 👍 |
Combined, these reduce the load time with
JULIA_PYTHONCALL_EXEset from ~1.3s to ~0.3s on my machine.Note that removing Pkg as a dependency could be breaking if packages are depending on accessing Pkg in the juliacall module. But, only
Mainis documented as being available so it is technically ok to remove it in a nonbreaking release: https://juliapy.github.io/PythonCall.jl/stable/juliacall-reference/#Constants