API reference¶
Generated from the installed candidate wheel.
Consumer¶
Consumer(distribution: str, package_dir: pathlib.Path, public_origins: tuple[str, ...] = ()) -> None
A caller's distribution and package location, never the common library's.
package_dir is the consumer module directory (typically derived from its
own __file__). Only the direct root/src/package layout probes live Git.
Public origins are exact approved URLs; default output hides branch names.
current_version¶
current_version(consumer)
Return (display identity, installed PEP 440 version, identity source).
A wheel uses its recorded snapshot even when the caller runs inside an unrelated checkout. An editable src layout probes its own Git root each call. Missing Git in a checkout is explicit, not masked by a stale snapshot.
source_identity¶
source_identity(root, public_origins=())
Return live identity or None; never inspect a parent or caller's repository.
display¶
display(identity)
SemVer display; development values are identification, not release ordering.
build_provenance¶
build_provenance(root, package_version, consumer)
Capture identity at build time, preserving a matching sdist snapshot.
record_build¶
record_build(root, package_version, consumer)
Write a build snapshot and return its root-relative artifact path.
Add the returned path to your build backend's artifacts. Ignore this file in Git so a previous build does not itself mark the checkout dirty.
read_provenance¶
read_provenance(path, distribution)
Read a validated snapshot bound to exactly this consumer distribution.
Documentation home · Source · Help / report an issue · License
Docs: release v1.0.56 · 4ee7bf099698. Source revision: 4ee7bf099698bb5f8f5f0d6e0d0d020c1d7927c0 (dirty checkout: false). Version and source.