Skip to content
ocx
install

VersionInfo

VersionInfoclassdataclass#

Re-exported from ocx_sdk._resultsView source
class VersionInfo(version: str, channel: str | None = None, cargo_pkg_version: str | None = None, commit: Mapping[str, Any] = _EMPTY, build: Mapping[str, Any] = _EMPTY, ci: Mapping[str, Any] = _EMPTY)

ocx version under --format json.

Only version is guaranteed; everything else depends on how the binary was built. The three sub-objects stay mappings on purpose — they are build provenance, nothing in the SDK dispatches on their fields, and modelling them would pin a schema ocx explicitly keeps open for extension.

Note that Ocx.version() reads the plain output instead: a bare semver line is ocx’s documented stable contract (design §11).

buildattributeclass attributeinstance attribute#

build: Mapping[str, Any] = _EMPTY

cargo_pkg_versionattributeclass attributeinstance attribute#

cargo_pkg_version: str | None = None

channelattributeclass attributeinstance attribute#

channel: str | None = None

ciattributeclass attributeinstance attribute#

ci: Mapping[str, Any] = _EMPTY

commitattributeclass attributeinstance attribute#

commit: Mapping[str, Any] = _EMPTY

versionattributeinstance attribute#

version: str

from_jsonmethodclassmethod#

def from_json(raw: str) -> VersionInfo

Parse ocx --format json version output.