Skip to content

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.
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