From af15722ce38f4e76cc931dff307390cea3c0a89c Mon Sep 17 00:00:00 2001 From: prsabahrami Date: Wed, 9 Apr 2025 11:25:32 -0400 Subject: [PATCH 01/39] feat: add minijinja dependency and integrate into task module --- Cargo.lock | 1 + crates/pixi_manifest/Cargo.toml | 1 + crates/pixi_manifest/src/task.rs | 6 ++++++ 3 files changed, 8 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 292d3f7507..5602065926 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4627,6 +4627,7 @@ dependencies = [ "insta", "itertools 0.14.0", "miette 7.5.0", + "minijinja", "pathdiff", "pep440_rs", "pep508_rs", diff --git a/crates/pixi_manifest/Cargo.toml b/crates/pixi_manifest/Cargo.toml index 515b8ca0ec..d83ea86c34 100644 --- a/crates/pixi_manifest/Cargo.toml +++ b/crates/pixi_manifest/Cargo.toml @@ -47,6 +47,7 @@ rattler_solve = { workspace = true, optional = true } # TODO: Remove these dependencies console = { workspace = true } miette = { workspace = true, features = ["fancy-no-backtrace"] } +minijinja.workspace = true [dev-dependencies] assert_matches = { workspace = true } diff --git a/crates/pixi_manifest/src/task.rs b/crates/pixi_manifest/src/task.rs index 08ceb3282d..075cd2bc47 100644 --- a/crates/pixi_manifest/src/task.rs +++ b/crates/pixi_manifest/src/task.rs @@ -8,6 +8,7 @@ use std::{ use indexmap::IndexMap; use itertools::Itertools; +use minijinja::Template; use serde::Serialize; use toml_edit::{Array, Item, Table, Value}; @@ -344,6 +345,11 @@ impl From for Task { } } +#[derive(Debug, Clone)] +pub struct TaskString<'a> { + _inner: Template<'a, 'a>, +} + #[derive(Debug, Clone)] pub enum CmdArgs { Single(String), From 0492a3fc5c0ff27635b7c4311ef14416573c4817 Mon Sep 17 00:00:00 2001 From: prsabahrami Date: Fri, 11 Apr 2025 09:11:55 -0400 Subject: [PATCH 02/39] feat: continue adding minijinja integration --- Cargo.lock | 2 + crates/pixi_consts/src/consts.rs | 1 + crates/pixi_manifest/Cargo.toml | 2 + .../pixi_manifest/src/manifests/workspace.rs | 18 +- crates/pixi_manifest/src/task.rs | 166 +++++++++++++---- crates/pixi_manifest/src/toml/task.rs | 14 +- crates/pixi_manifest/src/workspace.rs | 8 + src/cli/run.rs | 4 +- src/cli/task.rs | 12 +- src/task/executable_task.rs | 174 +++++------------- src/task/task_graph.rs | 24 ++- src/task/task_hash.rs | 6 +- tests/integration_python/test_run_cli.py | 11 +- tests/integration_rust/task_tests.rs | 9 +- 14 files changed, 241 insertions(+), 210 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5602065926..301f99357c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4617,6 +4617,7 @@ dependencies = [ name = "pixi_manifest" version = "0.1.0" dependencies = [ + "anyhow", "assert_matches", "console", "dunce", @@ -4628,6 +4629,7 @@ dependencies = [ "itertools 0.14.0", "miette 7.5.0", "minijinja", + "once_cell", "pathdiff", "pep440_rs", "pep508_rs", diff --git a/crates/pixi_consts/src/consts.rs b/crates/pixi_consts/src/consts.rs index 837fa6cb2b..af22557737 100644 --- a/crates/pixi_consts/src/consts.rs +++ b/crates/pixi_consts/src/consts.rs @@ -89,6 +89,7 @@ pub const CLAP_GLOBAL_OPTIONS: &str = "Global Options"; pub const CLAP_UPDATE_OPTIONS: &str = "Update Options"; pub static TASK_STYLE: LazyLock