Skip to content

Conversation

@chemwolf6922
Copy link
Contributor

Changes

  • Generate type info in the wheel. This enables type hints and checks.
  • Expose the enum OgaElementType which is used as a return type but not declared in python.

Adjustments compare to #1742

The following adjustments were made to avoid breaking the internal ado build pipelines:

  • Use onnxruntime python package's included libraries instead of copying libraries to the same folder for stub generation.
  • Use mypy instead of pybind11-stubgen for stub generation. Which can generate stub against the whole package. Enabling the use of the existing library loading scripts during stub generation to avoid loading wrong onnxruntime libraries in some build environment.

@chemwolf6922
Copy link
Contributor Author

Example of the type stub in action:
image

@chemwolf6922 chemwolf6922 changed the title Add build time python type stub generation [WIP] Add build time python type stub generation Oct 11, 2025
@chemwolf6922 chemwolf6922 changed the title [WIP] Add build time python type stub generation Add build time python type stub generation Oct 13, 2025
@chemwolf6922
Copy link
Contributor Author

Hi @baijumeswani, I have verified the changes in the ado python pipelines. Please help take a look. Thanks.

@chemwolf6922
Copy link
Contributor Author

Closing this one in favor of #1844

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants