From 909544d15728fde377b2f19dade499fff96e2769 Mon Sep 17 00:00:00 2001 From: Nikita Savelyev Date: Tue, 4 Feb 2025 14:47:47 +0100 Subject: [PATCH] [Release] Parse OV version on demand (#3247) ### Changes Follow-up to #3233 . Fix an issue arising during documentation building. ### Reason for changes Caught here: https://github.com/openvinotoolkit/nncf/actions/runs/13131916886/job/36638718655 . This test is run on PRs to develop only. That's why it was not caught during merging to release branch. ### Tests https://github.com/openvinotoolkit/nncf/actions/runs/13132576726/job/36640708447?pr=3246 --- nncf/common/utils/backend.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nncf/common/utils/backend.py b/nncf/common/utils/backend.py index c98d560c847..b52e007470e 100644 --- a/nncf/common/utils/backend.py +++ b/nncf/common/utils/backend.py @@ -22,7 +22,6 @@ import openvino # type: ignore # noqa: F401 _OPENVINO_AVAILABLE = True - _OPENVINO_VERSION = version.parse(openvino.__version__.split("-")[0]) except ImportError: _OPENVINO_AVAILABLE = False @@ -189,4 +188,5 @@ def is_openvino_at_least(version_str: str) -> bool: if not _OPENVINO_AVAILABLE: return False - return version.parse(version_str) <= _OPENVINO_VERSION + openvino_version = version.parse(openvino.__version__.split("-")[0]) + return version.parse(version_str) <= openvino_version