livery.workshop._publish¶
livery.workshop._publish ¶
Publish, probe, tag: the release train's receipt-cutting half.
Runs where the release PR's squash landed, discovery reads the ref
and nothing else: the members and their versions are the release's
member list as committed at the ref. Names and versions come from the
same place on purpose: reading names from the commit and versions
from the working tree would pair this release's members with
whatever a later release left in the tree, and the --ref
recovery runs from exactly such a checkout. The squash title is
presentation, rebuilt from the same list, never parsed.
The wave: a member becomes eligible when every in-set dependency it floors on has its receipt tag cut, and every eligible member runs its publish, index probe, tag chain concurrently. A failed member stops only its dependents; siblings complete and keep their tags, and a re-run walks past everything already tagged, the duplicate-tolerant publish making that safe.
Classes:
| Name | Description |
|---|---|
Registry |
The one probe the wave needs; livery.forge.SimpleRegistry fits. |
Receipt |
One member's publish outcome. |
Functions:
| Name | Description |
|---|---|
read_manifest |
(package dir, version) pairs from manifest text, or None. |
discover_release |
The members the release squash at ref releases, each with its version. |
mined_at |
The mining point a release squash's message records, or |
movement_check |
Refuse when commits the entry never saw ride in this squash. |
index_target |
Make the python registry target an upload index names, token its credential. |
collected |
Whether package's |
probe_until_served |
Wait until the index serves version; the receipt's condition. |
floor_probe |
Every declared floor must be servable before anything uploads. |
cut_tag |
Cut and push the receipt, annotated, by name, idempotent. |
publish_release |
The wave: verify, then publish, probe, tag per member. |
Attributes:
| Name | Type | Description |
|---|---|---|
MANIFEST |
|
|
PROBE_TIMEOUT |
|
|
PROBE_POLL |
|
|
NEW_PROJECT_LIMIT |
|
Registry ¶
Receipt
dataclass
¶
read_manifest ¶
(package dir, version) pairs from manifest text, or None.
None for unreadable content, which the caller refuses: without the list there is no record of what the release contains.
Source code in packages/workshop/src/livery/workshop/_publish.py
discover_release ¶
The members the release squash at ref releases, each with its version.
The members and their versions are the release's member list,
.release-manifest.json, as committed at ref: the record the
release branch writes when it prepares the set. They come in
release order, every dependency before its dependents
(livery.workshop.order_topologically). A rider file in the
squash changes nothing here, which is what makes hand-editing a
release branch safe.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
root
|
Path
|
The workspace root. |
required |
ref
|
str
|
The commit whose member list is read, as git names it. |
required |
Returns:
| Type | Description |
|---|---|
tuple[tuple[Package, str], ...]
|
Each released member and the version the list states for it. |
Raises:
| Type | Description |
|---|---|
Failed
|
when the commit carries no readable member list, since it is then no release squash, naming the flag that points the publish at the squash; and when the list names a member the workspace does not hold. |
Source code in packages/workshop/src/livery/workshop/_publish.py
mined_at ¶
The mining point a release squash's message records, or "".
The driver writes Mined-At: <sha> into the pull request body,
which becomes the squash's message at the merge. A commit without
the line is not a release squash: a branch's own stamp commit, or
a squash whose body was rewritten. The wave and the dispatch judge
a commit by this one rule.
Source code in packages/workshop/src/livery/workshop/_publish.py
movement_check ¶
Refuse when commits the entry never saw ride in this squash.
The movement analysis's backstop. The driver records the mining
point in the squash body (Mined-At: <sha>), so the moved
range is exact: commits between the mining point and the squash's
parent touching this member's paths are code the stamped entry
does not cover. A squash without the line is not the driver's,
and publishing it is refused for the same reason.
Source code in packages/workshop/src/livery/workshop/_publish.py
index_target ¶
index_target(index_url: str, token: str) -> RegistryTarget
Make the python registry target an upload index names, token its credential.
The release train's wave hands it to each member that releases python distributions, and the dev act to each member whose distributions are all python's: both read and publish at the one address the caller resolved.
Source code in packages/workshop/src/livery/workshop/_publish.py
collected ¶
Whether package's dist/ holds a file.
Inside CI a runner's checkout starts with no dist/, so a file
there was collected from the artifact of a job that built the
member before the wave.
Source code in packages/workshop/src/livery/workshop/_publish.py
probe_until_served ¶
probe_until_served(registry: Registry, name: str, version: str, *, timeout: float = PROBE_TIMEOUT, poll: float = PROBE_POLL) -> None
Wait until the index serves version; the receipt's condition.
An accepted upload is not a served wheel, and the tag is a receipt, so it waits on the probe, not the exit code.
Source code in packages/workshop/src/livery/workshop/_publish.py
floor_probe ¶
floor_probe(package: Package, by_path: dict[str, Package], registry_for: Callable[[Package], Registry], *, coreleased: frozenset[str] = frozenset()) -> None
Every declared floor must be servable before anything uploads.
A floor no index can satisfy strands every consumer at install time, and refusing here is cheap where unpublishing is impossible.
Source code in packages/workshop/src/livery/workshop/_publish.py
cut_tag ¶
Cut and push the receipt, annotated, by name, idempotent.
Source code in packages/workshop/src/livery/workshop/_publish.py
publish_release ¶
publish_release(root: Path, registry_for: Callable[[Package], Registry], *, ref: str = '', index_url: str = '', token: str = '', probe_timeout: float = PROBE_TIMEOUT, probe_poll: float = PROBE_POLL, prebuilt: bool = False) -> tuple[Receipt, ...]
The wave: verify, then publish, probe, tag per member.
Eligibility is dependency tags: a member starts when every in-set
dependency's receipt exists, independent members run abreast, a
failure stops only its dependents. Every read is ref-scoped.
Each member builds through its lifecycle's build, which judges the
tags of the wheels it writes, and publishes to the target of the
ecosystem its extensions release it to: the python target the
caller resolved, index_url with token, or the one the registry
ladder resolves for any other ecosystem. A member whose extensions
answer no registry, or more than one, refuses the wave before
anything uploads. With prebuilt, a member a job of the run builds
before the wave (the workspace's job-built-members answer) is
not built here: the wave publishes what the run collected into its
dist/, and refuses one whose dist/ holds nothing, naming
the job. Such a member's publish phase gets prebuilt true.
Source code in packages/workshop/src/livery/workshop/_publish.py
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 | |