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

Gracefully handle virtual environments with conflicting packages #1893

Merged
merged 3 commits into from
Feb 23, 2024

Conversation

charliermarsh
Copy link
Member

Summary

When a virtual environment contains multiple packages with the same name, we no longer throw a hard error. Instead:

  • In uv pip freeze, we list all versions.
  • In uv pip uninstall, we uninstall all versions.
  • In uv pip install, we uninstall all versions prior to installing a new version.

Closes #1848.

Copy link
Member

@konstin konstin left a comment

Choose a reason for hiding this comment

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

I'd leave some comments about why the versions are a vec instead of a single installed version

crates/uv-installer/src/site_packages.rs Outdated Show resolved Hide resolved
crates/uv-installer/src/site_packages.rs Outdated Show resolved Hide resolved
crates/uv/tests/common/mod.rs Outdated Show resolved Hide resolved
crates/uv/tests/common/mod.rs Outdated Show resolved Hide resolved
@charliermarsh charliermarsh force-pushed the charlie/dupes branch 2 times, most recently from 6966200 to dbc9922 Compare February 23, 2024 19:07
@charliermarsh charliermarsh enabled auto-merge (squash) February 23, 2024 19:08
@charliermarsh charliermarsh merged commit c69e270 into main Feb 23, 2024
7 checks passed
@charliermarsh charliermarsh deleted the charlie/dupes branch February 23, 2024 19:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Found duplicate package in environment
4 participants