JuliaPy / CondaPkg.jl

Add Conda dependencies to your Julia project
MIT License
121 stars 14 forks source link

using CondaPkg with Pluto leads to unnecesarry resolves #120

Closed schlichtanders closed 10 months ago

schlichtanders commented 11 months ago

Hi

I am integrating CondaPkg with Pluto and realized that I have a lot of overhead everytime I start a new Pluto notebook despite all condapkg already being installed.

I debugged it a bit and saw that it is due to a meta file which, if it is missing, triggers a complete reinstall.

The situation for me is that Pluto always creates a fresh new Julia environment (temporary) when opening a notebook. The CondaPkg.toml will be written into it.

I think two steps would be needed to make the conda resolve work in such Pluto scenario:

  1. place the meta file inside the conda environment instead of the julia environment
  2. make the meta file check not compare creation times of CondaPkg.toml and the meta file (this would still invalidate), but rather use a hash of the CondaPkg.toml file

What do you think?

schlichtanders commented 11 months ago

@cjdoris I have resource to create a pullrequest. Would you like to have this changed?

schlichtanders commented 10 months ago

My current thought is that it might be the better approach to extend Pluto with a feature to preserve environments.

schlichtanders commented 10 months ago

My current thought is that it might be the better approach to extend Pluto with a feature to preserve environments.

this was much simpler and already worked out.

stillyslalom commented 6 months ago

@schlichtanders what solution did you arrive at? I'm using Preferences.jl to set a shared Conda environment by default for a package, but the preference is ignored by Pluto, which leads to a minute or more of Conda resolve time every time the notebook is launched.

schlichtanders commented 6 months ago

I have my own fork of Pluto where I now create a hashed project directory instead of a random one. This way I am resolving this issue. Unfortunately I haven't found a workaround without changing Pluto

stillyslalom commented 6 months ago

Do you know if there's already an issue filed in the Pluto repo? I couldn't find one, but I'll create one if it doesn't exist.

schlichtanders commented 6 months ago

I haven't created one. But I probably could extract some parts of my fork in order to solve a respective issue. Can't promise how much time I have though