moddef.resolve module¶
Import resolution (spec §19). Import URIs follow the package form moddef:<namespace>:<name>:<version> (e.g. moddef:stdlib:measurands:1.0.0), resolved against package roots as <root>/<name>/<version>/<name>.moddef.{yaml,json,binary} — the layout of moddef/stdlib and the Go resolver’s MODDEF_PACKAGE_ROOTS.
- class moddef.resolve.DirResolver(roots: list[str] | None = None)[source]¶
Bases:
objectResolver over MODDEF_PACKAGE_ROOTS-style directories.
- class moddef.resolve.ResolvedDocument(doc: ModDefDocument, enums: dict[str, ~moddef.v1.types_pb2.EnumType]=<factory>, measurands: dict[str, ~moddef.v1.measurand_pb2.MeasurandDefinition]=<factory>, imports: dict[str, ~moddef.v1.document_pb2.ModDefDocument]=<factory>)[source]¶
Bases:
objectA document’s visible symbol tables after import resolution: local symbols first, then imported ones (alias-prefixed as <alias>:<id>, never overriding an existing entry).
- doc: ModDefDocument¶
- enums: dict[str, EnumType]¶
- imports: dict[str, ModDefDocument]¶
- measurands: dict[str, MeasurandDefinition]¶
- moddef.resolve.resolve_imports(doc: ModDefDocument, resolver: PackageResolver | None = None) ResolvedDocument[source]¶
Resolve a document’s imports and build the visible symbol tables.