Skip to content
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

[onnx,onnx-optimizier] Remove "python3" dependency and "pybind11" feature #43236

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

luncliff
Copy link
Contributor

@luncliff luncliff commented Jan 13, 2025

Changes

  • Remove python3 dependency in onnx installtion
  • Remove pybind11 feature of onnx and onnx-optimizer

There are some concerns about pybind11 feature of 2 ports.

it seems like there is no use of onnx-optmizier[pybind11] and onnx[pybind11].
And they became fragile to be maintained. I suggest removal of the pybind11 feature.

References

Start of pybind11 feature

Checklist

  • Changes comply with the maintainer guide.
  • SHA512s are updated for each updated download.
  • The "supports" clause reflects platforms that may be fixed by this new version.
  • Any fixed CI baseline entries are removed from that file.
  • Any patches that are no longer applied are deleted from the port's directory.
  • The version database is fixed by rerunning ./vcpkg x-add-version --all and committing the result.
  • Only one version is added to each modified port's versions file.

* use requiremens-min.txt to install other python dependencies
* get pybind11 directory in portfile.cmake
@luncliff luncliff marked this pull request as draft January 13, 2025 12:07
if("pybind11" IN_LIST FEATURES)
x_vcpkg_get_python_packages(PYTHON_VERSION 3 OUT_PYTHON_VAR PYTHON3
REQUIREMENTS_FILE "${SOURCE_PATH}/requirements-min.txt"
PACKAGES "pybind11"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is effectively vendoring pybind11.
If you want to use system python, use empty overlay for python3.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest removal of the pybind11 feature. Updated the PR note above.
Would you check it?

@LilyWangLL LilyWangLL self-assigned this Jan 14, 2025
@LilyWangLL LilyWangLL added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Jan 14, 2025
@luncliff luncliff changed the title [onnx] use "vcpkg-get-python-packages" instead of "python3" dependency [onnx,onnx-optimizier] Remove "python3" dependency and "pybind11" feature Jan 20, 2025
@luncliff luncliff marked this pull request as ready for review January 20, 2025 13:20
@luncliff
Copy link
Contributor Author

If reviewers think onnx-optimizer change can be separated to comply with https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md#make-separate-pull-requests-per-port
I will cherry-pick the related changes and separate the PR. Feel free to tell me.

@Neumann-A
Copy link
Contributor

https://github.com/onnx/onnx/blob/321c1dc21b531ecb13965a3e912c6a4f60c6c206/INSTALL.md?plain=1#L216

If you run into any issues while building ONNX from source, and your error message reads, Could not find pythonXX.lib, ensure that you have consistent Python versions for common commands, such as python and pip. Clean all existing build files and rebuild ONNX again.

As such it requires python3 build by vcpkg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants