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

Respect data scripts in uv tool install #4693

Merged
merged 1 commit into from
Jul 1, 2024
Merged

Respect data scripts in uv tool install #4693

merged 1 commit into from
Jul 1, 2024

Conversation

charliermarsh
Copy link
Member

Summary

Packages that provide scripts that aren't Python entrypoints need to respected in uv tool install. For example, Ruff ships a script in ruff-0.5.0.data/scripts.

Unfortunately, the .data directory doesn't exist in the virtual environment at all (it's removed, per the spec, after install). So this PR changes the entry point detection to look at the RECORD file, which is the only evidence that the scripts were installed.

Closes #4691.

Test Plan

cargo run uv tool install ruff (snapshot tests to-come)

@charliermarsh charliermarsh added bug Something isn't working preview Experimental behavior labels Jul 1, 2024
@charliermarsh
Copy link
Member Author

I have to identify a small package that does this for CI.

@charliermarsh
Copy link
Member Author

It looks like pipx does read the entrypoints, but then also inspects the dist.files to find binaries. The upside is not clear to me, maybe it works in the absence of RECORD?

@charliermarsh
Copy link
Member Author

Yeah, I think the benefit there is that it works even for packages that don't have a RECORD like egg-info. But we don't support installing those anyway...

@charliermarsh charliermarsh merged commit 324e9fe into main Jul 1, 2024
47 checks passed
@charliermarsh charliermarsh deleted the charlie/data branch July 1, 2024 16:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

uv tool install omits data scripts
3 participants