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

Allow symlinks with --find-links #5323

Merged
merged 2 commits into from
Jul 23, 2024

Conversation

zackelia
Copy link
Contributor

Summary

In my setup, I have a directory of wheels symlinked from different directories. I can point --find-links at it with pip and it works but not uv.

Currently, uv checks if a candidate file is_file which is for regular files. By also checking is_symlink I was able to install a symlinked wheel. I'm not exactly sure where, but some other place is eventually resolving the absolute path of the wheel. (uv? The OS?)

Test Plan

Manually tested - I didn't see any tests for FlatIndexClient in the uv-client crate.

mkdir /tmp/a /tmp/b                               # Create a directory of wheels (/tmp/a) and a directory of symlinked wheels (/tmp/b)
cp test-0.0.1-py3-none-any.whl /tmp/a             # Add a wheel to the directory of wheels
ln -s /tmp/a/test-0.0.1-py3-none-any.whl /tmp/b/  # Create a symlink to that wheel
uv pip install test --find-links /tmp/b           # Install pointing at the symlinked wheels directory

Copy link
Member

@charliermarsh charliermarsh left a comment

Choose a reason for hiding this comment

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

Thanks!

if target.is_dir() {
continue;
}
}
Copy link
Member

Choose a reason for hiding this comment

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

I tweaked this such that we still skip symlinked directories.

@charliermarsh charliermarsh enabled auto-merge (squash) July 23, 2024 02:45
@charliermarsh charliermarsh added the compatibility Compatibility with a specification or another tool label Jul 23, 2024
@charliermarsh charliermarsh merged commit f371195 into astral-sh:main Jul 23, 2024
54 checks passed
@zackelia zackelia deleted the find-links-symlinks branch July 23, 2024 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compatibility Compatibility with a specification or another tool
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants