Skip to content

feat: add pyext backend #128

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
109 changes: 109 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions crates/pixi-build-pyext/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
[package]
name = "pixi-build-pyext"
version = "0.1.6"
edition.workspace = true

[dependencies]
async-trait = { workspace = true }
chrono = { workspace = true }
indexmap = { workspace = true }
miette = { workspace = true }
minijinja = { workspace = true, features = ["json"] }
rattler_conda_types = { workspace = true }
rattler_package_streaming = { workspace = true }
rattler-build = { workspace = true }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
tempfile = { workspace = true }
tokio = { workspace = true, features = ["macros"] }

pixi-build-backend = { workspace = true }

pixi_build_types = { workspace = true }
pixi_manifest = { workspace = true }
pixi_build_type_conversions = { workspace = true }
pyo3 = { version = "0.24.1", features = ["auto-initialize"] }
url.workspace = true
rattler_virtual_packages.workspace = true
fs-err = { workspace = true, features = ["tokio"] }

[dev-dependencies]
insta = { version = "1.42.1", features = ["yaml", "redactions", "filters"] }
rstest = { workspace = true }
31 changes: 31 additions & 0 deletions crates/pixi-build-pyext/pixi.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[workspace]
authors = ["Nichita Morcotilo <[email protected]>"]
channels = ["conda-forge"]
description = "Showcases how to build a rust project with pixi"
name = "pixi-build-pyext"
platforms = ["win-64", "linux-64", "osx-64", "osx-arm64"]
preview = ["pixi-build"]

[dependencies]
pixi-build-pyext = { path = "." }

[package]
authors = ["Nichita Morcotilo <[email protected]>"]
description = "Showcases how to build a rust project with pixi"
name = "pixi-build-pyext"
version = "0.1.6"

[package.build]
backend = { name = "pixi-build-rust", version = "*" }
channels = ["https://prefix.dev/pixi-build-backends", "conda-forge"]

[package.build-dependencies]
python = "3.12.*"

[package.host-dependencies]
python = "3.12.*"

[package.run-dependencies]
# python = "3.12.*"
# "ruamel.yaml" = "0.18.*"
# requests = "2.32.*"
12 changes: 12 additions & 0 deletions crates/pixi-build-pyext/src/config.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use serde::{Deserialize, Serialize};
use std::{collections::HashMap, path::PathBuf};

#[derive(Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "kebab-case")]
pub struct PyExtConfig {
pub debug_dir: Option<PathBuf>,
pub python_script: PathBuf,

#[serde(flatten)]
pub options: HashMap<String, serde_json::Value>,
}
13 changes: 13 additions & 0 deletions crates/pixi-build-pyext/src/main.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
mod config;
mod protocol;
mod rattler_build;

use protocol::RattlerBuildBackendInstantiator;

#[tokio::main]
pub async fn main() {
if let Err(err) = pixi_build_backend::cli::main(RattlerBuildBackendInstantiator::new).await {
eprintln!("{err:?}");
std::process::exit(1);
}
}
Loading
Loading