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

Change "toolchain" to "python" #4735

Merged
merged 1 commit into from
Jul 3, 2024
Merged

Change "toolchain" to "python" #4735

merged 1 commit into from
Jul 3, 2024

Conversation

zanieb
Copy link
Member

@zanieb zanieb commented Jul 2, 2024

Whew this is a lot.

The user-facing changes are:

  • uv toolchain to uv python e.g. uv python find, uv python install, ...
  • UV_TOOLCHAIN_DIR to UV_PYTHON_INSTALL_DIR
  • <UV_STATE_DIR>/toolchains to <UV_STATE_DIR>/python (with automatic migration)
  • User-facing messages no longer refer to toolchains, instead using "Python", "Python versions" or "Python installations"

The internal changes are:

  • uv-toolchain crate to uv-python
  • Toolchain no longer referenced in type names
  • Dropped unused SystemPython type (previously replaced)
  • Clarified the type names for "managed Python installations"
  • (more little things)

@zanieb zanieb added the preview Experimental behavior label Jul 2, 2024
@zanieb zanieb force-pushed the zb/toolchain-python branch 3 times, most recently from 3c76810 to f0e90fd Compare July 2, 2024 19:05
Comment on lines +103 to +116
// Support `toolchains` -> `python` migration transparently.
if !root.exists()
&& root
.parent()
.is_some_and(|parent| parent.join("toolchains").exists())
{
let deprecated = root.parent().unwrap().join("toolchains");
// Move the deprecated directory to the new location.
fs::rename(&deprecated, root)?;
// Create a link or junction to at the old location
uv_fs::replace_symlink(root, &deprecated)?;
} else {
fs::create_dir_all(root)?;
}
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 blurb is notable

@zanieb zanieb marked this pull request as ready for review July 2, 2024 19:28
@zanieb
Copy link
Member Author

zanieb commented Jul 2, 2024

I'll give this diff a careful read through as well.

@charliermarsh
Copy link
Member

My only complaint is that uv python feels like I'd go uv python foo.py (to run Python itself), but I don't have a better suggestion.

@zanieb
Copy link
Member Author

zanieb commented Jul 2, 2024

Yeah I agree that's a little confusing and my primary hesitation. What if we provide a uv python run command though with an optional python shim on the PATH that invokes it?

@samypr100
Copy link
Contributor

samypr100 commented Jul 2, 2024

Curious, would there be a different short-hand for this similar to uvx? Say uvp or uv py

@zanieb
Copy link
Member Author

zanieb commented Jul 2, 2024

I think similar to uvx mapping to uv tool run (but a little different in implementation) we'd allow opt-in installation of python (or another name) that maps to uv python run.

@zanieb zanieb merged commit dd7da6a into main Jul 3, 2024
47 checks passed
@zanieb zanieb deleted the zb/toolchain-python branch July 3, 2024 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
preview Experimental behavior
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants