Adds uv step (#890)

* pyenv: fixes #849

* feat: adds `uv` python manager step

* moved new uv step from unix to generic

---------

Co-authored-by: Lucas Parzianello <lucaspar@users.noreply.github.com>
This commit is contained in:
Lucas Parzianello
2024-08-24 22:22:27 -04:00
committed by GitHub
parent e91c00c9c0
commit 1b534800a9
3 changed files with 22 additions and 0 deletions

View File

@@ -153,6 +153,7 @@ pub enum Step {
Tlmgr,
Tmux,
Toolbx,
Uv,
Vagrant,
Vcpkg,
Vim,

View File

@@ -419,6 +419,7 @@ fn run() -> Result<()> {
generic::run_lensfun_update_data(&ctx)
})?;
runner.execute(Step::Poetry, "Poetry", || generic::run_poetry(&ctx))?;
runner.execute(Step::Uv, "uv", || generic::run_uv(&ctx))?;
runner.execute(Step::Zvm, "ZVM", || generic::run_zvm(&ctx))?;
runner.execute(Step::Aqua, "aqua", || generic::run_aqua(&ctx))?;

View File

@@ -1024,6 +1024,26 @@ pub fn run_poetry(ctx: &ExecutionContext) -> Result<()> {
ctx.run_type().execute(poetry).args(["self", "update"]).status_checked()
}
pub fn run_uv(ctx: &ExecutionContext) -> Result<()> {
let uv_exec = require("uv")?;
print_separator("uv");
ctx.run_type()
.execute(&uv_exec)
.args(["self", "update"])
.status_checked()
.ok();
// ignoring self-update errors, because they are likely due to uv's
// installation being managed by another package manager, in which
// case another step will handle the update.
ctx.run_type()
.execute(&uv_exec)
.args(["tool", "upgrade", "--all"])
.status_checked()
}
/// Involve `zvm upgrade` to update ZVM
pub fn run_zvm(ctx: &ExecutionContext) -> Result<()> {
let zvm = require("zvm")?;