Describe the bug
Execute tools/compare.py with bazel and python3.12 will get an error:
$ bazelisk run @com_google_benchmark//tools:compare benchmarks ./baseline.json ./benchmark.json
Traceback (most recent call last):
File "C:\Users\admin\AppData\Local\Temp\Bazel.runfiles_2c5wqe9z\runfiles\com_google_benchmark\tools\compare.py", line 13, in <module>
import gbench
ModuleNotFoundError: No module named 'gbench'
System
Which OS, compiler, and compiler version are you using:
Describe the bug Execute
tools/compare.py
with bazel and python3.12 will get an error:System Which OS, compiler, and compiler version are you using:
To reproduce To reproduce this bug:
http_archive( name = "rules_python", sha256 = "e85ae30de33625a63eca7fc40a94fea845e641888e52f32b6beea91e8b1b2793", strip_prefix = "rules_python-0.27.1", url = "https://github.com/bazelbuild/rules_python/releases/download/0.27.1/rules_python-0.27.1.tar.gz", )
load("@rules_python//python:repositories.bzl", "py_repositories", "python_register_toolchains")
py_repositories()
python_register_toolchains( name = "python3_12", ignore_root_user_error = True, python_version = "3.12.0", )
load("@python3_12//:defs.bzl", "interpreter") load("@rules_python//python:pip.bzl", "pip_parse") pip_parse( name = "tools_pip_deps", python_interpreter_target = interpreter, requirements_lock = "//:requirements-build.txt", )
load("@tools_pip_deps//:requirements.bzl", install_deps_other = "install_deps")
Call it to define repos for your requirements.
install_deps_other()
bazelisk run @com_google_benchmark//tools:compare benchmarks ./baseline.json ./benchmark.json
Additional context One of the way to fix that may be add
imports
field to//tools/compare
target: