Turn off conda initialization during incremental compilation?
If you have a using PythonCall inside your package "Foo", then just precompiling Foo will trigger creation of the PythonCall's Conda environment, downloading of packages, etc...
IMO this is undesired. I know there's environment variables to prevent this, but while I remember to set them when actually running a program, its very often I forget during precompilation, especially since precompilation automatically gets triggered at various times (when instantiating, upgrading, etc...)
Wondering if it makes sense to turn that off during precompilation entirely with a check to ccall(:jl_generating_output, Cint, ())? It would mean Python wouldn't be available to any dependent packages during precompilation either, but perhaps thats a better behavior? I don't have the strongest feelings one way or the either, probably leaning slightly that it'd be nicer to make this change, but just wanted to point out.
I agree it would be nice, and I've wondered the same in the past.
However, suppose that Foo does something Pythonic in its __init__ function (e.g. imports a Python module). Now suppose that Bar is another package which depends on Foo. Then to precompile Bar you need to import Foo, which calls Foo.__init__(), which imports a Python module, which requires your Python dependencies to be installed.
So in the current set-up, I don't think this is possible.
Perhaps I could disallow doing anything Pythonic during module init, but I don't think that's a good idea. Ideas welcome!
This issue has been marked as stale because it has been open for 30 days with no activity. If the issue is still relevant then please leave a comment, or else it will be closed in 7 days.
This issue has been closed because it has been stale for 7 days. You can re-open it if it is still relevant.