Coverage for packages/workshop/src/livery/workshop/__init__.py: 89%

Measured by coverage.py 7.16.2 on CPython 3.14 while the suites of tests, packages/workshop, packages/extensions/ty, packages/extensions/ruff, packages/extensions/python, packages/extensions/pytest, packages/extensions/pyrefly, packages/extensions/nanobind, packages/extensions/mypy, packages/extensions/mkdocstrings, packages/extensions/lfs, packages/extensions/docs, packages/extensions/cpp, packages/extensions/coverage, packages/extensions/conan, packages/extensions/cmake, packages/extensions/claude, packages/extensions/clang-tidy, packages/extensions/clang-format, packages/extensions/changelog, packages/extensions/basedpyright ran.

1"""The livery ecosystem's devkit.
2
3The task surface arrives through the footman plugin
4(``plugin("livery.workshop")``); this module's own API is the extension
5walk (livery.workshop.extension_names, livery.workshop.workspace_root),
6the package contracts
7(livery.workshop.discover_packages, livery.workshop.verify_workspace
8over livery.workshop.Package and livery.workshop.Edge). The forge
9lane belongs to
10livery.forge.Forge; the workshop orchestrates local, git, and forge
11steps and never hands a raw forge verb to a user.
12
13An extension in its own wheel declares itself in an ``extension.toml``
14beside the package its ``workshop.extensions`` entry point names: the
15steps it adds to the gate's phases under ``[phases.<phase>.<step>]``,
16each with its body under ``main``, a template of its tool's words
17with ``{paths}`` where the paths the run reaches go and
18``{arguments}`` where the words after ``--`` go, or the function that
19runs it as ``"module:function"``. A step in code takes a
20[livery.workshop.PhaseContext][]. One that narrows by paths reads them
21from [livery.workshop.scoped_paths][], which answers
22[livery.workshop.WHOLE][] for the tool's configured whole, and
23calls its tool through [livery.workshop.run_batched][]; a workspace
24step that declares no ``inputs`` narrows by packages and reads them
25from [livery.workshop.scoped_packages][], and one that judges a
26package at a time (``scope = "package"``) reads its files from
27[livery.workshop.scoped_files][]. One that declares ``inputs`` judges
28the whole workspace in every scope, and asks
29[livery.workshop.selected_files][] which of them this run's change
30touched, with the context its run was handed; its ``widen``
31reference receives the run's [livery.workshop.Changes][]. A step
32declares the options a package may set on it under its ``options``
33and reads a package's value with [livery.workshop.step_option][],
34which answers from the installed declaration in a process that
35mounted nothing. A step names the extensions it judges packages by,
36[livery.workshop.step_extensions][], and judges a package whose set
37holds one of them: the extensions it lists and every one they
38require, [livery.workshop.extension_set][]. A step declared
39``enabled = false`` registers once the root contract turns it on at
40the step's address, which [livery.workshop.step_enabled][] answers.
41A step asks a package's extensions
42what it needs of the package with [livery.workshop.answer][]: the
43modules a type-completeness step verifies,
44[livery.workshop.PUBLIC_MODULES][], or where the package's build
45writes the compilation database a linter reads,
46[livery.workshop.COMPILE_COMMANDS][]. The workspace's own tests, the
47``tests`` directory at its root, are a unit of their own,
48[livery.workshop.workspace_suite][], which holds the root's set. A
49test step runs them beside the packages it judges while that set
50holds an extension the step names: [livery.workshop.scoped_suite][]
51returns the unit then. A step whose tool of the store is not on
52``PATH`` refuses with [livery.workshop.undeployed][]: the refusal
53names the tool and the sync that deploys it.
54
55An extension reads the workspace through the names the engine reads
56it by: the root of the workspace a package is a member of,
57[livery.workshop.Package.root][]; a contract's judged keys,
58[livery.workshop.read_contract][]; a query's answer,
59[livery.workshop.answer][], asked with a package or
60the workspace root through a [livery.workshop.Query][] handle; the CI
61run it belongs to, [livery.workshop.ci_run][], a
62[livery.workshop.RunContext][] or None at a desk; the workspace's
63repository on its forge, [livery.workshop.forge_repository][], and,
64connected, [livery.workshop.this_repository][] on
65[livery.workshop.this_forge][], whose everyday token
66[livery.workshop.forge_token][] resolves; the
67registry an artifact kind goes to, [livery.workshop.registry][], a
68[livery.workshop.RegistryTarget][], which a step of the ``publish``
69phase reads from its ``registry-target`` key with
70[livery.workshop.RegistryTarget.from_table][]; and the release
71notes' provider the listed extensions answer,
72[livery.workshop.release_notes][], which
73answers the [livery.workshop.ReleaseNotes][] protocol. A file an extension
74writes outside the engine opens with
75[livery.workshop.generated_header][]. What a CI run changed
76against the base it measures from is [livery.workshop.ci_changes][].
77The guidance for one reader, [livery.workshop.AGENT][] or
78[livery.workshop.HUMAN][], is the composed set of
79[livery.workshop.Prose][] fragments [livery.workshop.guidance][]
80answers; each listed extension's shipped files live where
81[livery.workshop.shipped_content][] says; the gate's fixers run over
82named files through [livery.workshop.fix_files][], and a phase's steps
83over named packages through [livery.workshop.run_phase_over][]; and
84what the listed extensions declare for an extension is
85[livery.workshop.contributions_for][]. A phase the gate never runs,
86one declared ``gated = false``, runs over the workspace through
87[livery.workshop.run_phase][], which first removes what a step that
88stopped running declared it writes under ``outputs``. The members come
89in release order from [livery.workshop.order_topologically][], every
90dependency before its dependents, and [livery.workshop.release_tag][]
91reads the member and the version a release tag names. A query's
92combine function that decides between answers by what each answering
93extension requires hands the lookup it is called with to
94[livery.workshop.nearest_extensions][].
95
96An extension that keeps records of a CI run reaches them through the
97names the gate's own records use. The workshop's series live on the
98checkout's state store, [livery.workshop.state_store][]; on it,
99[livery.workshop.RUNS][] keeps each check leg's files for one run
100until the gate job collects them. A check leg's entry leaves a file
101for the leg's one write with [livery.workshop.leave_leg_file][], and
102reads what the gate ran on the leg, a [livery.workshop.LegScope][],
103from [livery.workshop.leg_scope][]. The gate job's entry leaves a
104section of the run's row with [livery.workshop.leave_section][]. The
105branch whose run proved the checkout's tree, a
106[livery.workshop.VerifiedBranch][], is what
107[livery.workshop.verified_branch][] reads. The check legs the gate produces
108are [livery.workshop.check_legs][], and those a pull request's run
109produces are [livery.workshop.pull_request_legs][], unless the pull
110request carries [livery.workshop.EVERY_RUNNER_LABEL][], when its run
111produces every leg; split into the
112shards the contract gives each runner they are
113[livery.workshop.check_shards][] and
114[livery.workshop.pull_request_shards][], each shard spelled by a
115[livery.workshop.Shard][] at the end of its label, which
116[livery.workshop.platform_leg][] and [livery.workshop.shard_of][]
117split. A shard's share of the items a test step partitions, pytest's
118test files, is what [livery.workshop.partition][] packs from the medians
119[livery.workshop.read_durations][] takes over the platform leg's rows
120in the [livery.workshop.DURATIONS][] family, bounded by
121[livery.workshop.checkout_time][]; the set it partitioned has the
122digest [livery.workshop.files_digest][], and the shard leaves what it
123ran with [livery.workshop.leave_shard][], a
124[livery.workshop.ShardMarker][] that [livery.workshop.read_shard][]
125reads back. Of a set of
126units, each a member's suite or the workspace's own tests at
127[livery.workshop.WORKSPACE_TESTS][], [livery.workshop.tested][] keeps
128those a test step runs. Whether a package holds the extension of the
129workshop's own language is [livery.workshop.holds_runtime_language][],
130and what a path is to its package, a [livery.workshop.Category][], is
131[livery.workshop.category_of][].
132
133An extension that builds a release's artifacts in a CI job of its own
134reaches the release through the names the release train uses. The
135members a release squash releases, each with its version, are what
136[livery.workshop.discover_release][] reads at a commit, and
137[livery.workshop.build_release][] builds one of them as the release
138train does, into its ``dist/``. The members a job of the release point
139builds before the wave are the workspace's answer to
140[livery.workshop.JOB_BUILT_MEMBERS][]. The interpreters the CI matrix
141runs are [livery.workshop.python_matrix][]. What the checkout
142installed of each tool is [livery.workshop.tool_receipts][], a
143[livery.workshop.ToolReceipt][] per tool, and the tool store's home on
144this machine is [livery.workshop.store_home][].
145
146An extension that judges a language's sources reads what each source
147references from its package's ``references`` answer: one
148[livery.workshop.SourceReferences][] per source, and a
149[livery.workshop.ReferencedName][] for each name the source references
150and how it makes the reference. Which member owns a referenced name is
151what [livery.workshop.neighbours][] answers, a
152[livery.workshop.Neighbours][] made from each member's module roots. A
153step over the sources runs over every one of them when
154[livery.workshop.graph_changed][] says a contract, a native manifest or
155a root ``src/`` changed.
156
157An extension that runs python in a venv names its interpreter with
158[livery.workshop.venv_python][] and its executables directory with
159[livery.workshop.scripts_dir][]. A runner that starts pytest shares two
160names with the workshop's pytest plugins: [livery.workshop.is_example][]
161says which files the examples plugin collects as documentation
162examples, and the speed plugin sums each package's test time into the
163file the runner names in the variable
164[livery.workshop.SPEED_FILE_VARIABLE][]. The plugins read three more
165names of the workshop: the speed plugin sums by the package
166[livery.workshop.package_of][] names for a test's node id, the points
167plugin selects the tests of the CI point named in
168[livery.workshop.POINT_VARIABLE][], and the layout plugin checks the
169tests directory of each directory
170[livery.workshop.package_directories][] lists. Each package's mark on
171each check leg, a [livery.workshop.SpeedMark][], is what
172[livery.workshop.speed_marks][] reads.
173
174An extension adds steps to a package's lifecycle phases under
175``[phases.<phase>.<step>]``, with the keys every step takes;
176each runs once per package whose set holds the extension and
177receives the same [livery.workshop.PhaseContext][], which carries the
178keys the steps provide and read. It
179answers questions about a package under ``[queries]``: each a
180[livery.workshop.Query][] the workshop defines, such as
181[livery.workshop.PUBLIC_MODULES][] or [livery.workshop.EXECUTABLES][],
182which [livery.workshop.answer][] asks of a package's extensions and
183combines by the query's rule. Each function it answers
184``requirement-writers`` with writes a requirement on a sibling into
185the package's manifest, and is a [livery.workshop.RequirementWriter][].
186"""
187
188from __future__ import annotations(empty)
189
190# The literal-False spelling the checkers honour without importing
191# `typing`: the names below are what a checker sees, and at runtime
192# `__getattr__` serves each from its module when it is read, so importing
193# one private module of the workshop never loads the rest.
194TYPE_CHECKING = False(empty)
195if TYPE_CHECKING:(empty)
196 from livery.workshop import testing as testing
197 from livery.workshop._categories import Category as Category
198 from livery.workshop._categories import category_of as category_of
199 from livery.workshop._ci_context import POINT_VARIABLE as POINT_VARIABLE
200 from livery.workshop._ci_context import RunContext as RunContext
201 from livery.workshop._ci_context import ci_run as ci_run
202 from livery.workshop._ci_context import state_store as state_store
203 from livery.workshop._composition import extension_set as extension_set
204 from livery.workshop._composition import (
205 nearest_extensions as nearest_extensions,
206 )
207 from livery.workshop._contract import read_contract as read_contract
208 from livery.workshop._examples import is_example as is_example
209 from livery.workshop._extensions import contributions_for as contributions_for
210 from livery.workshop._extensions import extension_names as extension_names
211 from livery.workshop._extensions import shipped_content as shipped_content
212 from livery.workshop._extensions import workspace_root as workspace_root
213 from livery.workshop._forge_lane import forge_repository as forge_repository
214 from livery.workshop._forge_lane import this_forge as this_forge
215 from livery.workshop._forge_lane import this_repository as this_repository
216 from livery.workshop._graph import order_topologically as order_topologically
217 from livery.workshop._influence import Changes as Changes
218 from livery.workshop._invoke import run_batched as run_batched
219 from livery.workshop._lifecycle import build_release as build_release
220 from livery.workshop._metrics import RUNS as RUNS
221 from livery.workshop._metrics import leave_leg_file as leave_leg_file
222 from livery.workshop._metrics import leave_section as leave_section
223 from livery.workshop._packages import WORKSPACE_TESTS as WORKSPACE_TESTS
224 from livery.workshop._packages import Edge as Edge
225 from livery.workshop._packages import Neighbours as Neighbours
226 from livery.workshop._packages import Package as Package
227 from livery.workshop._packages import ReferencedName as ReferencedName
228 from livery.workshop._packages import SourceReferences as SourceReferences
229 from livery.workshop._packages import discover_packages as discover_packages
230 from livery.workshop._packages import (
231 holds_runtime_language as holds_runtime_language,
232 )
233 from livery.workshop._packages import neighbours as neighbours
234 from livery.workshop._packages import (
235 package_directories as package_directories,
236 )
237 from livery.workshop._packages import release_tag as release_tag
238 from livery.workshop._packages import verify_workspace as verify_workspace
239 from livery.workshop._packages import workspace_suite as workspace_suite
240 from livery.workshop._phases import PhaseContext as PhaseContext
241 from livery.workshop._phases import run_phase as run_phase
242 from livery.workshop._points import EVERY_RUNNER_LABEL as EVERY_RUNNER_LABEL
243 from livery.workshop._points import check_legs as check_legs
244 from livery.workshop._points import check_shards as check_shards
245 from livery.workshop._points import pull_request_legs as pull_request_legs
246 from livery.workshop._points import pull_request_shards as pull_request_shards
247 from livery.workshop._prose import AGENT as AGENT
248 from livery.workshop._prose import HUMAN as HUMAN
249 from livery.workshop._prose import Prose as Prose
250 from livery.workshop._prose import guidance as guidance
251 from livery.workshop._provenance import generated_header as generated_header
252 from livery.workshop._publish import discover_release as discover_release
253 from livery.workshop._pythons import python_matrix as python_matrix
254 from livery.workshop._pythons import scripts_dir as scripts_dir
255 from livery.workshop._pythons import venv_python as venv_python
256 from livery.workshop._quality import ci_changes as ci_changes
257 from livery.workshop._quality import fix_files as fix_files
258 from livery.workshop._quality import run_phase_over as run_phase_over
259 from livery.workshop._queries import COMPILE_COMMANDS as COMPILE_COMMANDS
260 from livery.workshop._queries import CURRENT_VERSION as CURRENT_VERSION
261 from livery.workshop._queries import DISTRIBUTIONS as DISTRIBUTIONS
262 from livery.workshop._queries import EXECUTABLES as EXECUTABLES
263 from livery.workshop._queries import JOB_BUILT_MEMBERS as JOB_BUILT_MEMBERS
264 from livery.workshop._queries import MODULE_ROOTS as MODULE_ROOTS
265 from livery.workshop._queries import PUBLIC_MODULES as PUBLIC_MODULES
266 from livery.workshop._queries import REQUIREMENTS as REQUIREMENTS
267 from livery.workshop._queries import VERSION_FILES as VERSION_FILES
268 from livery.workshop._queries import Query as Query
269 from livery.workshop._queries import RequirementWriter as RequirementWriter
270 from livery.workshop._queries import answer as answer
271 from livery.workshop._registries import RegistryTarget as RegistryTarget
272 from livery.workshop._registries import registry as registry
273 from livery.workshop._release_notes import ReleaseNotes as ReleaseNotes
274 from livery.workshop._release_notes import release_notes as release_notes
275 from livery.workshop._shard import DURATIONS as DURATIONS
276 from livery.workshop._shard import Shard as Shard
277 from livery.workshop._shard import ShardMarker as ShardMarker
278 from livery.workshop._shard import checkout_time as checkout_time
279 from livery.workshop._shard import files_digest as files_digest
280 from livery.workshop._shard import leave_shard as leave_shard
281 from livery.workshop._shard import partition as partition
282 from livery.workshop._shard import platform_leg as platform_leg
283 from livery.workshop._shard import read_durations as read_durations
284 from livery.workshop._shard import read_shard as read_shard
285 from livery.workshop._shard import shard_of as shard_of
286 from livery.workshop._speed import SPEED_FILE_VARIABLE as SPEED_FILE_VARIABLE
287 from livery.workshop._speed import SpeedMark as SpeedMark
288 from livery.workshop._speed import package_of as package_of
289 from livery.workshop._speed import speed_marks as speed_marks
290 from livery.workshop._steps import NONE as NONE
291 from livery.workshop._steps import PACKAGE as PACKAGE
292 from livery.workshop._steps import PACKAGES as PACKAGES
293 from livery.workshop._steps import PATHS as PATHS
294 from livery.workshop._steps import WHOLE as WHOLE
295 from livery.workshop._steps import graph_changed as graph_changed
296 from livery.workshop._steps import scoped_files as scoped_files
297 from livery.workshop._steps import scoped_packages as scoped_packages
298 from livery.workshop._steps import scoped_paths as scoped_paths
299 from livery.workshop._steps import scoped_suite as scoped_suite
300 from livery.workshop._steps import selected_files as selected_files
301 from livery.workshop._steps import step_enabled as step_enabled
302 from livery.workshop._steps import step_extensions as step_extensions
303 from livery.workshop._steps import step_option as step_option
304 from livery.workshop._steps import tested as tested
305 from livery.workshop._tokens import forge_token as forge_token
306 from livery.workshop._tools import ToolReceipt as ToolReceipt
307 from livery.workshop._tools import store_home as store_home
308 from livery.workshop._tools import tool_receipts as tool_receipts
309 from livery.workshop._tools import undeployed as undeployed
310 from livery.workshop._verified import LegScope as LegScope
311 from livery.workshop._verified import VerifiedBranch as VerifiedBranch
312 from livery.workshop._verified import leg_scope as leg_scope
313 from livery.workshop._verified import verified_branch as verified_branch
314
315__version__ = "0.11.0"(empty)
316
317__all__ = [(empty)
318 "AGENT",
319 "COMPILE_COMMANDS",
320 "CURRENT_VERSION",
321 "DISTRIBUTIONS",
322 "DURATIONS",
323 "EVERY_RUNNER_LABEL",
324 "EXECUTABLES",
325 "HUMAN",
326 "JOB_BUILT_MEMBERS",
327 "MODULE_ROOTS",
328 "NONE",
329 "PACKAGE",
330 "PACKAGES",
331 "PATHS",
332 "POINT_VARIABLE",
333 "PUBLIC_MODULES",
334 "REQUIREMENTS",
335 "RUNS",
336 "SPEED_FILE_VARIABLE",
337 "VERSION_FILES",
338 "WHOLE",
339 "WORKSPACE_TESTS",
340 "Category",
341 "Changes",
342 "Edge",
343 "LegScope",
344 "Neighbours",
345 "Package",
346 "PhaseContext",
347 "Prose",
348 "Query",
349 "ReferencedName",
350 "RegistryTarget",
351 "ReleaseNotes",
352 "RequirementWriter",
353 "RunContext",
354 "Shard",
355 "ShardMarker",
356 "SourceReferences",
357 "SpeedMark",
358 "ToolReceipt",
359 "VerifiedBranch",
360 "__version__",
361 "answer",
362 "build_release",
363 "category_of",
364 "check_legs",
365 "check_shards",
366 "checkout_time",
367 "ci_changes",
368 "ci_run",
369 "contributions_for",
370 "discover_packages",
371 "discover_release",
372 "extension_names",
373 "extension_set",
374 "files_digest",
375 "fix_files",
376 "forge_repository",
377 "forge_token",
378 "generated_header",
379 "graph_changed",
380 "guidance",
381 "holds_runtime_language",
382 "is_example",
383 "leave_leg_file",
384 "leave_section",
385 "leave_shard",
386 "leg_scope",
387 "nearest_extensions",
388 "neighbours",
389 "order_topologically",
390 "package_directories",
391 "package_of",
392 "partition",
393 "platform_leg",
394 "pull_request_legs",
395 "pull_request_shards",
396 "python_matrix",
397 "read_contract",
398 "read_durations",
399 "read_shard",
400 "registry",
401 "release_notes",
402 "release_tag",
403 "run_batched",
404 "run_phase",
405 "run_phase_over",
406 "scoped_files",
407 "scoped_packages",
408 "scoped_paths",
409 "scoped_suite",
410 "scripts_dir",
411 "selected_files",
412 "shard_of",
413 "shipped_content",
414 "speed_marks",
415 "state_store",
416 "step_enabled",
417 "step_extensions",
418 "step_option",
419 "store_home",
420 "tested",
421 "testing",
422 "this_forge",
423 "this_repository",
424 "tool_receipts",
425 "undeployed",
426 "venv_python",
427 "verified_branch",
428 "verify_workspace",
429 "workspace_root",
430 "workspace_suite",
431]
432
433# The module each lazily served name lives in.
434_EXPORTS: dict[str, str] = {(empty)
435 "COMPILE_COMMANDS": "livery.workshop._queries",
436 "CURRENT_VERSION": "livery.workshop._queries",
437 "DISTRIBUTIONS": "livery.workshop._queries",
438 "EXECUTABLES": "livery.workshop._queries",
439 "MODULE_ROOTS": "livery.workshop._queries",
440 "PUBLIC_MODULES": "livery.workshop._queries",
441 "REQUIREMENTS": "livery.workshop._queries",
442 "VERSION_FILES": "livery.workshop._queries",
443 "JOB_BUILT_MEMBERS": "livery.workshop._queries",
444 "ToolReceipt": "livery.workshop._tools",
445 "build_release": "livery.workshop._lifecycle",
446 "discover_release": "livery.workshop._publish",
447 "python_matrix": "livery.workshop._pythons",
448 "store_home": "livery.workshop._tools",
449 "tool_receipts": "livery.workshop._tools",
450 "Neighbours": "livery.workshop._packages",
451 "ReferencedName": "livery.workshop._packages",
452 "SourceReferences": "livery.workshop._packages",
453 "neighbours": "livery.workshop._packages",
454 "graph_changed": "livery.workshop._steps",
455 "scripts_dir": "livery.workshop._pythons",
456 "venv_python": "livery.workshop._pythons",
457 "is_example": "livery.workshop._examples",
458 "SPEED_FILE_VARIABLE": "livery.workshop._speed",
459 "package_of": "livery.workshop._speed",
460 "POINT_VARIABLE": "livery.workshop._ci_context",
461 "package_directories": "livery.workshop._packages",
462 "SpeedMark": "livery.workshop._speed",
463 "speed_marks": "livery.workshop._speed",
464 "RUNS": "livery.workshop._metrics",
465 "WORKSPACE_TESTS": "livery.workshop._packages",
466 "Category": "livery.workshop._categories",
467 "LegScope": "livery.workshop._verified",
468 "VerifiedBranch": "livery.workshop._verified",
469 "category_of": "livery.workshop._categories",
470 "EVERY_RUNNER_LABEL": "livery.workshop._points",
471 "check_legs": "livery.workshop._points",
472 "check_shards": "livery.workshop._points",
473 "pull_request_shards": "livery.workshop._points",
474 "DURATIONS": "livery.workshop._shard",
475 "Shard": "livery.workshop._shard",
476 "ShardMarker": "livery.workshop._shard",
477 "checkout_time": "livery.workshop._shard",
478 "files_digest": "livery.workshop._shard",
479 "leave_shard": "livery.workshop._shard",
480 "partition": "livery.workshop._shard",
481 "platform_leg": "livery.workshop._shard",
482 "read_durations": "livery.workshop._shard",
483 "read_shard": "livery.workshop._shard",
484 "shard_of": "livery.workshop._shard",
485 "holds_runtime_language": "livery.workshop._packages",
486 "leave_leg_file": "livery.workshop._metrics",
487 "leave_section": "livery.workshop._metrics",
488 "leg_scope": "livery.workshop._verified",
489 "pull_request_legs": "livery.workshop._points",
490 "state_store": "livery.workshop._ci_context",
491 "tested": "livery.workshop._steps",
492 "verified_branch": "livery.workshop._verified",
493 "Query": "livery.workshop._queries",
494 "RequirementWriter": "livery.workshop._queries",
495 "answer": "livery.workshop._queries",
496 "AGENT": "livery.workshop._prose",
497 "Changes": "livery.workshop._influence",
498 "Edge": "livery.workshop._packages",
499 "HUMAN": "livery.workshop._prose",
500 "NONE": "livery.workshop._steps",
501 "PACKAGE": "livery.workshop._steps",
502 "PACKAGES": "livery.workshop._steps",
503 "PATHS": "livery.workshop._steps",
504 "Package": "livery.workshop._packages",
505 "PhaseContext": "livery.workshop._phases",
506 "Prose": "livery.workshop._prose",
507 "RegistryTarget": "livery.workshop._registries",
508 "ReleaseNotes": "livery.workshop._release_notes",
509 "RunContext": "livery.workshop._ci_context",
510 "WHOLE": "livery.workshop._steps",
511 "ci_changes": "livery.workshop._quality",
512 "ci_run": "livery.workshop._ci_context",
513 "contributions_for": "livery.workshop._extensions",
514 "discover_packages": "livery.workshop._packages",
515 "extension_names": "livery.workshop._extensions",
516 "extension_set": "livery.workshop._composition",
517 "nearest_extensions": "livery.workshop._composition",
518 "order_topologically": "livery.workshop._graph",
519 "forge_repository": "livery.workshop._forge_lane",
520 "this_forge": "livery.workshop._forge_lane",
521 "this_repository": "livery.workshop._forge_lane",
522 "forge_token": "livery.workshop._tokens",
523 "fix_files": "livery.workshop._quality",
524 "shipped_content": "livery.workshop._extensions",
525 "generated_header": "livery.workshop._provenance",
526 "guidance": "livery.workshop._prose",
527 "read_contract": "livery.workshop._contract",
528 "registry": "livery.workshop._registries",
529 "release_notes": "livery.workshop._release_notes",
530 "release_tag": "livery.workshop._packages",
531 "run_batched": "livery.workshop._invoke",
532 "run_phase": "livery.workshop._phases",
533 "run_phase_over": "livery.workshop._quality",
534 "scoped_files": "livery.workshop._steps",
535 "scoped_packages": "livery.workshop._steps",
536 "scoped_paths": "livery.workshop._steps",
537 "scoped_suite": "livery.workshop._steps",
538 "selected_files": "livery.workshop._steps",
539 "step_enabled": "livery.workshop._steps",
540 "step_extensions": "livery.workshop._steps",
541 "step_option": "livery.workshop._steps",
542 "undeployed": "livery.workshop._tools",
543 "verify_workspace": "livery.workshop._packages",
544 "workspace_root": "livery.workshop._extensions",
545 "workspace_suite": "livery.workshop._packages",
546}
547
548#: The public packages beneath the root, served whole on first use.
549_PACKAGES = ("testing",)(empty)
550
551
552def __getattr__(name: str) -> object:(empty)
553 """Serve a public name from its module, each time it is read.
554
555 The value is never kept here. A kept value would be whatever the
556 module held at the first read, so a test that patched the module's
557 name before that read would leave its fake in this module for the
558 rest of the process.
559 """
560 import importlib
561
562 if name in _PACKAGES:562 ↛ 563line 562 didn't jump to line 563 because the condition on line 562 was never true
563 value: object = importlib.import_module(f"livery.workshop.{name}")
564 else:
565 module = _EXPORTS.get(name)
566 if module is None:
567 raise AttributeError(f"module 'livery.workshop' has no attribute {name!r}")
568 value = getattr(importlib.import_module(module), name)
569 return value