Skip to content

Do not raise if record is already removed (e.g. with --deps-only) - #618

Draft
jaimergp wants to merge 7 commits into
mainfrom
only-deps-keyerror
Draft

Do not raise if record is already removed (e.g. with --deps-only)#618
jaimergp wants to merge 7 commits into
mainfrom
only-deps-keyerror

Conversation

@jaimergp

Copy link
Copy Markdown
Member

Description

Closes #613

Checklist - did you ...

  • Add a file to the news directory (using the template) for the next release's release notes?
  • Add / update necessary tests?
  • Add / update outdated documentation?

@conda-bot conda-bot added the cla-signed [bot] added once the contributor has signed the CLA label Feb 18, 2025
@jaimergp

Copy link
Copy Markdown
Member Author

pre-commit.ci autofix

@jaimergp

Copy link
Copy Markdown
Member Author

I had to add a new block of code that essentially contradicts this comment:

# Using a special instance of PrefixGraph to remove youngest child nodes that match
# the original requested specs.  It's important to remove only the *youngest* child
# nodes, because a typical use might be `conda install --only-deps python=2 flask`,
# and in that case we'd want to keep python.
#
# What are we supposed to do if flask was already in the environment?
# We can't be removing stuff here that's already in the environment.
#
# What should be recorded for the user-requested specs in this case? Probably all
# direct dependencies of flask.

I think we should actually NOT keep python, but I special cased it. My intuition as a user would be like conda install --only-deps A B C shouldn't leave any of A, B, C in the final solution, even if C depends on B. The user made the effort of writing it down, so it must be important. If they really need to condition the solver with more constraints, then they should do it in more steps or, you know, conda remove --force their way there.

@jaimergp
jaimergp marked this pull request as ready for review February 24, 2025 09:26
@jaimergp
jaimergp marked this pull request as draft February 24, 2025 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed [bot] added once the contributor has signed the CLA

Projects

Status: 🆕 New

Development

Successfully merging this pull request may close these issues.

KeyError in post_solve when using --only-deps

2 participants