bazel support for tools (#982)

* packages versions updated to be in sync with modern python versions
This commit is contained in:
Alexander 2020-11-06 12:10:04 +03:00 committed by GitHub
parent d9abf01763
commit 348aa2c964
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 34 additions and 0 deletions

View File

@ -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",
)

2
requirements.txt Normal file
View File

@ -0,0 +1,2 @@
numpy == 1.19.4
scipy == 1.5.4

19
tools/BUILD.bazel Normal file
View File

@ -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",
],
)