985c968443
This change makes use of new imports attribute for Bazel's Python rules, which enable adding directories to the PYTHONPATH. This allows us to remove the hack for building protobuf's Python support with Bazel and now allows projects to include protobuf using a Bazel external repository rather than requiring it to be imported directly into the source tree as //google/protobuf. This change also updates the protobuf BUILD file to use a named repository, @python//, for including Python headers rather than //util/python. This allows projects to specify their own package for Python headers when including protobuf with an external repository. Fixes #1230
19 lines
765 B
Python
19 lines
765 B
Python
# This is a placeholder for python headers. Projects needing to use
|
|
# fast cpp protos in protobuf's python interface should build with
|
|
# --define=use_fast_cpp_protos=true, and in addition, provide
|
|
# //external:python_headers dependency that in turn provides Python.h.
|
|
#
|
|
# Projects that include protobuf using a Bazel external repository will need to
|
|
# add a workspace rule to their WORKSPACE files to add an external workspace
|
|
# that includes the Python headers. For example, the protobuf WORKSPACE file
|
|
# includes the following local_repository rule that points to this directory:
|
|
#
|
|
# new_local_repository(
|
|
# name = "python",
|
|
# path = __workspace_dir__ + "/util/python",
|
|
# )
|
|
cc_library(
|
|
name = "python_headers",
|
|
visibility = ["//visibility:public"],
|
|
)
|