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

Install versioned Python executables into the bin directory during uv python install #8458

Open
wants to merge 1 commit into
base: tracking/050
Choose a base branch
from

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Oct 22, 2024

Updates uv python install to link python3.x in the executable directory (i.e., ~/.local/bin) to the the managed interpreter path. In a future change, we'll add a --default flag that will include python and python3 links.

On Windows, we create a copy. I think we need to create a trampoline instead though?

Needs documentation changes and removal on uninstall.

@zanieb zanieb added enhancement New feature or request breaking A breaking change labels Oct 22, 2024
@zanieb zanieb changed the base branch from main to zb/uv-dirs October 22, 2024 14:23
@zanieb zanieb changed the title zb/python exec dir Install versioned Python executables into the bin directory during uv python install Oct 22, 2024
@zanieb zanieb added this to the v0.5.0 milestone Oct 22, 2024
Base automatically changed from zb/uv-dirs to main October 22, 2024 16:33
@zanieb zanieb changed the base branch from main to tracking/050 October 22, 2024 16:55
@zanieb zanieb force-pushed the zb/python-exec-dir branch 4 times, most recently from b3f1ede to dc70ac5 Compare October 22, 2024 17:52
@zanieb zanieb force-pushed the zb/python-exec-dir branch 2 times, most recently from 1396487 to 6bd04ee Compare October 22, 2024 22:25
Comment on lines -339 to -342
// Workaround for python-build-standalone v20241016 which is missing the standard
// `python.exe` executable in free-threaded distributions on Windows.
//
// See https://github.com/astral-sh/uv/issues/8298
Copy link
Member Author

Choose a reason for hiding this comment

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

This moved up, so executable always returns the existing executable for an installation and we ensure all the canonical names exist here.

Comment on lines +412 to +419
let canonical_names = &["python"];

for name in canonical_names {
let executable =
Copy link
Member Author

Choose a reason for hiding this comment

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

This refactored for future changes.

zanieb added a commit that referenced this pull request Oct 24, 2024
With a change like #8458, we really
need tests for these.

I'm just going to take the possible performance hit of these slow tests
and deal with optimizing them separately.
@zanieb

This comment was marked as outdated.

@zanieb zanieb mentioned this pull request Oct 24, 2024
@zanieb zanieb force-pushed the zb/python-exec-dir branch 2 times, most recently from eda0f05 to b3758f8 Compare October 24, 2024 17:44
@zanieb zanieb force-pushed the zb/python-exec-dir branch 2 times, most recently from 8a5e932 to 712bbdc Compare October 24, 2024 20:16
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.

1 participant