Skip to content

Add nanobind as an alternative Python bindings backend for oslquery - #2162

Open
lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-nanobind
Open

Add nanobind as an alternative Python bindings backend for oslquery#2162
lgritz wants to merge 1 commit into
AcademySoftwareFoundation:mainfrom
lgritz:lg-nanobind

Conversation

@lgritz

@lgritz lgritz commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

The oslquery Python module can now be built with nanobind, pybind11, or both, as selected by the CMake variable OSL_PYTHON_BINDINGS_BACKEND.

When the option is unset, the backend is auto-selected: nanobind when OpenImageIO is >= 3.2 and Python is >= 3.10, pybind11 otherwise. Matching OpenImageIO's own framework keeps OSLQuery.Parameter.type interoperable with the paired OpenImageIO module. nanobind need not be installed; it is built locally when missing.

This is modelled from, and uses basically the same techniques as, the recent work done to convert OpenImageIO to nanobind

Design notes are in: docs/dev/specs/003-nanobind-python-bindings/

Assisted-by: Claude Code / claude-opus-5

The oslquery Python module can now be built with nanobind, pybind11,
or both, as selected by the CMake variable OSL_PYTHON_BINDINGS_BACKEND.

When the option is unset, the backend is auto-selected: nanobind when
OpenImageIO is >= 3.2 and Python is >= 3.10, pybind11 otherwise.
Matching OpenImageIO's own framework keeps OSLQuery.Parameter.type
interoperable with the paired OpenImageIO module. nanobind need not be
installed; it is built locally when missing.

Design notes are in: docs/dev/specs/003-nanobind-python-bindings/

Assisted-by: Claude Code / claude-opus-5

Signed-off-by: Larry Gritz <lg@larrygritz.com>
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.

1 participant