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

Always reinstall local source trees passed to uv pip install #12176

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

charliermarsh
Copy link
Member

@charliermarsh charliermarsh commented Mar 14, 2025

Summary

This ended up being more involved than expected. The gist is that we setup all the packages we want to reinstall upfront (they're passed in on the command-line); but at that point, we don't have names for all the packages that the user has specified. (Consider, e.g., uv pip install . -- we don't have a name for ., so we can't add it to the list of Reinstall packages.)

Now, Reinstall also accepts paths, so we can augment Reinstall based on the user-provided paths.

Closes #12038.

@charliermarsh charliermarsh added the no-build Disable building binaries in CI label Mar 14, 2025
@charliermarsh charliermarsh added enhancement New feature or improvement to existing functionality cache Caching of packages and metadata labels Mar 14, 2025
@charliermarsh charliermarsh requested review from zanieb and konstin March 14, 2025 20:16
@charliermarsh charliermarsh force-pushed the charlie/explicit branch 6 times, most recently from c8935ae to db7d652 Compare March 15, 2025 20:55
|| path.is_some_and(|path| {
paths
.iter()
.any(|target| same_file::is_same_file(path, target).unwrap_or(true))
Copy link
Member

Choose a reason for hiding this comment

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

On failure we assume true and always invalidate? That seems surprising.

Copy link
Member

Choose a reason for hiding this comment

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

(I don't feel strongly, but am curious for your thinking here)

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed it. I didn't realize it errors when one file doesn't exist; I just didn't think about it deeply, thanks!

Self::Packages(packages) => packages.contains(package_name),
Self::Packages(.., paths) => paths
.iter()
.any(|target| same_file::is_same_file(path, target).unwrap_or(true)),
Copy link
Member

Choose a reason for hiding this comment

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

See previous comment

Copy link
Member

@zanieb zanieb left a comment

Choose a reason for hiding this comment

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

The pull request says "source trees" but this implementation is just local source trees, right? Can you change that?

Do we want to change this for remote source trees, i.e., Git repositories too? Should we add test coverage for that now?

@charliermarsh
Copy link
Member Author

Yeah, just local source trees.

@zanieb zanieb changed the title Always reinstall source trees passed to uv pip install Always reinstall local source trees passed to uv pip install Mar 17, 2025
@charliermarsh charliermarsh enabled auto-merge (squash) March 17, 2025 21:08
@charliermarsh charliermarsh merged commit 72be5ff into main Mar 17, 2025
90 checks passed
@charliermarsh charliermarsh deleted the charlie/explicit branch March 17, 2025 21:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cache Caching of packages and metadata enhancement New feature or improvement to existing functionality no-build Disable building binaries in CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

running uv pip install . should systematically reinstall the package
3 participants