Skip to content

Python bindings#

These are the API docs for the rattler_build Python bindings. The full parameter list can be found be expanding the source code. Every function corresponds to a CLI command. For a description of its parameters and behavior we therefore refer to the CLI reference.

build_recipes(recipes, **kwargs)#

Build packages from a list of recipes

Source code in py-rattler-build/rattler_build/__init__.py
def build_recipes(
    recipes: List[Union[str, Path]],
    up_to: Union[str, None] = None,
    build_platform: Union[str, None] = None,
    target_platform: Union[str, None] = None,
    host_platform: Union[str, None] = None,
    channel: Union[List[str], None] = None,
    variant_config: Union[List[str], None] = None,
    ignore_recipe_variants: bool = False,
    render_only: bool = False,
    with_solve: bool = False,
    keep_build: bool = False,
    no_build_id: bool = False,
    package_format: Union[str, None] = None,
    compression_threads: Union[int, None] = None,
    no_include_recipe: bool = False,
    test: Union[str, None] = None,
    output_dir: Union[str, Path, None] = None,
    auth_file: Union[str, Path, None] = None,
    channel_priority: Union[str, None] = None,
    skip_existing: Union[str, None] = None,
    noarch_build_platform: Union[str, None] = None,
) -> None:
    """Build packages from a list of recipes"""
    build_recipes_py(
        recipes,
        up_to,
        build_platform,
        target_platform,
        host_platform,
        channel,
        variant_config,
        ignore_recipe_variants,
        render_only,
        with_solve,
        keep_build,
        no_build_id,
        package_format,
        compression_threads,
        no_include_recipe,
        test,
        output_dir,
        auth_file,
        channel_priority,
        skip_existing,
        noarch_build_platform,
    )

test_package(package_file, **kwargs)#

Run a test for a single package

Source code in py-rattler-build/rattler_build/__init__.py
def test_package(
    package_file: Union[str, Path],
    channel: Union[List[str], None] = None,
    compression_threads: Union[int, None] = None,
    auth_file: Union[str, Path, None] = None,
    channel_priority: Union[str, None] = None,
) -> None:
    """Run a test for a single package"""
    test_package_py(package_file, channel, compression_threads, auth_file, channel_priority)

upload_package_to_quetz(package_files, url, channels, **kwargs)#

Upload to a Quetz server. Authentication is used from the keychain / auth-file

Source code in py-rattler-build/rattler_build/__init__.py
def upload_package_to_quetz(
    package_files: List[str],
    url: str,
    channels: str,
    api_key: Union[str, None] = None,
    auth_file: Union[str, Path, None] = None,
) -> None:
    """Upload to a Quetz server. Authentication is used from the keychain / auth-file"""
    upload_package_to_quetz_py(package_files, url, channels, api_key, auth_file)

upload_package_to_artifactory(package_files, url, channels, **kwargs)#

Upload to a Artifactory channel. Authentication is used from the keychain / auth-file

Source code in py-rattler-build/rattler_build/__init__.py
def upload_package_to_artifactory(
    package_files: List[str],
    url: str,
    channels: str,
    token: Union[str, None] = None,
    auth_file: Union[str, Path, None] = None,
) -> None:
    """Upload to a Artifactory channel. Authentication is used from the keychain / auth-file"""
    upload_package_to_artifactory_py(package_files, url, channels, token, auth_file)

upload_package_to_prefix(package_files, url, channels, **kwargs)#

Upload to a prefix.dev server. Authentication is used from the keychain / auth-file

Source code in py-rattler-build/rattler_build/__init__.py
def upload_package_to_prefix(
    package_files: List[str],
    url: str,
    channels: str,
    api_key: Union[str, None] = None,
    auth_file: Union[str, Path, None] = None,
) -> None:
    """Upload to a prefix.dev server. Authentication is used from the keychain / auth-file"""
    upload_package_to_prefix_py(package_files, url, channels, api_key, auth_file)

upload_package_to_anaconda(package_files, owner, **kwargs)#

Upload to a Anaconda.org server

Source code in py-rattler-build/rattler_build/__init__.py
def upload_package_to_anaconda(
    package_files: List[str],
    owner: str,
    channel: Union[List[str], None] = None,
    api_key: Union[str, None] = None,
    url: Union[str, None] = None,
    force: bool = False,
    auth_file: Union[str, Path, None] = None,
) -> None:
    """Upload to a Anaconda.org server"""
    upload_package_to_anaconda_py(package_files, owner, channel, api_key, url, force, auth_file)

upload_packages_to_conda_forge(package_files, staging_token, feedstock, feedstock_token, **kwargs)#

Upload to conda forge

Source code in py-rattler-build/rattler_build/__init__.py
def upload_packages_to_conda_forge(
    package_files: List[Union[str, Path]],
    staging_token: str,
    feedstock: str,
    feedstock_token: str,
    staging_channel: Union[str, None] = None,
    anaconda_url: Union[str, None] = None,
    validation_endpoint: Union[str, None] = None,
    provider: Union[str, None] = None,
    dry_run: bool = False,
) -> None:
    """Upload to conda forge"""
    upload_packages_to_conda_forge_py(
        package_files,
        staging_token,
        feedstock,
        feedstock_token,
        staging_channel,
        anaconda_url,
        validation_endpoint,
        provider,
        dry_run,
    )