Skip to content
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

Support unnamed requirements directly in pip uninstall #2577

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Mar 20, 2024

Summary

In pip uninstall, we shouldn't need to resolve unnamed requirements, since we already index packages in site-packages by their URL.

This also changes uninstall to ignore editables, which matches pip's behavior.

Part of: #313.

Test Plan

Run cargo run pip install ./scripts/editable-installs/black_editable, followed by each of the following:

  • cargo run pip uninstall ./scripts/editable-installs/black_editable
  • cargo run pip uninstall black
  • cargo run pip uninstall ./scripts/editable-installs/black_editable black

Comment on lines -963 to -966
/// Uninstall the editable package based on the provided local file path.
#[clap(long, short, group = "sources")]
editable: Vec<String>,

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh why did we have this in the first place? Is there an actual behavior change here or do we just treat editables like normal packages during uninstall?

We should note this as a breaking change in the changelog.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just treated editables like normal packages (sort of). We removed any packages that matched the URL (regardless of whether they're editable). I guess this probably existed because we didn't support direct URL requirements, so you couldn't do uv pip uninstall ./path/to/file. But pip does not allow this. I'll note it as such in the changelog.

@charliermarsh charliermarsh added the breaking A breaking change label Mar 21, 2024
@charliermarsh charliermarsh merged commit 7c728a2 into main Mar 21, 2024
31 checks passed
@charliermarsh charliermarsh deleted the charlie/bare-v branch March 21, 2024 04:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking A breaking change enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants