Ensure py_library targets propagate their directories as imports.

Python imports in Android are relative to module roots, i.e. if
a/b/__init__.py (py_binary) has a dep on c/d/__init__.py (py_library)
where the former module is `b` and the latter is `d`, `a/b/__init__.py`
can just declare `import d` to use `d`. In Bazel, it has to be `import
c.d`. This change ensures that `c` is in the PYTHONPATH of the `b`
py_binary, allowing existing imports to work in Android with Bazel's
python rules.

Bug: 207812332
Test: b run //build/soong/cc/ndkstubgen
Change-Id: I15ac8ae6aa92f4c3e4e299343defb6748c44ddbe
2 files changed
tree: 8309c0b5f268fa3350469fab9e0b68dfd19bb492
  1. ci/
  2. docs/
  3. examples/
  4. json_module_graph/
  5. platforms/
  6. product_variables/
  7. rules/
  8. rules_cc/
  9. scripts/
  10. tests/
  11. bazel.BUILD
  12. bazel.sh
  13. bazel.WORKSPACE
  14. common.bazelrc
  15. darwin.bazelrc
  16. linux.bazelrc
  17. OWNERS
  18. README.md
README.md

Bazel

The code in this directory is experimental. Bazel support for Android Platform is undergoing active development and workflow stability is currently not guaranteed.