setup
setup
¶
Check and certify package-owned setup without knowing the dependency graph.
__all__ = ['SetupStatus', 'SetupCheck', 'SetupReceipt', 'SetupRequiredError', 'SetupDowngradeError', 'setup_status', 'setup_lock', 'require_no_downgrade', 'require_setup', 'python_identity']
module-attribute
¶
SetupCheck(owner, component, status, diagnostic='')
dataclass
¶
SetupReceipt(path, owner, version, inputs)
dataclass
¶
Certify one owner's version and setup inputs in an atomic JSON receipt.
Owners preflight their full dependency closure before changing artifacts,
clear their receipt immediately before their own writes, and write it only
after verification succeeds, holding setup_lock
across the whole transition. A receipt never certifies child packages.
path
instance-attribute
¶
owner
instance-attribute
¶
version
instance-attribute
¶
inputs
instance-attribute
¶
check()
¶
Compare the receipt with the current owner, version, and setup inputs.
Source code in src/terok_util/setup.py
clear()
¶
write()
¶
Atomically certify successful setup, refusing an unsupported downgrade.
Source code in src/terok_util/setup.py
SetupRequiredError
¶
Bases: RuntimeError
Setup must complete before an operation may change running tasks.
SetupDowngradeError
¶
Bases: SetupRequiredError
Newer installed setup cannot be replaced by an older package.
setup_lock()
¶
Serialize setup mutations across packages, processes, and threads.
Hold this around preflight, artifact changes, and receipt writes. Nested
calls in the owning thread share the lock; competing callers fail with
SetupRequiredError.
Source code in src/terok_util/setup.py
setup_status(checks)
¶
Summarize checks, prioritizing unsupported downgrades over repairable setup.
Source code in src/terok_util/setup.py
require_no_downgrade(checks)
¶
Reject newer setup anywhere in the supplied dependency closure.
Source code in src/terok_util/setup.py
require_setup(checks)
¶
Require all checks to be ready, using typed errors instead of process exits.
Source code in src/terok_util/setup.py
python_identity()
¶
Identify the running bootstrap Python and detect replacement or disappearance.