livery.workshop._influence¶
livery.workshop._influence ¶
Which files a workspace step reads, and which of them a change touched.
A workspace step declares its inputs on its record
(livery.workshop._steps.StepRecord inputs): the files it
judges, whether it judges each changed one on its own or runs whole
when any changed, and what widens it to every file it reads. The gate
hands every step the paths changed since the tree it measures from,
and livery.workshop._influence.select answers for one step: skip
it, judge these files, or judge everything.
Two widenings hold for every step. A run that knows nothing of what changed (the whole gate) judges everything. A step whose own code changed judges everything, since its rule moved, not the files: the member package that ships it changed under its sources, or, for a step installed from an index, the lock moved.
Classes:
| Name | Description |
|---|---|
Changes |
What changed since the tree a gate measures from. |
Inputs |
The files a workspace step reads, as the affected engine asks. |
Selection |
What one step judges in a run. |
Functions:
| Name | Description |
|---|---|
reads |
Whether inputs read path: a pattern of its reads names it, and no ignore. |
provider_of |
The member package whose sources ship extension, by its path; empty if none. |
select |
What a step with inputs judges for changes. |
Attributes:
| Name | Type | Description |
|---|---|---|
LOCK |
|
|
Patterns |
|
|
WHOLE |
|
|
SKIP |
|
Changes
dataclass
¶
What changed since the tree a gate measures from.
Attributes:
| Name | Type | Description |
|---|---|---|
root |
Path
|
The workspace root. |
paths |
tuple[str, ...]
|
The changed paths, root-relative posix, deleted ones included. |
before |
str
|
The commit or tree the paths were taken from; empty when the caller named the paths itself. |
Methods:
| Name | Description |
|---|---|
removed |
The changed paths the working tree no longer holds: deleted or moved. |
text_before |
path where the change is measured from; empty if unknown. |
Inputs
dataclass
¶
Inputs(reads: Patterns, per_file: bool = True, widens: Patterns = (), on_removal: bool = False, widen: Callable[[Changes], bool] | None = None, ignores: tuple[str, ...] = ())
The files a workspace step reads, as the affected engine asks.
Attributes:
| Name | Type | Description |
|---|---|---|
reads |
Patterns
|
The files the step judges. |
per_file |
bool
|
Whether the step judges each changed file it reads on its own; otherwise a change to any of them runs it whole. |
widens |
Patterns
|
Files the step does not judge whose change runs it over everything it reads: the contracts, for a step of what is composed from them. |
on_removal |
bool
|
Whether a deleted or moved file anywhere runs it whole: a link checker's, since a link in an unchanged page may point at what went away. |
widen |
Callable[[Changes], bool] | None
|
The step's own further reason to run whole, given the changes: a link checker's removed heading. |
ignores |
tuple[str, ...]
|
Files that never count, though a pattern above names them: a package's readme beside its manifests. |
Selection
dataclass
¶
reads ¶
Whether inputs read path: a pattern of its reads names it, and no ignore.
Source code in packages/workshop/src/livery/workshop/_influence.py
provider_of ¶
The member package whose sources ship extension, by its path; empty if none.
An extension installed from an index has no member: its code moves with the lock instead.
Source code in packages/workshop/src/livery/workshop/_influence.py
select ¶
What a step with inputs judges for changes.
Everything when nothing is known of what changed, when the step's
own code changed (provider, the member that ships it, changed
under src/; for a step with no member, the lock moved), or
when a widening input changed; else the changed files it reads,
each on its own, or everything when it does not judge per file;
nothing when no file it reads changed.