Skip to content

Commit cab7cb8

Browse files
committed
Add a new interface trait, port init to pixi_api
1 parent 44e5fbd commit cab7cb8

File tree

13 files changed

+806
-625
lines changed

13 files changed

+806
-625
lines changed

Cargo.lock

Lines changed: 19 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/pixi_api/Cargo.toml

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,22 @@ repository.workspace = true
99
version = "0.1.0"
1010

1111
[dependencies]
12-
clap = { workspace = true, features = ["derive"] }
12+
console = { workspace = true, features = ["windows-console-colors"] }
13+
console-subscriber = { workspace = true, optional = true }
14+
dunce = { workspace = true }
15+
fs-err = { workspace = true }
16+
miette = { workspace = true }
17+
minijinja = { workspace = true }
18+
pixi_config = { workspace = true }
19+
pixi_consts = { workspace = true }
20+
pixi_core = { workspace = true }
21+
pixi_manifest = { workspace = true }
22+
pixi_utils = { workspace = true }
1323
rattler_conda_types = { workspace = true }
24+
same-file = { workspace = true }
25+
serde = { workspace = true, features = ["derive"] }
26+
tempfile = { workspace = true }
27+
tokio = { workspace = true, features = ["fs"] }
28+
tracing = { workspace = true }
29+
url = { workspace = true }
30+
uv-normalize = { workspace = true }

crates/pixi_api/src/context.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
use crate::{init::InitOptions, interface::Interface};
2+
3+
pub struct ApiContext<I: Interface> {
4+
interface: I,
5+
}
6+
7+
impl<I: Interface> ApiContext<I> {
8+
pub fn new(interface: I) -> Self {
9+
Self { interface }
10+
}
11+
12+
pub async fn init(&self, options: InitOptions) -> miette::Result<()> {
13+
crate::init::init(&self.interface, options).await
14+
}
15+
}

crates/pixi_api/src/init.rs

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)