-
Notifications
You must be signed in to change notification settings - Fork 103
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
Removing dependencies from an existing lock file #196
Comments
Not removing obsolete dependencies is indeed problematic and probably not a desirable behavior. |
Workaround for conda/conda-lock#196.
Just checking to see if this issue has been resolved in |
* Rename earthdata to earthaccess Package was renamed from earthdata to earthaccess in nsidc/earthaccess#181, and reflected on conda-forge at v0.4.5. * [condalock-command] autogenerated conda-lock files * Regenerate conda-lock.yml files from scratch Deleting the conda-lock.yml files and manually running `conda-lock lock` again to remove packages that are not needed anymore. Not locking the forge file as it took too long. * Delete conda-lock.yml before locking Workaround for conda/conda-lock#196. * Manually re-lock forge image Ran `conda-lock lock -f environment.yml -f ../pangeo-notebook/environment.yml -f ../base-notebook/environment.yml -p linux-64` locally in the `forge/` folder. --------- Co-authored-by: pangeo-bot <pangeo-bot@users.noreply.github.com>
As far as I know this is unfortunately not yet resolved. |
Today I stumbled on a nasty consequence of this behavior. In my case, I had a dependency in the The result was that the same dependency was listed twice in I created a repository that walks through a simplified version of what I experienced, without the dependency conflicts: https://github.com/mfisher87/sscce-conda-lock-pip-ghosts The real-world scenario I encountered was that we upgraded an old environment.yml file containing |
Given this behavior can lead to envs that don't reproduce as expected, could this issue be pinned to help confused folks like myself find it? |
Thinking about digging in to this as an exercise this weekend. From an outside perspective, without having any design context, I'd expect conda-lock to replace the previous lockfile wholesale every time a solve is completed successfully. Are there reasons not to do that, or would there be major challenges in implementing such behavior? Thanks all for being welcoming to questions! ❤️ |
…or lock Addresses conda#196: for requested platforms replaces lock content without erroneously persisting packages. Co-authored-by: Arie Knoester <arikstr@gmail.com> Reviewed-by: Matt Fisher <mfisher87@gmail.com>
We took a stab at this. I feel like multiple sources (which I don't fully understand the use case for, and haven't found docs for yet) may be a confounding factor for our solution. Our naive understanding is that we need to retain support for per-platform updates, so we can't simply blow away the config file and drop in a new one. Draft PR coming soon :) |
…or lock Addresses conda#196: for requested platforms replaces lock content without erroneously persisting packages. Co-authored-by: Arie Knoester <arikstr@gmail.com> Reviewed-by: Matt Fisher <mfisher87@gmail.com>
Sorry for my lack of responsiveness this past weekend. FWIW I don't understand or like the current behavior, and consequently I always delete the I'd like to see things done differently, and would be supportive of doing a major release to change this behavior. @mariusvniekerk, are there any good reasons for keeping the current behavior which I should know about? Also @bollwyvl? |
I hadn't noticed these issues, mostly as I don't use the In some other lockfile-based systems i've used, once a named entry appears in the lock, it will never get updated unless something new comes along that can be met by the existing entry, and all unused entries will be removed at the end. If the In conda(-forge)-land, generally when I relock, I want the freshest packages that I haven't pinned, and with mutable upstream state like |
Never a problem in my mind! Hope you got away from work for a bit :)
Yes, once I discovered this behavior, I realized I should be doing the same... but I don't want to 😆 Maybe a
I'm not sure I understand this as written; should "can" actually be "can not"? I.e. once an entry, e.g. |
…or lock Addresses conda#196: for requested platforms replaces lock content without erroneously persisting packages. Co-authored-by: Arie Knoester <arikstr@gmail.com> Reviewed-by: Matt Fisher <mfisher87@gmail.com>
…or lock Addresses conda#196: for requested platforms replaces lock content without erroneously persisting packages. Co-authored-by: Arie Knoester <arikstr@gmail.com> Reviewed-by: Matt Fisher <mfisher87@gmail.com>
…or lock Addresses conda#196: for requested platforms replaces lock content without erroneously persisting packages. Co-authored-by: Arie Knoester <arikstr@gmail.com> Reviewed-by: Matt Fisher <mfisher87@gmail.com>
…or lock Addresses conda#196: for requested platforms replaces lock content without erroneously persisting packages. Co-authored-by: Arie Knoester <arikstr@gmail.com> Reviewed-by: Matt Fisher <mfisher87@gmail.com>
…or lock Addresses conda#196: for requested platforms replaces lock content without erroneously persisting packages. Co-authored-by: Arie Knoester <arikstr@gmail.com> Reviewed-by: Matt Fisher <mfisher87@gmail.com>
…or lock Addresses conda#196: for requested platforms replaces lock content without erroneously persisting packages. Co-authored-by: Arie Knoester <arikstr@gmail.com> Reviewed-by: Matt Fisher <mfisher87@gmail.com>
…or lock Addresses conda#196: for requested platforms replaces lock content without erroneously persisting packages. Co-authored-by: Arie Knoester <arikstr@gmail.com> Reviewed-by: Matt Fisher <mfisher87@gmail.com>
I'll add a little of my experience and expectations here. First, I agree with the growing sentiment that extraneous packages could be removed from the lock and I've also gotten in the habit of There is one wrinkle that might be worth considering that a user brought to my attention: relock an env spec with minimal amount of changes. I wonder if there might be a way to have both a minimal update along with pruning of orphaned and un-requested packages. |
I've seen some lockfile tools that offer a A super useful example, which may or may not be supported by the solvers, would be a
As for combining multiple strategy solves of in a single |
…or lock Addresses conda#196: for requested platforms replaces lock content without erroneously persisting packages. Co-authored-by: Arie Knoester <arikstr@gmail.com> Reviewed-by: Matt Fisher <mfisher87@gmail.com>
If you could write a brief release note let's just do a release now. |
Sure, will do my best! This is a tough one to boil down :)
Or a more low-level explanation, please cut up or edit however you like:
That last sentence is I think a good candidate for removal or revision. |
@mfisher87, would it be accurate to say:
|
There's another exception: locking a subset of platforms. For example, if you've previously locked with an
|
Okay, new release is out. I went for a minor version since I think the only real "breakage" here would be more aggressive updating. For the release notes, I wanted to avoid complication, and avoid discussion of the exceptional cases. (In case I wrote something wrong/misleading I can still edit it.) Thanks everyone for all the great feedback and discussion! There are some unaddressed points about implementation of a minimal update strategy. Let's open a fresh issue for that. |
Would you mind updating the release notes to credit co-author @ArieKnoester for the PR? Thanks, Ben! |
@mfisher87 oops, they're autogenerated and I missed that. Thanks, fixed! |
I'm surprised that removing a dependency does not remove it and sub-dependencies from an existing
conda-lock.yml
(condalock 1.0.5):Steps to reproduce:
conda-lock lock --mamba -f environment.yml
with the followingenvironment.yml
:-pystac
dependency and re-runconda-lock lock --mamba -f environment.yml
, butpystac
remains inconda-lock.yml
:A workaround is to wipe
conda-lock.yml
and start fresh, but it's nice to keep it around for version control.The text was updated successfully, but these errors were encountered: