Add Python typing stubs#2206
Open
scottdmilner wants to merge 1 commit into
Open
Conversation
|
|
Idclip
reviewed
May 19, 2026
| PYTHON_PATH "." | ||
| MARKER_FILE py.typed | ||
| ) | ||
| endif() |
Contributor
There was a problem hiding this comment.
What happens if someone pulls and is building with < 2.9.2, does the RECURSIVE flag silently do nothing? Would it be worth a nested branch here for if(nanobind_VERSION VERSION_LESS 2.9.2) which outputs a message(WARNING) that no python type info will be generated (as it requires 2.9.2)?
Same in the OpenVDB CMakeLists.
Author
There was a problem hiding this comment.
Good catch, the current behavior is to fail build configuration. I added some checks and warnings.
Idclip
approved these changes
May 19, 2026
Contributor
Idclip
left a comment
There was a problem hiding this comment.
Thanks for this @scottdmilner, I haven't tested but looks good. Minor comment and the failing test can be ignored
02ab1c5 to
b7c2d10
Compare
Idclip
approved these changes
May 20, 2026
Signed-off-by: Scott Milner <scottdmilner@gmail.com>
b7c2d10 to
1db04d4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR uses nanobind's
nanobind_add_stub()to add typing stubs to the Python module. The recommended nanobind version is raised to 2.9.2 to add support for theRECURSIVEflag.Can be toggled by cmake flags
OPENVDB_BUILD_PYTHON_STUBS/NANOVDB_BUILD_PYTHON_STUBS