[PYTHON] Align versions for subpackages, add get_version method for all subpackages (#12220)
This commit is contained in:
parent
3731913049
commit
0266f25f9b
@ -157,7 +157,7 @@ pip3 install openvino-0.0.0-cp<version>-cp<version>-linux_x86_64.whl
|
||||
|
||||
### Prerequisites
|
||||
|
||||
In order to build OpenVINO™ and the nGraph Python wheel on Windows, you need to install Microsoft Visual Studio* and Python.
|
||||
In order to build OpenVINO™ and its Python wheel on Windows, you need to install Microsoft Visual Studio* and Python.
|
||||
|
||||
Once Python is installed, you also need to install Cython using `pip install cython`.
|
||||
|
||||
@ -206,17 +206,17 @@ Set up the OpenVINO™ environment in order to add a module path to `PYTHONPATH`
|
||||
|
||||
%OPENVINO_BASEDIR%\openvino_dist\setupvars.bat
|
||||
|
||||
### Build an nGraph Python Wheel on Windows
|
||||
### Build a Python Wheel on Windows
|
||||
|
||||
Build the Python wheel package:
|
||||
|
||||
cd "%OPENVINO_BASEDIR%/openvino/ngraph/python"
|
||||
cd "%OPENVINO_BASEDIR%/openvino/src/bindings/python"
|
||||
python setup.py bdist_wheel
|
||||
|
||||
The final wheel should be located in the `ngraph\python\dist` directory.
|
||||
The final wheel should be located in the `bindings\python\dist` directory.
|
||||
|
||||
dir openvino\ngraph\python\dist\
|
||||
10/09/2020 04:06 PM 4,010,943 ngraph_core-0.0.0-cp38-cp38-win_amd64.whl
|
||||
dir openvino/src/bindings/python/dist/
|
||||
10/09/2020 04:06 PM 4,010,943 openvino-0.0.0.dev0-cp<version>-cp<version>-win_amd64.whl
|
||||
|
||||
## Run Tests
|
||||
|
||||
@ -228,12 +228,12 @@ You may wish to use a virutualenv for your installation.
|
||||
$ source venv/bin/activate
|
||||
(venv) $
|
||||
|
||||
### Install the nGraph Wheel and Other Requirements
|
||||
### Install the Wheel and Other Requirements
|
||||
|
||||
(venv) $ cd "${OPENVINO_BASEDIR}/openvino/ngraph/python"
|
||||
(venv) $ cd "${OPENVINO_BASEDIR}/openvino/src/bindings/python"
|
||||
(venv) $ pip3 install -r requirements.txt
|
||||
(venv) $ pip3 install -r requirements_test.txt
|
||||
(venv) $ pip3 install dist/ngraph_core-0.0.0-cp38-cp38-linux_x86_64.whl
|
||||
(venv) $ pip3 install dist/openvino-0.0.0.dev0-cp38-cp38-linux_x86_64.whl
|
||||
|
||||
### Run Tests
|
||||
|
||||
|
@ -41,7 +41,9 @@ packages = [
|
||||
"ngraph.impl.passes",
|
||||
"openvino",
|
||||
"openvino.frontend",
|
||||
"openvino.preprocess",
|
||||
"openvino.offline_transformations",
|
||||
"openvino.runtime",
|
||||
"openvino.runtime.opset1",
|
||||
"openvino.runtime.opset2",
|
||||
"openvino.runtime.opset3",
|
||||
@ -50,6 +52,7 @@ packages = [
|
||||
"openvino.runtime.opset6",
|
||||
"openvino.runtime.opset7",
|
||||
"openvino.runtime.opset8",
|
||||
"openvino.runtime.opset9",
|
||||
"openvino.runtime.utils",
|
||||
"openvino.runtime.op",
|
||||
"openvino.runtime.op.util",
|
||||
|
@ -9,9 +9,11 @@ Low level wrappers for the FrontEnd C++ API.
|
||||
# flake8: noqa
|
||||
|
||||
from openvino.utils import add_openvino_libs_to_path
|
||||
|
||||
add_openvino_libs_to_path()
|
||||
|
||||
from openvino.pyopenvino import get_version
|
||||
__version__ = get_version()
|
||||
|
||||
# main classes
|
||||
from openvino.pyopenvino import FrontEndManager
|
||||
from openvino.pyopenvino import FrontEnd
|
||||
|
@ -5,9 +5,11 @@
|
||||
# flake8: noqa
|
||||
|
||||
from openvino.utils import add_openvino_libs_to_path
|
||||
|
||||
add_openvino_libs_to_path()
|
||||
|
||||
from openvino.pyopenvino import get_version
|
||||
__version__ = get_version()
|
||||
|
||||
from openvino.pyopenvino.offline_transformations import apply_moc_transformations
|
||||
from openvino.pyopenvino.offline_transformations import apply_moc_legacy_transformations
|
||||
from openvino.pyopenvino.offline_transformations import apply_pot_transformations
|
||||
|
@ -9,9 +9,11 @@ Low level wrappers for the PrePostProcessing C++ API.
|
||||
# flake8: noqa
|
||||
|
||||
from openvino.utils import add_openvino_libs_to_path
|
||||
|
||||
add_openvino_libs_to_path()
|
||||
|
||||
from openvino.pyopenvino import get_version
|
||||
__version__ = get_version()
|
||||
|
||||
# main classes
|
||||
from openvino.pyopenvino.preprocess import InputInfo
|
||||
from openvino.pyopenvino.preprocess import OutputInfo
|
||||
|
@ -6,16 +6,11 @@
|
||||
# noqa: F401
|
||||
|
||||
from openvino.utils import add_openvino_libs_to_path
|
||||
from pkg_resources import get_distribution, DistributionNotFound
|
||||
|
||||
|
||||
try:
|
||||
__version__ = get_distribution("openvino-core").version
|
||||
except DistributionNotFound:
|
||||
__version__ = "0.0.0.dev0"
|
||||
|
||||
add_openvino_libs_to_path()
|
||||
|
||||
from openvino.pyopenvino import get_version
|
||||
__version__ = get_version()
|
||||
|
||||
# Openvino pybind bindings and python extended classes
|
||||
from openvino.pyopenvino import Dimension
|
||||
from openvino.pyopenvino import Model
|
||||
@ -44,7 +39,6 @@ from openvino.pyopenvino import Version
|
||||
from openvino.pyopenvino import Tensor
|
||||
from openvino.pyopenvino import Extension
|
||||
from openvino.pyopenvino import ProfilingInfo
|
||||
from openvino.pyopenvino import get_version
|
||||
from openvino.pyopenvino import get_batch
|
||||
from openvino.pyopenvino import set_batch
|
||||
from openvino.pyopenvino import serialize
|
||||
|
29
src/bindings/python/tests/test_package_versions.py
Normal file
29
src/bindings/python/tests/test_package_versions.py
Normal file
@ -0,0 +1,29 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright (C) 2018-2022 Intel Corporation
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import openvino.preprocess as ov_pre
|
||||
import openvino.runtime as ov_run
|
||||
import openvino.frontend as ov_front
|
||||
import openvino.offline_transformations as ov_off_transf
|
||||
import openvino.pyopenvino as ov_py
|
||||
|
||||
|
||||
def test_get_version_match():
|
||||
packages = [ov_run, ov_front, ov_pre, ov_off_transf, ov_py]
|
||||
versions = set()
|
||||
|
||||
for package in packages:
|
||||
versions.add(package.get_version())
|
||||
|
||||
assert len(versions) == 1
|
||||
|
||||
|
||||
def test_dunder_version_match():
|
||||
packages = [ov_run, ov_front, ov_pre, ov_off_transf]
|
||||
versions = set()
|
||||
|
||||
for package in packages:
|
||||
versions.add(package.__version__)
|
||||
|
||||
assert len(versions) == 1
|
Loading…
Reference in New Issue
Block a user