Option C Tools
Loading...
Searching...
No Matches
compat Namespace Reference

Functions

tuple[int,...] _parse_version_tuple (str v)
str|None check_oc_diagnostics_compat ()

Variables

dict _OC_DIAGNOSTICS_COMPAT = {"min": "2.0.0", "max": "3.0.0"}

Detailed Description

Purpose
-------
Provide a version-compatibility check between OCT and the ``oc_diagnostics``
runtime package.

Responsibilities
----------------
- Define the supported ``oc_diagnostics`` version range.
- Query the installed ``oc_diagnostics`` version via ``importlib.metadata``.
- Return a human-readable warning or info string when the installed version
  is out of range or absent; return ``None`` when compatible.

Diagnostics
-----------
Domain: OCT-CORE
Levels:
    L2 — lifecycle
    L3 — semantic details
    L4 — deep tracing

Contracts
---------
- Must not import ``oc_diagnostics`` at module level (avoids circular deps).
- Must not require the ``packaging`` library; uses tuple-based comparison.
- Must be safe to call when ``oc_diagnostics`` is not installed.

Function Documentation

◆ _parse_version_tuple()

tuple[int, ...] compat._parse_version_tuple ( str v)
protected
Convert a dotted version string to a tuple of ints for comparison.

Definition at line 38 of file compat.py.

Here is the caller graph for this function:

◆ check_oc_diagnostics_compat()

str | None compat.check_oc_diagnostics_compat ( )
Check whether the installed ``oc_diagnostics`` version is within the
supported range.

Returns
-------
str or None
    A warning/info message if out of range or not installed.
    ``None`` if the version is compatible.

Definition at line 52 of file compat.py.

Here is the call graph for this function:

Variable Documentation

◆ _OC_DIAGNOSTICS_COMPAT

dict compat._OC_DIAGNOSTICS_COMPAT = {"min": "2.0.0", "max": "3.0.0"}
protected

Definition at line 35 of file compat.py.