OpenVINO™ is an open source toolkit for optimizing and deploying AI inference
C++ aicomputer-visiondeep-learningdeploy-aidiffusion-modelsgenerative-aigood-first-issueinferencellm-inferencenatural-language-processingnlpopenvinooptimize-aiperformance-boostrecommendation-systemspeech-recognitionstable-diffusiontransformersyolo
[PyOV] Migrate wheel building interface to `python -m build` for main OV wheel (#27190)
Przemyslaw Wysocki1b0a4cfdbd0b
diff --git a/src/bindings/python/constraints.txt b/src/bindings/python/constraints.txtindex 65ce94d71b3..4e603a41c88 100644--- a/src/bindings/python/constraints.txt+++ b/src/bindings/python/constraints.txt@@ -8,6 +8,7 @@ pytest-html==4.1.1pytest-timeout==2.3.1# Python bindings+build<1.3py>=1.9.0pygments>=2.8.1setuptools>=65.6.1,<75.3.0diff --git a/src/bindings/python/wheel/CMakeLists.txt b/src/bindings/python/wheel/CMakeLists.txtindex 7d8ebd5256a..72828a155dd 100644--- a/src/bindings/python/wheel/CMakeLists.txt+++ b/src/bindings/python/wheel/CMakeLists.txt@@ -100,31 +100,14 @@ set(openvino_wheel_path "${openvino_wheels_output_dir}/${openvino_wheel_name}")# create target for openvino.wheel#-execute_process(COMMAND ${Python3_EXECUTABLE} -m pip --version- OUTPUT_VARIABLE pip_version OUTPUT_STRIP_TRAILING_WHITESPACE)--string(REGEX MATCH "pip[ ]+([\\.0-9]*)" pip_version "${pip_version}")-set(pip_version ${CMAKE_MATCH_1})--if(pip_version VERSION_GREATER_EQUAL 22.0)- set(wheel_build_command- ${Python3_EXECUTABLE} -m pip wheel- --no-deps- --wheel-dir ${openvino_wheels_output_dir}- --verbose- --build-option --build-number=${WHEEL_BUILD}- --build-option --plat-name=${PLATFORM_TAG}- "${CMAKE_CURRENT_SOURCE_DIR}")-else()- set(wheel_build_command- ${Python3_EXECUTABLE} "${CMAKE_CURRENT_SOURCE_DIR}/setup.py"- --quiet- --no-user-cfg- bdist_wheel- --dist-dir ${openvino_wheels_output_dir}- --build-number=${WHEEL_BUILD}- --plat-name=${PLATFORM_TAG})-endif()+# for --config-setting explanation see https://github.com/pypa/setuptools/issues/2491+set(wheel_build_command+ ${Python3_EXECUTABLE} -m build "${CMAKE_CURRENT_SOURCE_DIR}"+ --outdir ${openvino_wheels_output_dir}+ --config-setting=--build-option=--build-number=${WHEEL_BUILD}+ --config-setting=--build-option=--plat-name=${PLATFORM_TAG}+ --config-setting=--quiet+ --wheel)add_custom_command(OUTPUT ${openvino_wheel_path}COMMAND ${setup_py_env} ${wheel_build_command}diff --git a/src/bindings/python/wheel/requirements-dev.txt b/src/bindings/python/wheel/requirements-dev.txtindex c88d91751eb..a6c2dcbdf8f 100644--- a/src/bindings/python/wheel/requirements-dev.txt+++ b/src/bindings/python/wheel/requirements-dev.txt@@ -1,4 +1,5 @@-c ../constraints.txtsetuptoolswheel+buildpatchelf; sys_platform == 'linux' and platform_machine == 'x86_64'