ArtifactKind¶
- class selene_core.build_utils.types.ArtifactKind¶
An artifact kind characterises a type of resource. Examples of characterisation might include: - a path to an object file targeting a specific quantum instruction set - a HUGR package - a bitcode bytestring - an URL to a HUGR package (not supported but theoretically possible)
It can be used to detect the type of a resource (an Any variable). The build planner (see planner.py) uses the ArtifactKind of a resource to determine the path(s) to the final selene executable.
- classmethod canonicalize(resource: ResourceKind) ResourceKind¶
Convert the resource to a canonical form, if necessary. As an example, a pathlib.Path resource might be resolved to an absolute path, or a string resource might be converted to lowercase (for example).
A default for handling paths is provided here, but this should be overwritten where appropriate.
- classmethod digest(resource: ResourceKind) str¶
Generate a digest for the resource for lookup and caching.
- classmethod matches(resource: Any) bool¶
Returns true if the resource matches this kind, false otherwise.
- priority: ClassVar[int] = 1000¶