livery.workshop._update_driver¶
livery.workshop._update_driver ¶
workflow.update: the update family on the engine.
One update: workflow.update.dependencies [names...] brings
dependencies current in both of their homes, the lock for external
dependencies and the floors for workspace siblings, which the lock
cannot move because they resolve from source; the bare
workflow.update runs it for every dependency. The extensions are
dependencies like any other: the update installs what the lock moved
to and writes the files the new wheels compose, so a new workshop
and its files arrive in one pull request.
An update prepared while a release flies parks unarmed and waits, watching the releases; when the last completes it re-runs itself, picking up the fresh floors, and arms. Ctrl-C is safe: re-entry is the same state machine. A non-interactive run waits bounded, then parks at exit 0 with the same prose, parked is the verb having done its job.
Classes:
| Name | Description |
|---|---|
UpdateDriver |
One update flavor's driver for the shared engine. |
Functions:
| Name | Description |
|---|---|
run_gate |
Run the gate with |
wait_for_releases |
Wait while releases fly; True when none remains in flight. |
update_dependencies |
Bring dependencies current in both of their homes. |
update_default |
Bring every dependency current: the bare |
Attributes:
| Name | Type | Description |
|---|---|---|
BOUNDED_WAIT |
|
|
WAIT_POLL |
|
|
update_group |
|
update_group
module-attribute
¶
update_group = workflow.group('update', help='Bring the workspace current')
UpdateDriver ¶
UpdateDriver(root: Path, flavor: str, *, armed: bool, names: tuple[str, ...] = (), refresh: bool = False)
One update flavor's driver for the shared engine.
Methods:
| Name | Description |
|---|---|
discard |
Refuse: an update has no release set, so nothing makes it stale. |
prepare |
Do the flavor's work, or resume what a killed run committed. |
on_merged |
Merging is an update's completion; nothing follows. |
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
|
|
members |
tuple[str, ...]
|
|
watch |
float
|
|
name |
|
|
armed |
|
|
branch |
str
|
|
base |
str
|
|
Source code in packages/workshop/src/livery/workshop/_update_driver.py
discard ¶
Refuse: an update has no release set, so nothing makes it stale.
Only a release's moved set re-derives; an update behind its base merges the base in instead.
Source code in packages/workshop/src/livery/workshop/_update_driver.py
prepare ¶
prepare() -> Submission | None
Do the flavor's work, or resume what a killed run committed.
Committed-but-unsubmitted work on the branch is submitted as
it stands, redoing nothing: every subject on the branch is the
driver's own conventional chore: line, so resuming is
safe; a foreign subject stops with the options, someone's
hand-made commits are not silently shipped. A refresh
driver (the re-run after a parked update's releases finish)
runs the work again on the branch instead, so the floors
those releases earned land as a second commit.
Source code in packages/workshop/src/livery/workshop/_update_driver.py
94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | |
run_gate ¶
run_gate(root: Path) -> None
Run the gate with --fix over the update's changes; red stops.
A red gate leaves the changes uncommitted on the workflow branch: fix the tree there and run the same update verb again, it resumes from that state. The gate's own output carries in the refusal, because the caller is often a script that sees only this message and would otherwise be told a gate is red with no word about which step.
Source code in packages/workshop/src/livery/workshop/_update_driver.py
wait_for_releases ¶
wait_for_releases(repo: Repository, root: Path, *, interactive: bool, timeout: float = BOUNDED_WAIT, poll: float = WAIT_POLL) -> bool
Wait while releases fly; True when none remains in flight.
The parked update's promise: it finishes itself once the last release completes. Interactive runs wait indefinitely, Ctrl-C always safe (re-entry resumes); non-interactive runs wait timeout then answer False, and the caller parks at exit 0.
Source code in packages/workshop/src/livery/workshop/_update_driver.py
update_dependencies ¶
update_dependencies(*names: str, armed: Annotated[bool, doc("arm the update's PR to merge on green")] = False) -> None
Bring dependencies current in both of their homes.
Bare upgrades every external dependency through the lock and raises every sibling floor to its latest release; naming dependencies scopes which move, never where, one workspace lock is one resolution. A named sibling moves its floor and only its floor, since the lock cannot move what resolves from source.