Skip to content

Commit

Permalink
Bump uv version to 0.6.0 (#184)
Browse files Browse the repository at this point in the history
* Bump uv version to 0.6.0

* Remove windows cache hack
  • Loading branch information
j178 authored Feb 17, 2025
1 parent f3c23fe commit ac460c2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
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

0 comments on commit ac460c2

Please sign in to comment.