Recipe Generation#
Generate conda recipes from various package ecosystems.
These functions fetch package metadata from upstream repositories and generate
ready-to-use Stage0Recipe objects.
You can import the generation functions from rattler_build:
from rattler_build import (
generate_pypi_recipe,
generate_cran_recipe,
generate_cpan_recipe,
generate_luarocks_recipe,
)
generate_pypi_recipe#
Generate a conda recipe from a PyPI package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package
|
str
|
The name of the PyPI package to generate a recipe for. |
required |
version
|
str | None
|
Specific version of the package to use. If None, uses the latest version. |
None
|
use_mapping
|
bool
|
Whether to use conda-forge package name mappings for dependencies. This helps map PyPI names to their corresponding conda-forge package names. |
True
|
Returns:
| Type | Description |
|---|---|
Stage0Recipe
|
A Stage0Recipe object representing the generated recipe. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the package cannot be found or if there's a network error. |
generate_cran_recipe#
Generate a conda recipe from a CRAN (R) package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package
|
str
|
The name of the CRAN package to generate a recipe for. |
required |
universe
|
str | None
|
The R universe to fetch the package from. Defaults to "cran" if not specified. Other options include specific R-universe repositories. |
None
|
Returns:
| Type | Description |
|---|---|
Stage0Recipe
|
A Stage0Recipe object representing the generated recipe. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the package cannot be found or if there's a network error. |
generate_cpan_recipe#
Generate a conda recipe from a CPAN (Perl) package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
package
|
str
|
The name of the CPAN package to generate a recipe for. |
required |
version
|
str | None
|
Specific version of the package to use. If None, uses the latest version. |
None
|
Returns:
| Type | Description |
|---|---|
Stage0Recipe
|
A Stage0Recipe object representing the generated recipe. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the package cannot be found or if there's a network error. |
generate_luarocks_recipe#
Generate a conda recipe from a LuaRocks package.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rock
|
str
|
The LuaRocks package specification. Can be in one of these formats: - "module" - uses the latest version - "module/version" - uses a specific version - "author/module/version" - specifies author, module and version - Direct rockspec URL |
required |
Returns:
| Type | Description |
|---|---|
Stage0Recipe
|
A Stage0Recipe object representing the generated recipe. |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If the package cannot be found or if there's a network error. |