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

Bump uv version to 0.6.0 #184

Merged
merged 2 commits into from
Feb 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions src/languages/python/impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,15 @@ impl LanguageImpl for Python {
let python_install_dir = store.tools_path(ToolBucket::Python);

let uv_cmd = |summary| {
#[allow(unused_mut)]
let mut cmd = Cmd::new(&uv, summary);
// Don't use cache in Windows, multiple uv instances will conflict with each other.
// See https://github.com/astral-sh/uv/issues/8664
// TODO: remove this
#[cfg(windows)]
cmd.env(EnvVars::UV_NO_CACHE, "1");

cmd.env(EnvVars::UV_PYTHON_INSTALL_DIR, &python_install_dir);
cmd
};

// Create venv
let mut cmd = uv_cmd("create venv");
cmd.arg("venv").arg(venv);

match hook.language_version {
LanguageVersion::Specific(ref version) => {
cmd.arg("--python").arg(version);
Expand Down
13 changes: 7 additions & 6 deletions src/languages/python/uv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use crate::process::Cmd;
use crate::store::{Store, ToolBucket};

// The version of `uv` to install. Should update periodically.
const UV_VERSION: &str = "0.5.8";
const UV_VERSION: &str = "0.6.0";

#[derive(Debug)]
enum PyPiMirror {
Expand Down Expand Up @@ -127,12 +127,13 @@ impl InstallSource {
.join(&bin_dir)
.join("uv")
.with_extension(env::consts::EXE_EXTENSION);
fs_err::rename(
fs_err::tokio::rename(
&uv,
target.join("uv").with_extension(env::consts::EXE_EXTENSION),
)?;
fs_err::remove_dir_all(bin_dir)?;
fs_err::remove_dir_all(lib_dir)?;
)
.await?;
fs_err::tokio::remove_dir_all(bin_dir).await?;
fs_err::tokio::remove_dir_all(lib_dir).await?;

Ok(())
}
Expand Down Expand Up @@ -214,7 +215,7 @@ impl UvInstaller {
return Ok(uv);
}

fs_err::create_dir_all(&uv_dir)?;
fs_err::tokio::create_dir_all(&uv_dir).await?;
let _lock = LockedFile::acquire(uv_dir.join(".lock"), "uv").await?;

if uv.is_file() {
Expand Down
Loading