Add python_configure.bzl to provide python headers.
3 files changed
tree: ae8307d51339a1e20637ea3c051bb83cafebbede
  1. py/
  2. AUTHORS
  3. BUILD
  4. build_defs.bzl
  5. CONTRIBUTING.md
  6. LICENSE
  7. pybind11.BUILD
  8. python_configure.bzl
  9. README.md
README.md

Bazel extensions for pybind11

In your build file:

load("//third_party/pybind11_bazel:build_defs.bzl", "pybind_extension")

Provided rules:

  • pybind_extension: Builds a python extension, automatically adding the required build flags and pybind11 dependencies. It also defines a .so target which can be manually built and copied. The arguments match a py_extension.
  • pybind_library: Builds a C++ library, automatically adding the required build flags and pybind11 dependencies. This library can then be used as a dependency of a pybind_extension. The arguments match a cc_library.
  • pybind_library_test: Builds a C++ test for a pybind_library. The arguments match a cc_test.

To test a pybind_extension, the most common approach is to write the test in python and use the standard py_test build rule.