-
Notifications
You must be signed in to change notification settings - Fork 15
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
Conda-Forge Julia interop #19
Comments
Currently there's no option to do this - CondaPkg always creates a Conda environment per Julia project. Of course this behaviour could be changed given a good reason. With the Conda distribution of Julia, are you allowed to use multiple Julia projects per Conda environment? I'm not sure it makes sense to tie these all to the same Conda environment, since the point of projects is to have independent dependencies. I'm also a bit wary of special-casing the behaviour of CondaPkg depending on which Julia distribution one is using. |
In the 1.7 branch, via the above activate.sh script, we create a new Julia depot per conda environment. What we basically need are two settings:
One option would be just to use the same variables as Conda.jl. Another might be to use the more modern Preferences.jl. |
Ok, I'll think about adding an "external" backend to allow the user to use a pre-existing Conda environment, triggered by an environment variable. Such a backend would differ quite a bit from the default behaviour of CondaPkg. First, it would use the same Conda environment for all Julia projects. Second (and less important), it would never remove unneeded packages. As such I'm not convinced you should set this as the default behaviour. That's up to you though. |
I think what we are really advocating for here is just to avoid reinstalling conda/mamba. So I don't think you should change anything in your setup, except to use the conda environment already existing as base. From there, you can make as many conda/julia envs as you want (we also added stacking support). Does that make sense? In my view, this is part is not necessary:
How does your CondaPkg handle the base conda environment? Just have it take as the conda env where the julia from conda-forge (from julia-feedstock) is installed. So, let's say someone makes a conda env called |
A more interesting question for me is how does your package handle shared dependencies? Say, |
To be slightly more specific, I think only control-flow-type additions are needed around: here: here: here: The last part tells me you're essentially setting up a new base and relying on it to branch out. This could be changed by replacing I guess though, you'd likely have to change a lot more because you've built this entire thing around this MAMBA (I am not sure where it comes from) so maybe it is better for us to target interop upstream with mamba and then it will trickle down here. Does that sound like a better idea, @cjdoris? |
I think there's some confusion in terminology, because Conda conflates two separate things:
Presently, CondaPkg.jl uses the MicroMamba executable and root prefix supplied by the MicroMamba.jl package. With this, it creates a Conda environment specific to the current Julia project. One thing it would be easy to add would be the ability to configure CondaPkg.jl to use a different executable and root prefix (which I'll call the "backend"). I was always intending to add multiple backends to CondaPkg.jl but haven't yet. For example, there could be a "SystemConda" backend which uses whichever What I initially thought you were asking for was the ability to force CondaPkg.jl not to create its own project-specific environment, but instead use some fixed Conda environment. This pretty much goes against the central feature of CondaPkg.jl (separation of dependencies between projects) so I'm much less in favour of this. |
Okay, I see. Thanks for explaining this --- obviously my response above was conflating micromamba with mamba 😅 Wouldn't be easier if we just talk to the MicroMamba.jl team and have them set their root prefix as |
I am the MicroMamba.jl team! 😄 The job of that package is very simple - to give you a working micromamba installation isolated from the rest of your system, so it's not the place for these changes. However it will be simple to add a "SystemConda" backend to CondaPkg.jl to use a pre-installed Conda (and its root prefix) instead of using MicroMamba.jl. It would be activated by setting the env var |
Major plot twist 🤯 |
OK it was simple so I did it. You can now set Not released yet, but on the main branch if you want to try it out. |
Closing since I added the backend. Let me know if you have more questions. |
Thanks! Has this been released yet? |
Good point, I've just triggered a release. |
The julia-feedstock at conda-forge allows one to install julia as part of the conda environment. In this case, perhaps we would should set environmental variables such that CondaPkg.jl uses the same conda environment. How do we do this?
https://github.com/conda-forge/julia-feedstock/blob/master/recipe/scripts/activate.sh
The text was updated successfully, but these errors were encountered: