mkrecipe.config

PEP 621 configuration parser.

Changed in version 0.2.0: BuildSystemParser moved to pyproject_parser.parsers

Classes:

MkrecipeParser()

Parser for the [tool.mkrecipe] table from pyproject.toml.

PEP621Parser()

Parser for PEP 621 metadata from pyproject.toml.

Functions:

load_toml(filename)

Load the mkrecipe configuration mapping from the given TOML file.

class MkrecipeParser[source]

Bases: AbstractConfigParser

Parser for the [tool.mkrecipe] table from pyproject.toml.

Attributes:

keys

The keys to parse from the TOML file.

Methods:

parse_conda_channels(config)

Parse the conda-channels key, giving a list of required conda channels to build and use the package.

parse_extras(config)

Parse the extras key, giving a list of extras to include as requirements in the conda package.

parse_license_key(config)

Parse the license-key key, giving the identifier of the project’s license.

parse_package(config)

Parse the package key, giving the name of the importable package.

property keys

The keys to parse from the TOML file.

Return type

List[str]

parse_conda_channels(config)[source]

Parse the conda-channels key, giving a list of required conda channels to build and use the package.

Parameters

config (Dict[str, Any]) – The unparsed TOML config for the [tool.mkrecipe] table.

Return type

List[str]

parse_extras(config)[source]

Parse the extras key, giving a list of extras to include as requirements in the conda package.

  • The special keyword 'all' indicates all extras should be included.

  • The special keyword 'none' indicates no extras should be included.

Parameters

config (Dict[str, Any]) – The unparsed TOML config for the [tool.mkrecipe] table.

Return type

Union[Literal['all'], Literal['none'], List[str]]

parse_license_key(config)[source]

Parse the license-key key, giving the identifier of the project’s license. Optional.

Parameters

config (Dict[str, Any]) – The unparsed TOML config for the [tool.mkrecipe] table.

Return type

str

parse_package(config)[source]

Parse the package key, giving the name of the importable package.

This defaults to project.name if unspecified.

Parameters

config (Dict[str, Any]) – The unparsed TOML config for the [tool.mkrecipe] table.

Return type

str

class PEP621Parser[source]

Bases: PEP621Parser

Parser for PEP 621 metadata from pyproject.toml.

Methods:

parse(config[, set_defaults])

Parse the TOML configuration.

parse_name(config)

Parse the name key.

parse(config, set_defaults=False)[source]

Parse the TOML configuration.

Parameters
Return type

ProjectDict

static parse_name(config)[source]

Parse the name key.

Parameters

config (Dict[str, Any]) – The unparsed TOML config for the [project] table.

Return type

str

load_toml(filename)[source]

Load the mkrecipe configuration mapping from the given TOML file.

Parameters

filename (Union[str, Path, PathLike])

Return type

Dict[str, Any]