[PyOV] Drop Python 3.7 in OpenVINO Runtime (#19534)
* Drop 37 * Fix linter * Minor change * Minor changes * update add_lib_path * Minor changes * Update pypi pages * Update pypi pages * Fix linter * Minor changes --------- Co-authored-by: Anastasia Kuporosova <anastasia.kuporosova@intel.com> Co-authored-by: Jan Iwaszkiewicz <jan.iwaszkiewicz@intel.com> Co-authored-by: Ilya Lavrenov <ilya.lavrenov@intel.com>
This commit is contained in:
parent
5ba7d9b72d
commit
664dc77078
4
.github/github_org_control/configs.py
vendored
4
.github/github_org_control/configs.py
vendored
@ -14,8 +14,8 @@ import json
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
|
||||||
if sys.version_info[:2] < (3, 7):
|
if sys.version_info[:2] < (3, 8):
|
||||||
raise Exception("Python version must be >= 3.7")
|
raise Exception("Python version must be >= 3.8")
|
||||||
|
|
||||||
|
|
||||||
class ConfigException(Exception):
|
class ConfigException(Exception):
|
||||||
|
2
.github/workflows/py_checks.yml
vendored
2
.github/workflows/py_checks.yml
vendored
@ -30,7 +30,7 @@ jobs:
|
|||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v4
|
||||||
with:
|
with:
|
||||||
python-version: '3.7'
|
python-version: '3.8'
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: python -m pip install -r src/bindings/python/requirements_test.txt
|
run: python -m pip install -r src/bindings/python/requirements_test.txt
|
||||||
|
@ -1,4 +1,3 @@
|
|||||||
clang==11.1.0; python_version == '3.7'
|
|
||||||
clang==12.0.1; python_version == '3.8'
|
clang==12.0.1; python_version == '3.8'
|
||||||
clang==12.0.1; python_version == '3.9'
|
clang==12.0.1; python_version == '3.9'
|
||||||
clang==14.0; python_version == '3.10'
|
clang==14.0; python_version == '3.10'
|
||||||
|
@ -65,7 +65,7 @@ set "PATH=%OPENVINO_LIB_PATHS%;%PATH%"
|
|||||||
|
|
||||||
:: Check if Python is installed
|
:: Check if Python is installed
|
||||||
set PYTHON_VERSION_MAJOR=3
|
set PYTHON_VERSION_MAJOR=3
|
||||||
set MIN_REQUIRED_PYTHON_VERSION_MINOR=7
|
set MIN_REQUIRED_PYTHON_VERSION_MINOR=8
|
||||||
set MAX_SUPPORTED_PYTHON_VERSION_MINOR=11
|
set MAX_SUPPORTED_PYTHON_VERSION_MINOR=11
|
||||||
|
|
||||||
python --version 2>NUL
|
python --version 2>NUL
|
||||||
|
@ -99,7 +99,7 @@ if command -v lsb_release >/dev/null 2>&1; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
PYTHON_VERSION_MAJOR="3"
|
PYTHON_VERSION_MAJOR="3"
|
||||||
MIN_REQUIRED_PYTHON_VERSION_MINOR="7"
|
MIN_REQUIRED_PYTHON_VERSION_MINOR="8"
|
||||||
MAX_SUPPORTED_PYTHON_VERSION_MINOR="11"
|
MAX_SUPPORTED_PYTHON_VERSION_MINOR="11"
|
||||||
|
|
||||||
check_python_version () {
|
check_python_version () {
|
||||||
|
@ -105,16 +105,16 @@ def get_dtype(ngraph_type: NgraphType) -> np.dtype:
|
|||||||
|
|
||||||
def get_ndarray(data: NumericData) -> np.ndarray:
|
def get_ndarray(data: NumericData) -> np.ndarray:
|
||||||
"""Wrap data into a numpy ndarray."""
|
"""Wrap data into a numpy ndarray."""
|
||||||
if type(data) == np.ndarray:
|
if isinstance(data, np.ndarray):
|
||||||
return data
|
return data
|
||||||
return np.array(data)
|
return np.array(data)
|
||||||
|
|
||||||
|
|
||||||
def get_shape(data: NumericData) -> TensorShape:
|
def get_shape(data: NumericData) -> TensorShape:
|
||||||
"""Return a shape of NumericData."""
|
"""Return a shape of NumericData."""
|
||||||
if type(data) == np.ndarray:
|
if isinstance(data, np.ndarray):
|
||||||
return data.shape # type: ignore
|
return data.shape # type: ignore
|
||||||
elif type(data) == list:
|
if isinstance(data, list):
|
||||||
return [len(data)] # type: ignore
|
return [len(data)] # type: ignore
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@ -121,16 +121,16 @@ def get_numpy_ctype(openvino_type: Type) -> type:
|
|||||||
|
|
||||||
def get_ndarray(data: NumericData) -> np.ndarray:
|
def get_ndarray(data: NumericData) -> np.ndarray:
|
||||||
"""Wrap data into a numpy ndarray."""
|
"""Wrap data into a numpy ndarray."""
|
||||||
if type(data) == np.ndarray:
|
if isinstance(data, np.ndarray):
|
||||||
return data # type: ignore
|
return data # type: ignore
|
||||||
return np.array(data)
|
return np.array(data)
|
||||||
|
|
||||||
|
|
||||||
def get_shape(data: NumericData) -> TensorShape:
|
def get_shape(data: NumericData) -> TensorShape:
|
||||||
"""Return a shape of NumericData."""
|
"""Return a shape of NumericData."""
|
||||||
if type(data) == np.ndarray:
|
if isinstance(data, np.ndarray):
|
||||||
return data.shape # type: ignore
|
return data.shape # type: ignore
|
||||||
elif type(data) == list:
|
if isinstance(data, list):
|
||||||
return [len(data)] # type: ignore
|
return [len(data)] # type: ignore
|
||||||
return []
|
return []
|
||||||
|
|
||||||
|
@ -36,10 +36,7 @@ def _add_openvino_libs_to_search_path() -> None:
|
|||||||
lib_path = os.path.join(os.path.dirname(__file__), lib)
|
lib_path = os.path.join(os.path.dirname(__file__), lib)
|
||||||
if os.path.isdir(lib_path):
|
if os.path.isdir(lib_path):
|
||||||
# On Windows, with Python >= 3.8, DLLs are no longer imported from the PATH.
|
# On Windows, with Python >= 3.8, DLLs are no longer imported from the PATH.
|
||||||
if (3, 8) <= sys.version_info:
|
os.add_dll_directory(os.path.abspath(lib_path))
|
||||||
os.add_dll_directory(os.path.abspath(lib_path))
|
|
||||||
else:
|
|
||||||
os.environ["PATH"] = os.path.abspath(lib_path) + ";" + os.environ["PATH"]
|
|
||||||
|
|
||||||
|
|
||||||
def add_openvino_libs_to_path() -> None:
|
def add_openvino_libs_to_path() -> None:
|
||||||
|
@ -47,8 +47,8 @@ def test_any_dict(value_dict, value_type, data_type):
|
|||||||
assert isinstance(ovany.value, dict)
|
assert isinstance(ovany.value, dict)
|
||||||
assert ovany[key] == list(value_dict.values())[0]
|
assert ovany[key] == list(value_dict.values())[0]
|
||||||
assert len(ovany.value) == 1
|
assert len(ovany.value) == 1
|
||||||
assert type(ovany.value[key]) == value_type
|
assert isinstance(ovany.value[key], value_type)
|
||||||
assert type(list(value_dict.values())[0]) == data_type
|
assert isinstance(list(value_dict.values())[0], data_type)
|
||||||
assert ovany.get() == value_dict
|
assert ovany.get() == value_dict
|
||||||
|
|
||||||
|
|
||||||
|
@ -195,7 +195,7 @@ def test_simple_if_basic():
|
|||||||
if_node.set_function(0, then_body)
|
if_node.set_function(0, then_body)
|
||||||
subgraph_func = if_node.get_function(0)
|
subgraph_func = if_node.get_function(0)
|
||||||
|
|
||||||
assert type(subgraph_func) == type(then_body)
|
assert isinstance(subgraph_func, type(then_body))
|
||||||
assert compare_models(subgraph_func, then_body)
|
assert compare_models(subgraph_func, then_body)
|
||||||
assert subgraph_func._get_raw_address() == then_body._get_raw_address()
|
assert subgraph_func._get_raw_address() == then_body._get_raw_address()
|
||||||
|
|
||||||
|
@ -142,7 +142,7 @@ def test_loop_basic():
|
|||||||
|
|
||||||
subgraph_func = loop.get_function()
|
subgraph_func = loop.get_function()
|
||||||
|
|
||||||
assert type(subgraph_func) == type(graph_body)
|
assert isinstance(subgraph_func, type(graph_body))
|
||||||
assert subgraph_func._get_raw_address() == graph_body._get_raw_address()
|
assert subgraph_func._get_raw_address() == graph_body._get_raw_address()
|
||||||
assert compare_models(subgraph_func, graph_body)
|
assert compare_models(subgraph_func, graph_body)
|
||||||
assert loop.get_special_body_ports() == body_ports
|
assert loop.get_special_body_ports() == body_ports
|
||||||
|
@ -121,7 +121,7 @@ def test_tensor_iterator_basic():
|
|||||||
|
|
||||||
subgraph_func = ti.get_function()
|
subgraph_func = ti.get_function()
|
||||||
|
|
||||||
assert type(subgraph_func) == type(graph_body)
|
assert isinstance(subgraph_func, type(graph_body))
|
||||||
assert compare_models(subgraph_func, graph_body)
|
assert compare_models(subgraph_func, graph_body)
|
||||||
assert subgraph_func._get_raw_address() == graph_body._get_raw_address()
|
assert subgraph_func._get_raw_address() == graph_body._get_raw_address()
|
||||||
assert ti.get_num_iterations() == 16
|
assert ti.get_num_iterations() == 16
|
||||||
|
@ -472,7 +472,7 @@ def test_single_property_setting(device):
|
|||||||
core.set_property(device, streams.num(streams.Num.AUTO))
|
core.set_property(device, streams.num(streams.Num.AUTO))
|
||||||
|
|
||||||
assert props.streams.Num.AUTO.to_integer() == -1
|
assert props.streams.Num.AUTO.to_integer() == -1
|
||||||
assert type(core.get_property(device, streams.num())) == int
|
assert isinstance(core.get_property(device, streams.num()), int)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.skipif(os.environ.get("TEST_DEVICE", "CPU") != "CPU", reason=f"Cannot run test on device {os.environ.get('TEST_DEVICE')}, Plugin specific test")
|
@pytest.mark.skipif(os.environ.get("TEST_DEVICE", "CPU") != "CPU", reason=f"Cannot run test on device {os.environ.get('TEST_DEVICE')}, Plugin specific test")
|
||||||
@ -539,10 +539,10 @@ def test_core_cpu_properties(properties_to_set):
|
|||||||
assert core.get_property("CPU", streams.num) == 5
|
assert core.get_property("CPU", streams.num) == 5
|
||||||
|
|
||||||
# RO properties
|
# RO properties
|
||||||
assert type(core.get_property("CPU", props.supported_properties)) == dict
|
assert isinstance(core.get_property("CPU", props.supported_properties), dict)
|
||||||
assert type(core.get_property("CPU", props.available_devices)) == list
|
assert isinstance(core.get_property("CPU", props.available_devices), list)
|
||||||
assert type(core.get_property("CPU", props.optimal_number_of_infer_requests)) == int
|
assert isinstance(core.get_property("CPU", props.optimal_number_of_infer_requests), int)
|
||||||
assert type(core.get_property("CPU", props.range_for_streams)) == tuple
|
assert isinstance(core.get_property("CPU", props.range_for_streams), tuple)
|
||||||
assert type(core.get_property("CPU", props.range_for_async_infer_requests)) == tuple
|
assert isinstance(core.get_property("CPU", props.range_for_async_infer_requests), tuple)
|
||||||
assert type(core.get_property("CPU", device.full_name)) == str
|
assert isinstance(core.get_property("CPU", device.full_name), str)
|
||||||
assert type(core.get_property("CPU", device.capabilities)) == list
|
assert isinstance(core.get_property("CPU", device.capabilities), list)
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] < 7):
|
if sys.version_info[0] < 3 or (sys.version_info[0] == 3 and sys.version_info[1] < 8):
|
||||||
exit("Python* 3.7 or higher is required to run the Deployment Manager.")
|
exit("Python* 3.8 or higher is required to run the Deployment Manager.")
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
from deployman.main import main
|
from deployman.main import main
|
||||||
|
Loading…
Reference in New Issue
Block a user