livery.extensions.python._answers¶
livery.extensions.python._answers ¶
The python extension's answers: about a package, and about the workspace.
About a package, from its manifest and sources: its version, the files a version is written into, its requirements, the names its code is referenced by, its public modules and what each source references. About the workspace, while pytest is listed: the functions that run the python packages' suites and a package's documentation examples, and the function that widens a change to a module pytest loads as a plugin to every member pytest runs.
Functions:
| Name | Description |
|---|---|
current_version |
The version the package's |
version_files |
|
requirements |
The package's |
requirement_writers |
The pyproject's writer of a requirement on a sibling that holds python. |
test_requirements |
The package's |
test_requirement_writers |
The pyproject's writer of a test requirement on a sibling that holds python. |
module_roots |
The import prefixes the package's code is referenced by. |
public_modules |
The modules that declare the package's public API. |
references |
What each python source under |
distributions |
The distribution the package releases, as its ecosystem and its name. |
executables |
The scripts the package's |
registry |
The simple index the package is released to, as a probe of its versions. |
suite_runner |
Answer |
examples_runner |
Answer |
plugin_reaches |
Answer |
Attributes:
| Name | Type | Description |
|---|---|---|
ECOSYSTEM |
|
current_version ¶
version_files ¶
pyproject.toml, and every __init__.py that may carry __version__.
requirements ¶
The package's [project.dependencies], each name to its constraint.
requirement_writers ¶
requirement_writers(package: Package) -> tuple[RequirementWriter, ...]
The pyproject's writer of a requirement on a sibling that holds python.
test_requirements ¶
The package's test extra, each name to its constraint.
test_requirement_writers ¶
test_requirement_writers(package: Package) -> tuple[RequirementWriter, ...]
The pyproject's writer of a test requirement on a sibling that holds python.
Source code in packages/extensions/python/src/livery/extensions/python/_answers.py
module_roots ¶
The import prefixes the package's code is referenced by.
public_modules ¶
The modules that declare the package's public API.
references ¶
references(package: Package) -> tuple[SourceReferences, ...]
What each python source under src and tests references, one per file.
distributions ¶
The distribution the package releases, as its ecosystem and its name.
executables ¶
The scripts the package's pyproject.toml names in [project.scripts].
registry ¶
The simple index the package is released to, as a probe of its versions.
The index is the python target the registry ladder resolves for the package's workspace (livery.workshop.registry), and the probe reads it with the target's credential: an authenticated index, a forge's own registry or a private owner's, answers only with it, and an anonymous probe would wait for a version the index already serves.
Source code in packages/extensions/python/src/livery/extensions/python/_answers.py
suite_runner ¶
Answer python.test.runner with the function that runs the suites.
pytest's test step asks with the workspace root, which the answer does not depend on, and calls the answer with the words for pytest, the packages whose suites run in one call, the root, the test files that stand for each package's suite, the CI point and whether the run is measured.
Source code in packages/extensions/python/src/livery/extensions/python/_answers.py
examples_runner ¶
Answer python.examples.runner with the function that runs examples.
pytest's examples step asks with the workspace root, which the answer does not depend on, and calls the answer once per package with the package, the root, the example files the run names (empty for all of them) and the words for pytest.
Source code in packages/extensions/python/src/livery/extensions/python/_answers.py
plugin_reaches ¶
plugin_reaches(root: Path) -> tuple[Callable[[Changes], Mapping[str, tuple[str, tuple[str, ...]]]], ...]
Answer reaches with the function that follows pytest's plugins.
The affected engine asks with the workspace root, which the answer
does not depend on, and calls the function with the run's change.
pytest loads a module a member names under pytest11 into every
session, so a change to one reaches every member pytest runs over
(livery.extensions.python._backend.plugin_reaches).