Skip to content

Commit

Permalink
feat: make recipe generation optional
Browse files Browse the repository at this point in the history
  • Loading branch information
tdejager committed Jul 30, 2024
1 parent bebe7fd commit eaaa18d
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 9 deletions.
40 changes: 32 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,39 @@ default-run = "rattler-build"

[features]
default = ['native-tls']
native-tls = ['reqwest/native-tls', 'rattler/native-tls', 'rattler_installs_packages/native-tls']
rustls-tls = ['reqwest/rustls-tls', 'reqwest/rustls-tls-native-roots', 'rattler/rustls-tls', 'rattler_installs_packages/rustls-tls']
tui = ['ratatui', 'crossterm', 'ansi-to-tui', 'throbber-widgets-tui', 'tui-input']
native-tls = [
'reqwest/native-tls',
'rattler/native-tls',
'rattler_installs_packages/native-tls',
]
rustls-tls = [
'reqwest/rustls-tls',
'reqwest/rustls-tls-native-roots',
'rattler/rustls-tls',
'rattler_installs_packages/rustls-tls',
]
tui = [
'ratatui',
'crossterm',
'ansi-to-tui',
'throbber-widgets-tui',
'tui-input',
]
recipe-generation = ['rattler_installs_packages']

generate-cli-docs = ["clap-markdown"]

[[bin]]
name = "rattler-build"
required-features = ["recipe-generation"]

[dependencies]
serde = { version = "1.0.204", features = ["derive"] }
serde_yaml = "0.9.34"
rattler = { version = "0.27.2", default-features = false, features = ["cli-tools", "indicatif"] }
rattler = { version = "0.27.2", default-features = false, features = [
"cli-tools",
"indicatif",
] }
rattler_conda_types = { version = "0.26.3", default-features = false }
rattler_digest = { version = "0.19.5", default-features = false }
rattler_index = { version = "0.19.21", default-features = false }
Expand All @@ -36,7 +60,7 @@ rattler_shell = { version = "0.21.3", default-features = false, features = [
] }
rattler_solve = { version = "0.25.3", default-features = false, features = [
"resolvo",
"serde"
"serde",
] }
rattler_virtual_packages = { version = "0.19.20", default-features = false }
rattler_package_streaming = { version = "0.21.7", default-features = false }
Expand All @@ -63,7 +87,7 @@ tracing-subscriber = { version = "0.3.18", features = [
"env-filter",
"fmt",
"ansi",
"json"
"json",
] }
marked-yaml = { version = "0.7.1" }
miette = { version = "7.2.0", features = ["fancy"] }
Expand Down Expand Up @@ -106,7 +130,7 @@ zstd = "0.13.2"
toml = "0.8.15"
memmap2 = "0.9.4"
reqwest-middleware = "0.3.2"
rattler_installs_packages = { version = "0.9.0", default-features = false }
rattler_installs_packages = { version = "0.9.0", default-features = false, optional = true }
async-once-cell = "0.5.3"
terminal_size = "0.3.0"
memchr = "2.7.4"
Expand Down Expand Up @@ -155,7 +179,7 @@ pre-build = [
#rattler_solve = { git = "https://github.com/baszalmstra/rattler", branch = "fix/quote_nushell_var" }
#rattler_virtual_packages = { git = "https://github.com/baszalmstra/rattler", branch = "fix/quote_nushell_var" }
#rattler_package_streaming = { git = "https://github.com/baszalmstra/rattler", branch = "fix/quote_nushell_var" }
clap-markdown = { git = "https://github.com/ruben-arts/clap-markdown", branch = "main"}
clap-markdown = { git = "https://github.com/ruben-arts/clap-markdown", branch = "main" }


# rattler = { path = "../rattler/crates/rattler" }
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ mod linux;
mod macos;
mod post_process;
pub mod rebuild;
#[cfg(feature = "recipe-generation")]
pub mod recipe_generator;
mod unix;
pub mod upload;
Expand Down
5 changes: 4 additions & 1 deletion src/opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

use std::{path::PathBuf, str::FromStr};

#[cfg(feature = "recipe-generator")]
use crate::recipe_generator::GenerateRecipeOpts;

use crate::{
console_utils::{Color, LogStyle},
recipe_generator::GenerateRecipeOpts,
tool_configuration::SkipExisting,
};
use clap::builder::ArgPredicate;
Expand Down Expand Up @@ -45,6 +47,7 @@ pub enum SubCommands {
/// Generate shell completion script
Completion(ShellCompletion),

#[cfg(feature = "recipe-generator")]
/// Generate a recipe from PyPI or CRAN
GenerateRecipe(GenerateRecipeOpts),

Expand Down

0 comments on commit eaaa18d

Please sign in to comment.