2024-07-30 22:49:33 +08:00
|
|
|
load("@nanobind_bazel//:build_defs.bzl", "nanobind_extension", "nanobind_stubgen")
|
2020-05-07 00:28:29 +08:00
|
|
|
|
|
|
|
py_library(
|
2020-07-09 16:23:06 +08:00
|
|
|
name = "google_benchmark",
|
2020-05-07 00:28:29 +08:00
|
|
|
srcs = ["__init__.py"],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
":_benchmark",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
2024-03-07 20:28:55 +08:00
|
|
|
nanobind_extension(
|
2020-05-07 00:28:29 +08:00
|
|
|
name = "_benchmark",
|
|
|
|
srcs = ["benchmark.cc"],
|
2024-03-07 20:28:55 +08:00
|
|
|
deps = ["//:benchmark"],
|
2020-05-07 00:28:29 +08:00
|
|
|
)
|
|
|
|
|
2024-07-30 22:49:33 +08:00
|
|
|
nanobind_stubgen(
|
|
|
|
name = "benchmark_stubgen",
|
|
|
|
marker_file = "bindings/python/google_benchmark/py.typed",
|
|
|
|
module = ":_benchmark",
|
|
|
|
)
|
|
|
|
|
2020-05-07 00:28:29 +08:00
|
|
|
py_test(
|
|
|
|
name = "example",
|
|
|
|
srcs = ["example.py"],
|
|
|
|
python_version = "PY3",
|
|
|
|
srcs_version = "PY3",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
2020-07-09 16:23:06 +08:00
|
|
|
":google_benchmark",
|
2020-05-07 00:28:29 +08:00
|
|
|
],
|
|
|
|
)
|