Undeclared dependency¶
UndeclaredDependency is what a block receives when it imports a Python
distribution it did not declare. The bytes may exist on the foundation, may
have been prepared by the project, and may be in a sibling block's closure; the
import root reaches only the block that declared a compatible requirement.
The fix is always a declaration, and the declaration works whether or not the foundation carries the package. A declared distribution the foundation lacks is fetched and built for the block's closure.
Symptom, cause, fix¶
| Symptom | Cause | Fix |
|---|---|---|
UndeclaredDependency for a package the foundation contains |
Presence in the component store is candidacy, not authority | Add the requirement to this block's @xratu |
UndeclaredDependency for a package runtime.xratu prepares |
Preparation supplies a candidate and grants no import | Add the requirement to this block's @xratu |
UndeclaredDependency for a package a sibling block uses |
Bindings are per block, not per package | Add the requirement to this block's @xratu |
UndeclaredDependency for a transitive import |
The distribution was reached through another package's namespace | Declare it directly |
UndeclaredDependency after a version bump |
The declared constraint no longer matches the selected component | Widen or restate the constraint |
The fix is the same in the first three rows, and the reason is one rule: import authority comes from the block's own declaration. See Presence versus import authority.
Reading the declaration back¶
The generated manifest records what the block declared, so the resolved intent is readable before a run:
{
"dependency_intent": {
"python": { "backend": "uv", "requirements": ["stripe>=8.0"] },
"apt": [],
"image": ""
}
}
A package absent from requirements here is absent from the block's import
view at runtime.
Imports that need no declaration¶
| Import | Source |
|---|---|
json, pathlib, asyncio and the rest of the standard library |
Provider-runtime ABI |
| A module inside the block's own capsule | The capsule mount |
| A native library in the foundation's exported baseline | The baseline, loaded rather than imported |
The standard library travels with CPython as provider-runtime ABI. A native
library is loaded through the native loader view rather than the Python import
view, so libmagic1 is reachable to a block that declared python-magic while
libmagic1 itself is never a Python declaration. See
Native loader view.
Related refusals¶
| Refusal | Condition |
|---|---|
| Missing, extra or conflicting component surface | The selected component's inventory disagrees with what the closure expects |
| An import root absent from the sealed view | The provider attempted a root the closure did not select |
| Ambiguous or conflicting resolution | Two candidates satisfy the requirement and neither takes precedence |
The last of these is resolution rather than declaration. See Candidate dispositions and conflict.