From 3af1aaadabf49bc6274711a11f81627c0f351a9a Mon Sep 17 00:00:00 2001 From: Naresh Date: Fri, 27 Jul 2018 14:39:14 +0000 Subject: Basic setup to build gRPC Python with Bazel Building gRPC Python with Bazel has been one of the long requested additions to gRPC (#8079). Doing so had been made complex by the fact that Bazel itself is still in active development. There has been extensive work on building Cython code at tensorflow, which can be reused for gRPC's purposes as well. Major included changes required for building grpcio with Bazel are: - Include Cython as a third party Bazel package, to compile the Cython parts of gRPC Python. - Include rules for Python autoconfiguration so Python headers can be detected by cygrpc. --- third_party/cython.BUILD | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 third_party/cython.BUILD (limited to 'third_party/cython.BUILD') diff --git a/third_party/cython.BUILD b/third_party/cython.BUILD new file mode 100644 index 0000000000..ce9283e2a4 --- /dev/null +++ b/third_party/cython.BUILD @@ -0,0 +1,29 @@ +# Adapted with modifications from tensorflow/third_party/cython.BUILD + +py_library( + name="cython_lib", + srcs=glob( + ["Cython/**/*.py"], + exclude=[ + "**/Tests/*.py", + ], + ) + ["cython.py"], + data=glob([ + "Cython/**/*.pyx", + "Cython/Utility/*.*", + "Cython/Includes/**/*.pxd", + ]), + srcs_version="PY2AND3", + visibility=["//visibility:public"], +) + +# May not be named "cython", since that conflicts with Cython/ on OSX +py_binary( + name="cython_binary", + srcs=["cython.py"], + main="cython.py", + srcs_version="PY2AND3", + visibility=["//visibility:public"], + deps=["cython_lib"], +) + -- cgit v1.2.3