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

Bump nanobind-bazel to v2.1.0, add stubgen target #1824

Merged
merged 2 commits into from
Jul 30, 2024

Conversation

nicholasjng
Copy link
Contributor

Adds a stub file for the google_benchmark._benchmark submodule, generated with the new nanobind_stubgen rule released in nanobind_bazel v2.1.0.

Tweaks the setup.py logic a little bit to package stub files with the rest of the build artifacts. Also explicitly adds the generated stub and marker files to the list of package data artifacts.

@nicholasjng
Copy link
Contributor Author

Side note: The generated stub causes the following mypy errors:

  1. Unreachable overloads on Counter.Flags.__init__()
  2. Too narrow typing of arg in Counter.Flags.__or__() (expects int, got IntEnum)
  3. Too narrow typing of arg in UserCounters.__eq__() and UserCounters.__ne__() (expects object, got UserCounters).

These all seem to be problems in nanobind.stubgen itself, so there is not a lot to do here except maybe contribute fixes or use a pattern file to rewrite the stub directly at build time.

Adds a stub file for the `google_benchmark._benchmark` submodule,
generated with the new `nanobind_stubgen` rule released in nanobind_bazel
v2.1.0.

Tweaks the setup.py logic a little bit to package stub files with the
rest of the build artifacts. Also explicitly adds the generated stub and
marker files to the list of package data artifacts.
@dmah42 dmah42 merged commit 25e5c52 into google:main Jul 30, 2024
80 checks passed
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