aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander <alexander.atu@gmail.com>2020-11-06 12:10:04 +0300
committerGitHub <noreply@github.com>2020-11-06 09:10:04 +0000
commit348aa2c964494b5947c0e7f96b82c1fe844d684f (patch)
tree7b81377f6c0e598f781bfb27046c76ebf9831d83
parentd9abf017632be4a00b92cf4289539b353fcea5d2 (diff)
downloadgoogle-benchmark-348aa2c964494b5947c0e7f96b82c1fe844d684f.tar.gz
bazel support for tools (#982)
* packages versions updated to be in sync with modern python versions
-rw-r--r--WORKSPACE13
-rw-r--r--requirements.txt2
-rw-r--r--tools/BUILD.bazel19
3 files changed, 34 insertions, 0 deletions
diff --git a/WORKSPACE b/WORKSPACE
index c00d12c..fdc8c7f 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -34,3 +34,16 @@ new_local_repository(
build_file = "@//bindings/python:python_headers.BUILD",
path = "/usr/include/python3.6", # May be overwritten by setup.py.
)
+
+http_archive(
+ name = "rules_python",
+ url = "https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz",
+ sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
+)
+
+load("@rules_python//python:pip.bzl", pip3_install="pip_install")
+
+pip3_install(
+ name = "py_deps",
+ requirements = "//:requirements.txt",
+)
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 0000000..85e8986
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,2 @@
+numpy == 1.19.4
+scipy == 1.5.4
diff --git a/tools/BUILD.bazel b/tools/BUILD.bazel
new file mode 100644
index 0000000..5895883
--- /dev/null
+++ b/tools/BUILD.bazel
@@ -0,0 +1,19 @@
+load("@py_deps//:requirements.bzl", "requirement")
+
+py_library(
+ name = "gbench",
+ srcs = glob(["gbench/*.py"]),
+ deps = [
+ requirement("numpy"),
+ requirement("scipy"),
+ ],
+)
+
+py_binary(
+ name = "compare",
+ srcs = ["compare.py"],
+ python_version = "PY2",
+ deps = [
+ ":gbench",
+ ],
+)