sphinxcontrib.extras_require.sources
Supported sources for the requirements are implemented here.
Data:
Instance of |
Classes:
|
Class to store functions that provide requirements sources. |
Functions:
|
Load requirements from the specified file. |
|
Load requirements from the |
|
Load requirements from a |
|
Load requirements from the |
|
Load requirements from a |
-
class
Sources
(iterable=(), /)[source] Bases:
List
[Tuple
[str
,Callable
,Callable
]]Class to store functions that provide requirements sources.
The syntax of each entry is:
(option_name, getter_function, validator_function)
a string to use in the directive to specify the source to use,
the function that returns the list of additional requirements,
a function to validate the option value provided by the user.
Methods:
register
(option_name[, validator])Decorator to register a function.
-
register
(option_name, validator=<function 'unchanged'>)[source] Decorator to register a function.
The function must have the following signature:
def function( package_root: pathlib.Path, options: Dict, env: sphinx.environment.BuildEnvironment, extra: str, ) -> List[str]: ...
- Parameters
- Return type
- Returns
The registered function.
- Raises
SyntaxError
if the decorated function does not take the correct arguments.
-
requirements_from_file
(package_root, options, env, extra)[source] Load requirements from the specified file.
-
requirements_from_flit
(package_root, options, env, extra)[source] Load requirements from the
[tool.flit.metadata.requires-extra]
section of apyproject.toml
file in the root of the repository.
-
requirements_from_pkginfo
(package_root, options, env, extra)[source] Load requirements from a
__pkginfo__.py
file in the root of the repository.
-
requirements_from_pyproject
(package_root, options, env, extra)[source] Load requirements from the
[project.optional-dependencies]
section of apyproject.toml
file in the root of the repository.See also
PEP 621 – Storing project metadata in pyproject.toml
New in version 0.3.0.