-
Notifications
You must be signed in to change notification settings - Fork 104
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
--update
ignored for packages not in existing lockfile
#386
Comments
I believe the
Only in this situation is it recommended to use the Apologies for the confusion! I noticed that the documentation around the |
Thanks for the reply @srilman ! You could add a simple check at the code I pointed out in the original post: conda-lock/conda_lock/conda_solver.py Line 151 in 854fca9
If my usecase isn't supported, I would suggest that you do something like: for _ in set(update) - conda_locked:
warn(f"--update only works for previously locked packages. Ignoring {_}") I'd almost rather that you Thanks! |
Observed Behavior
Adding a package to an input specs file and then asking for the conda-lock to
--update
that package causes the environment to be completely solved and the--update
request is silently dropped on the floor.Expected Behavior
I would expect one of two reasonable outcomes:
conda-lock
errors and says that it cannot update the lockfile for something not already in the lockfileconda-lock
does the best it can to solve the environment in a way that is consistent with the requirements and fail if the solver can't find a solution.Acknowlegement of Difficulty
If you try to ask conda (
22.11.1
) toupdate
a package that isn't already installed, you get a message like:And then a typical user will likely just
conda install fsspec
and and not realize that it might be impossible to give the solver a set of requirements that would put them back into this exact set of packages because any version requirements they had when previously creating or installing are not maintained acrossconda
invocations (unless they are actually 'pinned').So, I'm definitely not asking for you to make it possible for
conda-lock
to give me an inconsistent environment. There will be plenty of cases that just can't be solved for incrementally adding a new package. However, fail loudly when that happens.Concrete Example
In my case, I want to add
fsspec
to https://github.com/firesim/firesim/blob/a81e3725c11406ea740c3f1a893d344e049f458f/conda-reqs.conda-lock.yml. To do that, I:fsspec
to https://github.com/firesim/firesim/blob/a81e3725c11406ea740c3f1a893d344e049f458f/conda-reqs.yamlconda-lock -f conda-reqs.yaml -p linux-64 --lockfile conda-reqs.conda-lock.yml --update fsspec
NOTE: I don't necessarily install the package into the conda environment because conda-lock doesn't use the contents of the currently active environment in it's calculation of the lockfile, does it?
However, I find that unless package you're trying to add is in the lockfile, the
intersection()
atconda-lock/conda_lock/conda_solver.py
Line 151 in 854fca9
to_update
andconda-lock
effectively re-solves the entire environment, it doesn't use theupdate
code.Also, I think it is mildly confusing to suggest step 1 is installing the package into the currently active environment because it implies that having the packages installed somehow influences how conda-lock creates the lockfile, which I don't think is correct. If you are using a lockfile to reproducibly create an environment, it would probably be better to create the updated lockfile and then use it to create the environment. I haven't tried installing on top of an existing environment to see what happens but I'd expect it to be the same as removing the environment completely and reinstalling everything in the lockfile (but perhaps with optimizations for leaving unchanged packages alone).
Originally posted by @timsnyder-siv in #355 (comment)
The text was updated successfully, but these errors were encountered: