livery.workshop._root_attribution¶
livery.workshop._root_attribution ¶
Which packages a change to a file outside every package is about.
The affected engine (livery.workshop._graph.affected_from_paths)
reads a changed root file as affecting everything, since the root
files configure every gate. Adding or removing a package changes root
files too: the composed pyproject.toml names the member, CODEOWNERS
its directory, uv.lock its entry. This module attributes such a
change to the packages it is about, so the package's own gate runs and
the others' do not.
A root file's change is explained by the package set when removing
every entry that names an added or removed package, from both
versions, leaves the same text. uv.lock's change is attributed per
member: each workspace member whose resolved closure differs is
affected, and the root project's own change must lie inside the
closures of affected members. Anything else is unexplained, and the
caller runs everything, as before.
Classes:
| Name | Description |
|---|---|
Delta |
The packages that exist on one side of a change and not the other. |
Functions:
| Name | Description |
|---|---|
package_delta |
The packages added and removed between before and the working tree. |
explained |
Whether a root file's change names only delta's packages. |
lock_affected |
The package paths whose resolution the lock's change moves; None for everything. |
Attributes:
| Name | Type | Description |
|---|---|---|
LOCK |
|
|
Node |
|
Delta
dataclass
¶
The packages that exist on one side of a change and not the other.
Attributes:
| Name | Type | Description |
|---|---|---|
added |
tuple[Package, ...]
|
The packages the change adds, as discovery sees them now. |
removed |
tuple[tuple[str, str], ...]
|
The removed packages' paths and distribution names, as their contracts said before the change. |
Methods:
| Name | Description |
|---|---|
holds |
Whether path lies under a removed package's directory. |
package_delta ¶
The packages added and removed between before and the working tree.
One listing of before's tree answers which contracts existed
then; a package's contract is packages/<name>/workshop.toml or,
in a group directory, packages/<group>/<name>/workshop.toml.
Source code in packages/workshop/src/livery/workshop/_root_attribution.py
explained ¶
Whether a root file's change names only delta's packages.
Source code in packages/workshop/src/livery/workshop/_root_attribution.py
lock_affected ¶
The package paths whose resolution the lock's change moves; None for everything.
Everything when either side does not parse, when anything beside the member list and the entries changed (the resolution's settings), or when the root project's closure changed outside the closures of the affected members: a tool only the root resolves configures every gate.