aboutsummaryrefslogtreecommitdiffhomepage
path: root/WORKSPACE
diff options
context:
space:
mode:
authorGravatar Naresh <ghostwriternr@gmail.com>2018-07-27 14:44:09 +0000
committerGravatar Naresh <ghostwriternr@gmail.com>2018-07-27 14:44:09 +0000
commit11f199e34dc416a2bd8b56391b242a867bedade4 (patch)
treea7167dbd902a8184534d7e990eadcfc76f33bbfb /WORKSPACE
parent3af1aaadabf49bc6274711a11f81627c0f351a9a (diff)
Workspace changes to build gRPC Python with Bazel
- Include new rules from bazelbuild/rules_python, which allow for importing pip dependencies with Bazel. - Make Cython BUILD file visible to WORKSPACE. - Use a custom requirements file for Bazel python. This is added to allow for requirements previously added only during build steps.
Diffstat (limited to 'WORKSPACE')
-rw-r--r--WORKSPACE41
1 files changed, 40 insertions, 1 deletions
diff --git a/WORKSPACE b/WORKSPACE
index 8b68c0d2b1..9a0c41977f 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1,5 +1,44 @@
-workspace(name = "com_github_grpc_grpc")
+workspace(name="com_github_grpc_grpc")
load("//bazel:grpc_deps.bzl", "grpc_deps", "grpc_test_only_deps")
grpc_deps()
grpc_test_only_deps()
+
+new_http_archive(
+ name="cython",
+ sha256="d68138a2381afbdd0876c3cb2a22389043fa01c4badede1228ee073032b07a27",
+ urls=[
+ "https://github.com/cython/cython/archive/c2b80d87658a8525ce091cbe146cb7eaa29fed5c.tar.gz",
+ ],
+ strip_prefix="cython-c2b80d87658a8525ce091cbe146cb7eaa29fed5c",
+ build_file="//third_party:cython.BUILD",
+)
+
+load("//third_party/py:python_configure.bzl", "python_configure")
+python_configure(name="local_config_python")
+
+git_repository(
+ name="io_bazel_rules_python",
+ remote="https://github.com/bazelbuild/rules_python.git",
+ commit="8b5d0683a7d878b28fffe464779c8a53659fc645",
+)
+
+load("@io_bazel_rules_python//python:pip.bzl", "pip_repositories", "pip_import")
+
+pip_repositories()
+pip_import(
+ name="grpc_python_dependencies",
+ requirements="//:requirements.bazel.txt",
+)
+
+load("@grpc_python_dependencies//:requirements.bzl", "pip_install")
+pip_install()
+
+git_repository(
+ name="org_pubref_rules_protobuf",
+ remote="https://github.com/pubref/rules_protobuf",
+ tag="v0.8.2",
+)
+
+load("@org_pubref_rules_protobuf//python:rules.bzl", "py_proto_repositories")
+py_proto_repositories()