livery.workshop._dev_release¶
livery.workshop._dev_release ¶
Dev releases: the branch decides, the wheel comes from the branch.
workflow.release on a main-family branch runs the release
train; on any other branch it is the dev act, this module: each
member built straight from the branch at a dev version, no reserved
branch, no PR, no tags. Publishing goes only to the configured
custom index, a python index: a member whose distributions are all
python's publishes through its own publish phase, with that index as
its python registry target, and a member that releases anything else
builds without a publish. Without an index the run is local, every
member built into its dist/ and the publish skipped with the
teaching. PyPI is never the fallback.
Classes:
| Name | Description |
|---|---|
DevPlan |
One package's derived dev release: the package and its version. |
Functions:
| Name | Description |
|---|---|
sanitise_branch |
The branch name as version-segment identifiers. |
semver_to_pep440 |
The dev grammar's PEP 440 form; anything else passes through. |
public_version |
The dev version's public PEP 440 form, without its local segment. |
describe_distance |
Commits since package's last release tag, and the short sha. |
unchanged_since_release |
The released version nothing unreleased has touched, or empty. |
dev_version |
Derive package's dev version, refusing an unchanged package. |
build_dev |
Build the dev wheel; the tree is byte-identical afterwards. |
set_floors |
Raise each floor between the set's members to the co-member's dev version. |
released_to_the_index |
Tell whether an index of kind takes what package releases, and name it. |
dev_release |
The dev act for a set: derive, confirm, build, publish. |
Attributes:
| Name | Type | Description |
|---|---|---|
INDEX_VAR |
|
DevPlan
dataclass
¶
sanitise_branch ¶
The branch name as version-segment identifiers.
/ becomes .; every character outside [0-9A-Za-z-.]
is dropped. ASCII only: PEP 440's local segment accepts nothing
wider, and str.isalnum alone would wave Unicode through into
a version the build backend refuses untaught.
Source code in packages/workshop/src/livery/workshop/_dev_release.py
semver_to_pep440 ¶
The dev grammar's PEP 440 form; anything else passes through.
1.2.3-dev.feat.x.4+gabc1234.20260901 becomes
1.2.3.dev4+feat.x.gabc1234.20260901: the branch moves into
the local segment, because PEP 440's public half accepts only
devN. A build backend refuses the display form outright, so
every stamp goes through this.
Source code in packages/workshop/src/livery/workshop/_dev_release.py
public_version ¶
The dev version's public PEP 440 form, without its local segment.
1.2.3-dev.feat.x.4+gabc1234.20260901 becomes 1.2.3.dev4. A
floor is a >= specifier, which cannot carry a local segment,
and a floor without one ignores a candidate's local label, so
>=1.2.3.dev4 admits 1.2.3.dev4+feat.x.gabc1234.20260901.
Source code in packages/workshop/src/livery/workshop/_dev_release.py
describe_distance ¶
Commits since package's last release tag, and the short sha.
(0, sha) on the tag itself; with no tag at all, the whole
history's count. Position only: the age marker in a dev version,
not the content check (that is the unchanged refusal).
Source code in packages/workshop/src/livery/workshop/_dev_release.py
unchanged_since_release ¶
The released version nothing unreleased has touched, or empty.
Content, not position, judged against the release tag: HEAD can be far past a package's tag with no commit touching it, and the derivation then answers the released version back. Empty for a package with unreleased changes, or one with no release yet.
Source code in packages/workshop/src/livery/workshop/_dev_release.py
dev_version ¶
Derive package's dev version, refusing an unchanged package.
The refusal is content, not position, and judged against the
release tag, never the stamped file version: HEAD can be far
past a package's tag with no commit touching it, and the
derivation then answers the released version back. Building that content
under <released>.devN mints a number that sorts below the
release it repeats, so no floor naming the release can ever
resolve it. A stamped-ahead pyproject.toml (a prepared bump
whose tag is not cut yet) is not a refusal: the tag is the
record of what was released.
The date stamp rides in the local segment so a dev pin's age
reads offline from a lock file; .dirty marks a tree whose
wheel no commit describes. The sha rides as git describe
spells it, g first: a local segment of digits alone is a
number to a version parser, and a build backend drops its
leading zero, so a short sha such as 0442877 would read back
as another commit's.
Source code in packages/workshop/src/livery/workshop/_dev_release.py
build_dev ¶
Build the dev wheel; the tree is byte-identical afterwards.
The version is stamped and the release notes' unreleased entry, when
an extension writes notes, is spliced into README.md under
## What's New for the build only; every touched file is restored
from an in-memory snapshot, never from git, because a dirty tree is
legal here and a checkout would discard its edits. The index page is the
only place the excerpt exists. Timestamps are restored with the
bytes: uv judges an editable install fresh by its
pyproject.toml's modification time, and a touched file would
make the next sync re-install the package while other processes read
its metadata.
Source code in packages/workshop/src/livery/workshop/_dev_release.py
set_floors ¶
Raise each floor between the set's members to the co-member's dev version.
The release train raises the floors within its set before it builds,
and a dev build needs the same: a dev version sorts below the release
it leads to, so a floor that names that release, or 0.0.0 for a
member never released, admits no dev wheel of it. Each floor names
the co-member's public dev version instead, raised by the stamp
phase the train runs. A set of one moves no floor, as a release of
one moves none.
The raise lasts for the block alone: every file the phase may touch, each member's version files and its contract, is restored from an in-memory snapshot when the block ends, a failure included, with its timestamps, as the build restores what it stamps. Yields the files the phase reported, relative to root.
Source code in packages/workshop/src/livery/workshop/_dev_release.py
released_to_the_index ¶
Tell whether an index of kind takes what package releases, and name it.
The index takes a member whose set releases at least one distribution and only distributions of the index's ecosystem. The text names the ecosystems of what the member releases, or says it releases none, for the line that says why a member built without a publish.
Source code in packages/workshop/src/livery/workshop/_dev_release.py
dev_release ¶
The dev act for a set: derive, confirm, build, publish.
Every member's version derives before anything builds, so a
refusal costs nothing. With local (or with no custom index
configured, which degrades to the same run and says so) nothing
leaves the machine and nothing is asked. A member whose
distributions are python's publishes through its publish phase,
with the index as the python registry target and
UV_PUBLISH_TOKEN as its credential, as the release train hands
a member its target; a member that releases anything else builds,
is not asked about, and a line says why nothing published it. A
publish always confirms per member. Where nobody can answer,
livery.footman.confirm takes its default no and the refusal
teaches the explicit --yes: a decline and an unanswered
question are told apart by livery.footman.attended, which
knows about --no-input and --dry-run as well as the
terminal, so silence never publishes under any of them. While the
members build, each floor one declares on another member of the
set names that member's dev version, as the release train raises
the floors within its set; a member built alone moves no floor.
Source code in packages/workshop/src/livery/workshop/_dev_release.py
282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 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 | |