livery.extensions.python._terminal¶
livery.extensions.python._terminal ¶
The runner-terminal rule: a module that imports the runner never asks the terminal.
Whether a person is there has one answer, livery.footman.attended,
which knows --no-input and --dry-run as well as the terminal. A
module that imports the runner has that answer in reach, and asking
the terminal itself (sys.stdin.isatty() and its relatives) ignores
both flags in silence. The runner's own sources implement the answer
and are exempt, and a module that never imports the runner is the
workspace's own business.
The rule is a step of the layering phase,
[phases.layering.runner-terminal], over the one parse of the python
sources: the root's tasks.py and each package's src, the files
a narrowed run reaches or every one. It runs while the python
extension is mounted, which a package whose set holds python mounts.
Functions:
| Name | Description |
|---|---|
runner_terminal |
The step: refuse each terminal question in a module that imports the runner. |
problems |
Each terminal question asked by a module of modules that imports the runner. |
imports_the_runner |
Whether the module tree parses imports the runner, in any spelling. |
terminal_calls |
Every call in the module tree parses that asks a terminal directly. |
Attributes:
| Name | Type | Description |
|---|---|---|
TERMINAL_CALLS |
|
TERMINAL_CALLS
module-attribute
¶
runner_terminal ¶
runner_terminal(ctx: PhaseContext) -> None
The step: refuse each terminal question in a module that imports the runner.
The sources the run reaches (livery.workshop.selected_files) are judged over the one parse; every source when the run knows nothing of what changed.
Source code in packages/extensions/python/src/livery/extensions/python/_terminal.py
problems ¶
problems(modules: tuple[ParsedModule, ...]) -> list[str]
Each terminal question asked by a module of modules that imports the runner.
The root's tasks.py and the sources under each package's
src are judged, apart from the runner's own.
Source code in packages/extensions/python/src/livery/extensions/python/_terminal.py
imports_the_runner ¶
Whether the module tree parses imports the runner, in any spelling.
Source code in packages/extensions/python/src/livery/extensions/python/_terminal.py
terminal_calls ¶
Every call in the module tree parses that asks a terminal directly.