whey.config

pyproject.toml configuration parsing.

Functions:

load_toml(filename)

Load the whey configuration mapping from the given TOML file.

load_toml(filename)[source]

Load the whey configuration mapping from the given TOML file.

Parameters

filename (Union[str, Path, PathLike])

Return type

Dict[str, Any]

whey.config.pep621

PEP 621 configuration parser.

Classes:

PEP621Parser()

Parser for PEP 621 metadata from pyproject.toml.

class PEP621Parser[source]

Bases: PEP621Parser

Parser for PEP 621 metadata from pyproject.toml.

Methods:

parse(config[, set_defaults])

Parse the TOML configuration.

parse(config, set_defaults=False)[source]

Parse the TOML configuration.

Parameters
Return type

ProjectDict

whey.config.whey

Parser for whey’s own configuration.

Classes:

WheyParser()

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

Functions:

backfill_classifiers(config)

Backfill trove classifiers for supported platforms, Python versions and implementations, and the project’s license, as appropriate.

get_default_builders()

Returns a mapping of builder categories to builder classes to use as the default builders.

get_entry_points([group])

Returns an iterable over EntryPoint objects in the group group.

Data:

license_lookup

Mapping of license short codes to license names used in trove classifiers.

class WheyParser[source]

Bases: AbstractConfigParser

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

property keys

The keys to parse from the TOML file.

Return type

List[str]

parse_additional_files(config)[source]

Parse the additional-files key, giving MANIFEST.in-style entries for additional files to include in distributions.

Parameters

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

Return type

List[AdditionalFilesEntry]

parse_base_classifiers(config)[source]

Parse the base-classifiers key, giving a list trove classifiers.

This list will be extended with the appropriate classifiers for supported platforms, Python versions and implementations, and the project’s license. Ignored if classifiers is not listed in dynamic

Parameters

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

Return type

Set[str]

parse_builders(config)[source]

Parse the builders table, which lists gives the entry points to use for the sdist and wheel builders.

This allows the user to select a custom builder with additional functionality.

Parameters

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

Return type

Dict[str, Type[AbstractBuilder]]

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.whey] 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.whey] table.

Return type

str

parse_platforms(config)[source]

Parse the platforms key, giving a list of supported platforms. Optional.

Parameters

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

Return type

List[str]

parse_python_implementations(config)[source]

Parse the python-implementations key, giving a list of supported Python implementations. Optional.

Parameters

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

Return type

List[str]

static parse_python_versions(config)[source]

Parse the python-versions key, giving a list of supported Python versions. Optional.

Parameters

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

Return type

List[str]

parse_source_dir(config)[source]

Parse the source-dir key, giving the name of the directory containing the project’s source.

This defaults to '.' if unspecified.

Parameters

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

Return type

str

backfill_classifiers(config)[source]

Backfill trove classifiers for supported platforms, Python versions and implementations, and the project’s license, as appropriate.

Parameters

config (Dict[str, Any]) – The parsed config from pyproject.toml.

Return type

List[str]

get_default_builders()[source]

Returns a mapping of builder categories to builder classes to use as the default builders.

Return type

Dict[str, Type[AbstractBuilder]]

get_entry_points(group='whey.builder')[source]

Returns an iterable over EntryPoint objects in the group group.

Parameters

group (str) – Default 'whey.builder'.

Return type

Iterable[EntryPoint]

license_lookup

Type:    dict

Mapping of license short codes to license names used in trove classifiers.

{
  "Apache-2.0": "Apache Software License",
  "BSD": "BSD License",
  "BSD-2-Clause": "BSD License",
  "BSD-3-Clause": "BSD License",
  "AGPL-3.0-only": "GNU Affero General Public License v3",
  "AGPL-3.0": "GNU Affero General Public License v3",
  "AGPL-3.0-or-later": "GNU Affero General Public License v3 or later (AGPLv3+)",
  "AGPL-3.0+": "GNU Affero General Public License v3 or later (AGPLv3+)",
  "FDL": "GNU Free Documentation License (FDL)",
  "GFDL-1.1-only": "GNU Free Documentation License (FDL)",
  "GFDL-1.1-or-later": "GNU Free Documentation License (FDL)",
  "GFDL-1.2-only": "GNU Free Documentation License (FDL)",
  "GFDL-1.2-or-later": "GNU Free Documentation License (FDL)",
  "GFDL-1.3-only": "GNU Free Documentation License (FDL)",
  "GFDL-1.3-or-later": "GNU Free Documentation License (FDL)",
  "GFDL-1.2": "GNU Free Documentation License (FDL)",
  "GFDL-1.1": "GNU Free Documentation License (FDL)",
  "GFDL-1.3": "GNU Free Documentation License (FDL)",
  "GPL": "GNU General Public License (GPL)",
  "GPL-1.0-only": "GNU General Public License (GPL)",
  "GPL-1.0-or-later": "GNU General Public License (GPL)",
  "GPLv2": "GNU General Public License v2 (GPLv2)",
  "GPL-2.0-only": "GNU General Public License v2 (GPLv2)",
  "GPLv2+": "GNU General Public License v2 or later (GPLv2+)",
  "GPL-2.0-or-later": "GNU General Public License v2 or later (GPLv2+)",
  "GPLv3": "GNU General Public License v3 (GPLv3)",
  "GPL-3.0-only": "GNU General Public License v3 (GPLv3)",
  "GPLv3+": "GNU General Public License v3 or later (GPLv3+)",
  "GPL-3.0-or-later": "GNU General Public License v3 or later (GPLv3+)",
  "LGPLv2": "GNU Lesser General Public License v2 (LGPLv2)",
  "LGPLv2+": "GNU Lesser General Public License v2 or later (LGPLv2+)",
  "LGPLv3": "GNU Lesser General Public License v3 (LGPLv3)",
  "LGPL-3.0-only": "GNU Lesser General Public License v3 (LGPLv3)",
  "LGPLv3+": "GNU Lesser General Public License v3 or later (LGPLv3+)",
  "LGPL-3.0-or-later": "GNU Lesser General Public License v3 or later (LGPLv3+)",
  "LGPL": "GNU Library or Lesser General Public License (LGPL)",
  "MIT": "MIT License",
  "PSF-2.0": "Python Software Foundation License"
}