mirror of
https://github.com/google/benchmark.git
synced 2024-12-26 20:40:21 +08:00
25e5c52a11
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. Co-authored-by: dominic <510002+dmah42@users.noreply.github.com>
34 lines
698 B
Python
34 lines
698 B
Python
load("@nanobind_bazel//:build_defs.bzl", "nanobind_extension", "nanobind_stubgen")
|
|
|
|
py_library(
|
|
name = "google_benchmark",
|
|
srcs = ["__init__.py"],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":_benchmark",
|
|
],
|
|
)
|
|
|
|
nanobind_extension(
|
|
name = "_benchmark",
|
|
srcs = ["benchmark.cc"],
|
|
deps = ["//:benchmark"],
|
|
)
|
|
|
|
nanobind_stubgen(
|
|
name = "benchmark_stubgen",
|
|
marker_file = "bindings/python/google_benchmark/py.typed",
|
|
module = ":_benchmark",
|
|
)
|
|
|
|
py_test(
|
|
name = "example",
|
|
srcs = ["example.py"],
|
|
python_version = "PY3",
|
|
srcs_version = "PY3",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
":google_benchmark",
|
|
],
|
|
)
|