-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PyOV] Migrate wheel building interface to python -m build
for main OV wheel
#27190
Conversation
1b0a4cf
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}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, should we use pip wheel
instead ? to avoid dependency on build
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, are you going to rework this call as well ?
https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/python/CMakeLists.txt#L328
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW, should we use pip wheel instead ? to avoid dependency on build
In the original code there was an if
depending on pip
version, and for older pip
s it would call setup.py
directly. I tried unifying the functionality to call pip wheel
for all pip
versions, but it seems there's some incompatibility which results in very unfriendly errors which would require (in my opinion) a lot of changes, only once I figure out what needs to be changed.
Changing to using build
(which is a pypa recommended replacement) works for all pip versions and removes the branching based on pip
version.
We could work on making pip wheel
work with old pip versions, but I believe it will be time consuming and difficult, or stay with pip wheel
but drop support for older pip
s.
BTW, are you going to rework this call as well ?
https://github.com/openvinotoolkit/openvino/blob/master/src/bindings/python/CMakeLists.txt#L328
The changes regarding this call are in #27227.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can enable pip wheel for newer pip versions, while old ones (via build
) will not be used after some time and we can just force to use newer pip only (once Ubuntu 20.04 is dropped, for example)
… OV wheel (openvinotoolkit#27190) ### Details: - Direct `setup.py` calls are deprecated and using `build` package instead is recommended ([source](https://packaging.python.org/en/latest/discussions/setup-py-deprecated/)) - PR simplifies wheel building by using `python -m build` for all pip versions - A new build dependency has been added since `build` is not supplied with Python - `setuptools` (our current build backend) is not integrated well with `config_settings`, which leads to an unfriendly looking workaround for passing build settings (more details in pypa/setuptools#2491) - Migrations for other wheels will be delivered in separate PRs as they have a different scope (for example `openvino_dev` also requires migration from using `pkg_resources` package) ### Tickets: - CVS-155190
### Details: - An alternative to #27426 - The functionality branching based on pip version has recently been removed in #27190 - This fix has originated from discussion at https://github.com/openvinotoolkit/openvino/pull/27190/files#r1830707810 - Fix for issues with NPU building on Windows machines - A disadvantage is that we need to have `build` as a dependency no matter what, there's no environment marker for `pip` version which would allow us to install it conditionally ### Tickets: - EISW-146038 Signed-off-by: p-wysocki <[email protected]>
Details:
setup.py
calls are deprecated and usingbuild
package instead is recommended (source)python -m build
for all pip versionsbuild
is not supplied with Pythonsetuptools
(our current build backend) is not integrated well withconfig_settings
, which leads to an unfriendly looking workaround for passing build settings (more details in Setuptools does not pass config_settings through backend pypa/setuptools#2491)openvino_dev
also requires migration from usingpkg_resources
package)Tickets: