-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Py OV] Add deprecation warning for runtime module (#27694)
### Details: Add deprecation warning for `openvino.runtime` that will be shown **ONCE** when sb will access runtime functionality for the first time. Examples: ![Screenshot 2025-01-10 114701](https://github.com/user-attachments/assets/4229ede3-3b86-418a-8dbf-f230ff91983b) ![warn_updated](https://github.com/user-attachments/assets/4b4a7c56-c5ca-4b7b-8b34-f89f3a4bc627) `openvino.runtime` funtionality was added to openvino namespace in these PRs: - #27785 - #27902 - #28007 - #28062 - #28085 Internal calls in `openvino` module also triggered warning, so they were updated: - #28166 - #28356 ### Tickets: - [CVS-129451](https://jira.devtools.intel.com/browse/CVS-129451) --------- Signed-off-by: Alicja Miloszewska <[email protected]> Co-authored-by: Anastasia Kuporosova <[email protected]>
- Loading branch information
Showing
6 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,16 @@ | |
"""openvino module namespace, exposing factory functions for all ops and other classes.""" | ||
# noqa: F401 | ||
|
||
import warnings | ||
warnings.simplefilter("always", DeprecationWarning) | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
eaidova
Contributor
|
||
warnings.warn( | ||
"The `openvino.runtime` module is deprecated and will be removed in the 2026.0 release. " | ||
"Please replace `openvino.runtime` with `openvino`.", | ||
DeprecationWarning, | ||
stacklevel=2 | ||
) | ||
|
||
|
||
from openvino._pyopenvino import get_version | ||
|
||
__version__ = get_version() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@akuporos @almilosz do we really need this warning shown always? Is it not enough to show it once?
The problem that previous openvino version (2024.6) does not contains all API in openvino namespace. There is no chance of smooth transition on new API on integration side early that 2025.0 happens. When code compatible with 2024.6 runs with 2025.0 it produces too much warnings (spam on each infer request running)