-
Notifications
You must be signed in to change notification settings - Fork 5
Description
In #5 (comment), @dalthviz said
The thing with conda-lock is that from what I tested is meant to be used passing to it a .yml (I would say that usually manually created). With that, conda-lock then creates a file with the respective constraints and OS specific packages
Right, that's also what I understood from its Readme. Then, I think we need to create that yaml file on behalf of users. For that we could do the following:
- Ask users on Spyder what packages they would like to install/add/remove from their environments (using a QDialog and a QTableView, for instance).
- Use that information to create/update the
environment.ymlneeded by conda-lock. - Run
conda-lock lock --file <path-to-env-file> --lockfile <path-to-lock-file>to generate/update the lock file. - Run
conda-lock install --prefix <path-to-conda-env>to create/update the associated conda env.
Steps 2. to 4. could be done here, I'd say. (Note: I got these CLI options from https://conda-incubator.github.io/conda-lock/cli/gen/).
With that idea in mind, I also propose to:
- Save both the
environment.ymlandconda.lockfiles per environment in a special, hidden directory declared by this package. - Create environments in a special directory called
~/spyder-envs(or something similar).
I think we'd need to do that because right now we don't have a way to associate envs to projects. So, initially we'd only offer a simple way to create environments.
Finally, I think the import/export functionality for conda-lock could work like this:
- Exporting would consist in allowing users to save the
environment.ymlfor a certain env at a specific location (i.e. out of the special config directory of this package). For that maybe we'd need to add a menu entry to our main menu calledEnvironmentsthat allows users to easily export/import env yaml files. - At import time we'd need to pass a user selected
environment.ymlfile to this package and use conda-lock to run steps 3. and 4 above (i.e.conda-lock lockandconda-lock install).