Skip to content
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
6 changes: 6 additions & 0 deletions crates/rattler_build_recipe_generator/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ mod cpan;
mod cran;
mod luarocks;
mod pypi;
mod pyproject;
mod serialize;

pub use self::cpan::{CpanOpts, generate_cpan_recipe, generate_cpan_recipe_string};
pub use self::cran::{CranOpts, generate_r_recipe, generate_r_recipe_string};
pub use self::luarocks::{LuarocksOpts, generate_luarocks_recipe, generate_luarocks_recipe_string};
pub use self::pypi::{PyPIOpts, generate_pypi_recipe, generate_pypi_recipe_string};
pub use self::pyproject::{PyprojectOpts, generate_pyproject_recipe, generate_pyproject_recipe_string};
pub use serialize::write_recipe;

/// The source of the package to generate a recipe for
Expand All @@ -30,6 +32,9 @@ pub enum Source {

/// Generate a recipe for a Lua package from LuaRocks
Luarocks(LuarocksOpts),

/// Generate a recipe from a local pyproject.toml file
Pyproject(PyprojectOpts),
}

/// Options for generating a recipe
Expand All @@ -49,6 +54,7 @@ pub async fn generate_recipe(args: GenerateRecipeOpts) -> miette::Result<()> {
Source::Cran(opts) => generate_r_recipe(&opts).await?,
Source::Cpan(opts) => generate_cpan_recipe(&opts).await?,
Source::Luarocks(opts) => generate_luarocks_recipe(&opts).await?,
Source::Pyproject(opts) => generate_pyproject_recipe(&opts).await?,
}

Ok(())
Expand Down
4 changes: 2 additions & 2 deletions crates/rattler_build_recipe_generator/src/pypi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ pub async fn conda_pypi_name_mapping() -> miette::Result<&'static HashMap<String
}).await
}

fn format_requirement(req: &str) -> String {
pub(crate) fn format_requirement(req: &str) -> String {
// Split package name from version specifiers
let req = req.trim();
let (name, version) = if let Some(pos) =
Expand Down Expand Up @@ -390,7 +390,7 @@ async fn fetch_pypi_metadata(
Err(miette::miette!(error_message))
}

async fn map_requirement(
pub(crate) async fn map_requirement(
req: &str,
mapping: &HashMap<String, String>,
use_mapping: bool,
Expand Down
Loading
Loading