Load setuptools configuration from ``setup.cfg`` files. **API will be made private in the future**
Class |
|
Handles metadata supplied in configuration files. |
Class |
|
No class docstring; 1/1 property, 0/2 instance variable, 1/3 class variable, 1/2 method documented |
Class |
|
No class docstring; 1/1 property, 0/2 instance variable, 0/1 class variable, 7/12 methods, 0/1 class method documented |
Function | apply |
Apply the configuration from a ``setup.cfg`` file into an existing distribution object. |
Function | configuration |
Returns configuration data gathered by given handlers as a dict. |
Function | parse |
Performs additional parsing of configuration options for a distribution. |
Function | read |
Read given configuration file and returns options from it as a dict. |
Type Variable |
|
Undocumented |
Type Alias |
|
Undocumented |
Type Alias |
|
Dict that associate the name of the options of a particular command to a tuple. The first element of the tuple indicates the origin of the option value (e.g. the name of the configuration file where it was read from), while the second element of the tuple is the option value itself... |
Function | _apply |
Read configuration from ``filepath`` and applies to the ``dist`` object. |
Function | _get |
Given a target object and option key, get that option from the target object, either through a get_{key} method or from an attribute directly. |
Function | _warn |
Because users sometimes misinterpret this configuration: |
Type Alias | _ |
Undocumented |
Returns configuration data gathered by given handlers as a dict. :param list[ConfigHandler] handlers: Handlers list, usually from parse_configuration() :rtype: dict
Distribution
, command_options: AllCommandOptions
, ignore_option_errors=False) -> Tuple[ ConfigMetadataHandler, ConfigOptionsHandler]
:
(source)
¶
Performs additional parsing of configuration options for a distribution. Returns a list of used option handlers. :param Distribution distribution: :param dict command_options: :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: list
_Path
, find_others=False, ignore_option_errors=False) -> dict
:
(source)
¶
Read given configuration file and returns options from it as a dict. :param str|unicode filepath: Path to configuration file to get options from. :param bool find_others: Whether to search for other configuration files which could be on in various places. :param bool ignore_option_errors: Whether to silently ignore options, values of which could not be resolved (e.g. due to exceptions in directives such as file:, attr:, etc.). If False exceptions are propagated as expected. :rtype: dict
Dict that associate the name of the options of a particular command to a tuple. The first element of the tuple indicates the origin of the option value (e.g. the name of the configuration file where it was read from), while the second element of the tuple is the option value itself
Value |
|
Distribution
, filepath: _Path
, other_files: Iterable[ _Path]
= (), ignore_option_errors: bool
= False) -> Tuple[ ConfigHandler, ...]
:
(source)
¶
Read configuration from ``filepath`` and applies to the ``dist`` object.
Given a target object and option key, get that option from the target object, either through a get_{key} method or from an attribute directly.
Because users sometimes misinterpret this configuration: [options.extras_require] foo = bar;python_version<"4" It looks like one requirement with an environment marker but because there is no newline, it's parsed as two requirements with a semicolon as separator. Therefore, if: * input string does not contain a newline AND * parsed result contains two requirements AND * parsing of the two parts from the result ("<first>;<second>") leads in a valid Requirement with a valid marker a UserWarning is shown to inform the user about the possible problem.