class documentation

Handles metadata supplied in configuration files.

Method __init__ Undocumented
Method __setitem__ Undocumented
Method parse Parses configuration file items from one or more related sections.
Method parse_section Parses configuration file section.
Class Variable aliases Options aliases. For compatibility with various packages. E.g.: d2to1 and pbr. Note: `-` in keys is replaced with `_` by config parser.
Class Variable section_prefix Prefix for config sections handled by this handler. Must be provided by class heirs.
Instance Variable ensure_discovered Undocumented
Instance Variable ignore_option_errors Undocumented
Instance Variable sections Undocumented
Instance Variable set_options Undocumented
Instance Variable target_obj Undocumented
Property parsers Metadata item name to parser function mapping.
Class Method _exclude_files_parser Returns a parser function to make sure field inputs are not files.
Class Method _get_parser_compound Returns parser function to represents value as a list.
Class Method _parse_bool Represents value as boolean.
Class Method _parse_dict Represents value as a dict.
Class Method _parse_list Represents value as a list.
Class Method _parse_section_to_dict Parses section options into a dictionary.
Class Method _parse_section_to_dict_with_key Parses section options into a dictionary.
Class Method _section_options Undocumented
Method _deprecated_config_handler this function will wrap around parameters that are deprecated
Method _parse_attr Represents value as a module attribute.
Method _parse_file Represents value as a string, allowing including text from nearest files using `file:` directive.
Instance Variable _referenced_files After parsing configurations, this property will enumerate all files referenced by the "file:" directive. Private API for setuptools only.
def __init__(self, target_obj: Target, options: AllCommandOptions, ignore_option_errors, ensure_discovered: expand.EnsurePackagesDiscovered): (source)
def __setitem__(self, option_name, value): (source)

Undocumented

def parse(self): (source)

Parses configuration file items from one or more related sections.

def parse_section(self, section_options): (source)

Parses configuration file section. :param dict section_options:

Options aliases. For compatibility with various packages. E.g.: d2to1 and pbr. Note: `-` in keys is replaced with `_` by config parser.

section_prefix: str = (source)

Prefix for config sections handled by this handler. Must be provided by class heirs.

ensure_discovered = (source)

Undocumented

ignore_option_errors = (source)

Undocumented

sections = (source)

Undocumented

set_options: List[str] = (source)

Undocumented

target_obj = (source)

Undocumented

@classmethod
def _exclude_files_parser(cls, key): (source)

Returns a parser function to make sure field inputs are not files. Parses a value after getting the key so error messages are more informative. :param key: :rtype: callable

@classmethod
def _get_parser_compound(cls, *parse_methods): (source)

Returns parser function to represents value as a list. Parses a value applying given methods one after another. :param parse_methods: :rtype: callable

@classmethod
def _parse_bool(cls, value): (source)

Represents value as boolean. :param value: :rtype: bool

@classmethod
def _parse_dict(cls, value): (source)

Represents value as a dict. :param value: :rtype: dict

@classmethod
def _parse_list(cls, value, separator=','): (source)

Represents value as a list. Value is split either by separator (defaults to comma) or by lines. :param value: :param separator: List items separator character. :rtype: list

@classmethod
def _parse_section_to_dict(cls, section_options, values_parser=None): (source)

Parses section options into a dictionary. Optionally applies a given parser to each value. :param dict section_options: :param callable values_parser: function with 1 arg corresponding to option value :rtype: dict

@classmethod
def _parse_section_to_dict_with_key(cls, section_options, values_parser): (source)

Parses section options into a dictionary. Applies a given parser to each option in a section. :param dict section_options: :param callable values_parser: function with 2 args corresponding to key, value :rtype: dict

@classmethod
def _section_options(cls, options: AllCommandOptions): (source)

Undocumented

def _deprecated_config_handler(self, func, msg, warning_class): (source)

this function will wrap around parameters that are deprecated :param msg: deprecation message :param warning_class: class of warning exception to be raised :param func: function to be wrapped around

def _parse_attr(self, value, package_dir, root_dir: _Path): (source)

Represents value as a module attribute. Examples: attr: package.attr attr: package.module.attr :param str value: :rtype: str

def _parse_file(self, value, root_dir: _Path): (source)

Represents value as a string, allowing including text from nearest files using `file:` directive. Directive is sandboxed and won't reach anything outside directory with setup.py. Examples: file: README.rst, CHANGELOG.md, src/file.txt :param str value: :rtype: str

_referenced_files: Set[str] = (source)

After parsing configurations, this property will enumerate all files referenced by the "file:" directive. Private API for setuptools only.