Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
baszalmstra committed Jul 30, 2024
1 parent e0e4f5b commit 44f341d
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 1 deletion.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ clap = "4.5.11"
pixi_manifest = { git = "https://github.com/prefix-dev/pixi", branch="main" }
pixi_consts = { git = "https://github.com/prefix-dev/pixi", branch="main" }
rattler-build = { git = "https://github.com/tdejager/rattler-build", branch = "feat/optional-recipe-generation", default-features = false }
rattler_conda_types = "0.26.3"
rattler_package_streaming = "0.21.7"
chrono = "0.4.38"
3 changes: 3 additions & 0 deletions crates/pixi-build-python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ pixi_manifest = { workspace = true }
pixi_consts = { workspace = true }
rattler-build = { workspace = true }
clap = { workspace = true, features = ["derive", "env"] }
rattler_conda_types = { workspace = true }
rattler_package_streaming = { workspace = true }
chrono = { workspace = true }
80 changes: 79 additions & 1 deletion crates/pixi-build-python/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
mod consts;

use std::path::PathBuf;
use std::{collections::BTreeMap, path::PathBuf, sync::Arc};

Check warning on line 4 in crates/pixi-build-python/src/main.rs

View workflow job for this annotation

GitHub Actions / Format and Lint

Diff in /home/runner/work/pixi-build/pixi-build/crates/pixi-build-python/src/main.rs
use clap::Parser;
use pixi_manifest::TargetSelector::Platform;
use rattler_build::{
hash::HashInfo,
metadata::{BuildConfiguration, Directories, Output, PackagingSettings},
recipe::{
parser::{Package, PathSource, Source},
Recipe,

Check warning on line 12 in crates/pixi-build-python/src/main.rs

View workflow job for this annotation

GitHub Actions / Format and Lint

Diff in /home/runner/work/pixi-build/pixi-build/crates/pixi-build-python/src/main.rs
},
};
use rattler_build::recipe::parser::{Build, Requirements};
use rattler_conda_types::{package::ArchiveType, NoArchType};
use rattler_package_streaming::write::CompressionLevel;

#[allow(missing_docs)]
#[derive(Parser)]
Expand All @@ -18,4 +30,70 @@ fn main() {

// Load the manifest
eprintln!("Looking for manifest at {:?}", args.manifest_path);

// TODO: Variants???
let variants = BTreeMap::default();

// TODO: NoArchType???
let noarch_type = NoArchType::None;

// TODO: Setup defaults
let directories = Directories::default();

let output = Output {
recipe: Recipe {
schema_version: 1,
package: Package {
// TODO:
},
cache: None,
source: vec![Source::Path(PathSource {
path: args
.manifest_path
.parent()
.expect("the project manifest must reside in a directory")
.to_path_buf(),
sha256: None,
md5: None,
patches: vec![],
target_directory: None,
file_name: None,
use_gitignore: true,
})],
build: Build {

Check warning on line 63 in crates/pixi-build-python/src/main.rs

View workflow job for this annotation

GitHub Actions / Format and Lint

Diff in /home/runner/work/pixi-build/pixi-build/crates/pixi-build-python/src/main.rs
// TODO:
},
requirements: Requirements {

},
tests: vec![],
about: Default::default(),
extra: Default::default(),
},
build_configuration: BuildConfiguration {
// TODO: NoArch??
target_platform: Platform::NoArch,
host_platform: Platform::current(),
build_platform: Platform::current(),
hash: HashInfo::from_variant(&variants, &noarch_type),
variant,
directories,
channels: vec![], // TODO: read from manifest
channel_priority: Default::default(),
solve_strategy: Default::default(),
timestamp: chrono::Utc::now(),
subpackages: Default::default(), // TODO: ???
packaging_settings: PackagingSettings::from_args(
ArchiveType::Conda,
CompressionLevel::default(),
),
store_recipe: true,
force_colors: true,
},
finalized_dependencies: None,
finalized_cache_dependencies: None,
finalized_sources: None,
build_summary: Arc::default(),
system_tools: Default::default(),
};
}

0 comments on commit 44f341d

Please sign in to comment.