Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[PyOV] Use `packaging` instead of `wheel.vendored` in CMake checks (#33763)

Przemyslaw Wysocki6bf892155e3f
diff --git a/src/bindings/python/constraints.txt b/src/bindings/python/constraints.txt
index 122a322ebb9..56deb0318c3 100644
--- a/src/bindings/python/constraints.txt
+++ b/src/bindings/python/constraints.txt
@@ -12,7 +12,7 @@ build<1.5
pygments>=2.8.1
setuptools>=77,<80.10
sympy>=1.10
-wheel>=0.38.1,<0.46.2
+wheel>=0.38.1
patchelf<=0.17.2.4
packaging>=22.0
diff --git a/src/bindings/python/wheel/CMakeLists.txt b/src/bindings/python/wheel/CMakeLists.txt
index 8f654351ed8..733f9e480e4 100644
--- a/src/bindings/python/wheel/CMakeLists.txt
+++ b/src/bindings/python/wheel/CMakeLists.txt
@@ -6,10 +6,10 @@
# Define proper package name
#
-execute_process(COMMAND ${Python3_EXECUTABLE} -c "import wheel.vendored.packaging.tags as tags ; print(f'{tags.interpreter_name()}{tags.interpreter_version()}')"
+execute_process(COMMAND ${Python3_EXECUTABLE} -c "from packaging import tags; print(f'{tags.interpreter_name()}{tags.interpreter_version()}')"
OUTPUT_VARIABLE PYTHON_TAG OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT PYTHON_TAG)
- message(FATAL_ERROR "Failed to detect Python Tag via wheel.vendored.packaging.tags. Please, check 'wheel' dependency version update")
+ message(FATAL_ERROR "Failed to detect Python Tag via packaging.tags. Please, check 'packaging' dependency version update")
endif()
execute_process(COMMAND ${Python3_EXECUTABLE} -c "from setuptools.command.bdist_wheel import get_abi_tag; print(f'{get_abi_tag()}')"
@@ -18,10 +18,10 @@ if(NOT ABI_TAG)
message(FATAL_ERROR "Failed to detect ABI Tag via setuptools.command.bdist_wheel. Please, check 'setuptools' dependency version update")
endif()
-execute_process(COMMAND ${Python3_EXECUTABLE} -c "import wheel.vendored.packaging.tags as tags ; print(f'{next(tags.platform_tags())}')"
+execute_process(COMMAND ${Python3_EXECUTABLE} -c "from packaging import tags; print(f'{next(tags.platform_tags())}')"
OUTPUT_VARIABLE PLATFORM_TAG OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT PLATFORM_TAG)
- message(FATAL_ERROR "Failed to detect Platform Tag via wheel.vendored.packaging.tags. Please, check 'wheel' dependency version update")
+ message(FATAL_ERROR "Failed to detect Platform Tag via packaging.tags. Please, check 'packaging' dependency version update")
endif()
# defines wheel architecture part of `PLATFORM_TAG`
diff --git a/src/bindings/python/wheel/requirements-dev.txt b/src/bindings/python/wheel/requirements-dev.txt
index a6c2dcbdf8f..f40b57ac55e 100644
--- a/src/bindings/python/wheel/requirements-dev.txt
+++ b/src/bindings/python/wheel/requirements-dev.txt
@@ -2,4 +2,5 @@
setuptools
wheel
build
+packaging
patchelf; sys_platform == 'linux' and platform_machine == 'x86_64'