JuliaPy / CondaPkg.jl

Add Conda dependencies to your Julia project
MIT License
119 stars 13 forks source link

create environment in scratch space? #34

Closed Roger-luo closed 2 years ago

Roger-luo commented 2 years ago

I'm wondering if it's possible to create the environment in scratch space instead of a separate place managed by CondaPkg. Since if we create the env in scratch space then Pkg's gc can managed those places and delete them when deleting the package.

currently I notice when I add a package under a package project env, the env is created under the project instead of its scratch space, but I can also see the dependency on Scratch.jl so I'm not sure if it actually uses the scratch space.

cjdoris commented 2 years ago

Yeah I've thought about this before - I agree it would be nice to let the GC clean these up. The issue with scratch spaces is that if your project doesn't have a UUID (i.e. doesn't have a Project.toml) then the scratch space is put somewhere global. I guess we could use scratch spaces in the case there is a UUID and the current behaviour otherwise.

Scratch.jl is used by MicroMamba.jl to store the package cache (root prefix).

Roger-luo commented 2 years ago

I hit another issue due to this - when using Bloqade which depends on PythonCall that requires matplotlib in Pluto notebook, since Pluto will initialize the project in temporary directory, CondaPkg seems to be creating the env there too, which does not have executation rights

image
cjdoris commented 2 years ago

OK, having thought about the scratch-space idea some more, I've concluded that it doesn't make much sense:

So I'll stick with the current behaviour of using a .CondaPkg directory under the project directory.

Feel free to reopen if you want to discuss further.

cjdoris commented 2 years ago

(I'll also note that if you delete a project, then since the conda environment is in a subdirectory, then it gets deleted too. So I think the original GC motivation wasn't actually going to help.)