Skip to content

Commit 44f341d

Browse files
committed
wip
1 parent e0e4f5b commit 44f341d

File tree

3 files changed

+85
-1
lines changed

3 files changed

+85
-1
lines changed

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,6 @@ clap = "4.5.11"
1010
pixi_manifest = { git = "https://github.com/prefix-dev/pixi", branch="main" }
1111
pixi_consts = { git = "https://github.com/prefix-dev/pixi", branch="main" }
1212
rattler-build = { git = "https://github.com/tdejager/rattler-build", branch = "feat/optional-recipe-generation", default-features = false }
13+
rattler_conda_types = "0.26.3"
14+
rattler_package_streaming = "0.21.7"
15+
chrono = "0.4.38"

crates/pixi-build-python/Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ pixi_manifest = { workspace = true }
88
pixi_consts = { workspace = true }
99
rattler-build = { workspace = true }
1010
clap = { workspace = true, features = ["derive", "env"] }
11+
rattler_conda_types = { workspace = true }
12+
rattler_package_streaming = { workspace = true }
13+
chrono = { workspace = true }

crates/pixi-build-python/src/main.rs

Lines changed: 79 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
mod consts;
22

3-
use std::path::PathBuf;
3+
use std::{collections::BTreeMap, path::PathBuf, sync::Arc};
44

55
use clap::Parser;
6+
use pixi_manifest::TargetSelector::Platform;
7+
use rattler_build::{
8+
hash::HashInfo,
9+
metadata::{BuildConfiguration, Directories, Output, PackagingSettings},
10+
recipe::{
11+
parser::{Package, PathSource, Source},
12+
Recipe,
13+
},
14+
};
15+
use rattler_build::recipe::parser::{Build, Requirements};
16+
use rattler_conda_types::{package::ArchiveType, NoArchType};
17+
use rattler_package_streaming::write::CompressionLevel;
618

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

1931
// Load the manifest
2032
eprintln!("Looking for manifest at {:?}", args.manifest_path);
33+
34+
// TODO: Variants???
35+
let variants = BTreeMap::default();
36+
37+
// TODO: NoArchType???
38+
let noarch_type = NoArchType::None;
39+
40+
// TODO: Setup defaults
41+
let directories = Directories::default();
42+
43+
let output = Output {
44+
recipe: Recipe {
45+
schema_version: 1,
46+
package: Package {
47+
// TODO:
48+
},
49+
cache: None,
50+
source: vec![Source::Path(PathSource {
51+
path: args
52+
.manifest_path
53+
.parent()
54+
.expect("the project manifest must reside in a directory")
55+
.to_path_buf(),
56+
sha256: None,
57+
md5: None,
58+
patches: vec![],
59+
target_directory: None,
60+
file_name: None,
61+
use_gitignore: true,
62+
})],
63+
build: Build {
64+
// TODO:
65+
},
66+
requirements: Requirements {
67+
68+
},
69+
tests: vec![],
70+
about: Default::default(),
71+
extra: Default::default(),
72+
},
73+
build_configuration: BuildConfiguration {
74+
// TODO: NoArch??
75+
target_platform: Platform::NoArch,
76+
host_platform: Platform::current(),
77+
build_platform: Platform::current(),
78+
hash: HashInfo::from_variant(&variants, &noarch_type),
79+
variant,
80+
directories,
81+
channels: vec![], // TODO: read from manifest
82+
channel_priority: Default::default(),
83+
solve_strategy: Default::default(),
84+
timestamp: chrono::Utc::now(),
85+
subpackages: Default::default(), // TODO: ???
86+
packaging_settings: PackagingSettings::from_args(
87+
ArchiveType::Conda,
88+
CompressionLevel::default(),
89+
),
90+
store_recipe: true,
91+
force_colors: true,
92+
},
93+
finalized_dependencies: None,
94+
finalized_cache_dependencies: None,
95+
finalized_sources: None,
96+
build_summary: Arc::default(),
97+
system_tools: Default::default(),
98+
};
2199
}

0 commit comments

Comments
 (0)