Skip to content

WIP: nanobind and Type Stubs#206

Open
philip-paul-mueller wants to merge 39 commits intoghex-org:masterfrom
philip-paul-mueller:nanobind_philip
Open

WIP: nanobind and Type Stubs#206
philip-paul-mueller wants to merge 39 commits intoghex-org:masterfrom
philip-paul-mueller:nanobind_philip

Conversation

@philip-paul-mueller
Copy link
Copy Markdown
Collaborator

@philip-paul-mueller philip-paul-mueller commented Apr 9, 2026

This PR is on top of PR#198 and introduces Type Stubs.

However, it also fixes some bugs unrelated to that:

  • 54015fb: Fixes find_python_module() such that the REQUIRE keyword is respected.
  • 677862a: Fixes the way how nanobind is found, also allows to run it on Arch.
  • e1c33ce: Changes the way how nanobind is found. If it can be found as a Python package it will be used, otherwise it tries to use a system package. This mimics the old beaviour.

msimberg and others added 30 commits March 18, 2026 17:37
While the Python package is picked up correctly, the `nanobind-config.cmake` is not.
Instead of the one that ships with the Python package the one of the system is found, which is in a cmake directory.
However, then the headers are not found.

The solution is to move the found path up in the search hirarchy.
But I do not see how `_pyghex` was ever imported?
Probably it is injected somehow.
GHEX needs to find the `nanobind` python package.
Before it did not matter because the `REQUIRE` keyword was ignored, see commit `54015fb4c58`.
Since the `nanobind` package is installed that thing was probably found.
Thus this commit also installes the Python package.
It was a typo.
It now uses a fallback method, in which the Python package is prefered (and requiered in `pip` build mode, whcih is true since it is installed as a dependency) but otherwise it will fall back on the one that is installed on the system.
However, I can not test it locally for one reason, but it should work on the CI.
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