ExtensionVersions¶
- class hugr.ext.ExtensionVersions(latest: Extension)[source]¶
Bases:
objectSet of versions of an extension.
Older versions of an extension may be kept for backwards compatibility.
Methods
Add an extension to the set, coalescing compatible older versions.
Add an extension to the set, NOT coalescing compatible older versions.
Ensures the latest version is up to date and any semver compatible versions are coalesced, with only the latest of that group retained.
Get the highest registered extension compatible with
version.Attributes
Get the ID of the extension.
Get latest version of the extension.
Get all versions of the extension.
- add(extension: Extension) None[source]¶
Add an extension to the set, coalescing compatible older versions.
- add_lazy(extension: Extension) None[source]¶
Add an extension to the set, NOT coalescing compatible older versions. Use coalesce to subsequently coalesce all compatible versions.
- coalesce() None[source]¶
Ensures the latest version is up to date and any semver compatible versions are coalesced, with only the latest of that group retained.
This is done automatically by add, but not by add_lazy.
- get_compatible(version: Version) Extension[source]¶
Get the highest registered extension compatible with
version.
- property id: ExtensionId¶
Get the ID of the extension.