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. |
build_release_dists |
Build non-job-built release members and record their SHA-256 digests. |
verify_release_dists |
Verify |
isolated_publish_release |
Verify prebuilt distributions and publish the wave in Tier 1 isolation. |
Attributes:
| Name | Type | Description |
|---|---|---|
MANIFEST |
|
|
PROBE_TIMEOUT |
|
|
PROBE_POLL |
|
|
NEW_PROJECT_LIMIT |
|
|
DIST_MANIFEST |
|
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
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 541 542 543 544 545 546 547 548 549 | |
build_release_dists ¶
Build non-job-built release members and record their SHA-256 digests.
Runs in the unprivileged build job (no publishing credentials).
Members built by another job of the release point (such as native
wheel jobs returned by job-built-members) are skipped so their
platform artifacts are not overwritten. Writes DIST_MANIFEST even
when every member is built by another job so the dists artifact
is always present and rooted at packages/.
Source code in packages/workshop/src/livery/workshop/_publish.py
verify_release_dists ¶
Verify DIST_MANIFEST matches ref and every listed file's SHA-256.
Refuses a missing manifest, unreadable JSON, a ref mismatch, a missing distribution file, or any digest mismatch before any credential is used to upload.
Source code in packages/workshop/src/livery/workshop/_publish.py
isolated_publish_release ¶
isolated_publish_release(root: Path, *, ref: str = '', index_url: str = '', token: str = '', registry_for: Callable[[Package], Registry] | None = None, uploader: Callable[[Package, str, str], bool] | None = None, probe_timeout: float = PROBE_TIMEOUT, probe_poll: float = PROBE_POLL) -> tuple[Receipt, ...]
Verify prebuilt distributions and publish the wave in Tier 1 isolation.
Runs without setup.sh, without mounting workspace extensions,
without loading tasks.py, and without folding .repo.env.
Verifies DIST_MANIFEST SHA-256 digests, checks release movement
and dependency floors, uploads prebuilt distributions via
uv publish, waits until the index serves each version, and cuts
receipt tags in dependency order.
Source code in packages/workshop/src/livery/workshop/_publish.py
699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 | |