tree: b38b8527c3e56bc47a5fe7484f77326304135567 [path history] [tgz]
  1. other_module/
  2. runfiles/
  3. .bazelignore
  4. .bazelrc
  5. .bazelversion
  6. .gitignore
  7. __main__.py
  8. __test__.py
  9. BUILD.bazel
  10. gazelle_python.yaml
  11. lib.py
  12. MODULE.bazel
  13. README.md
  14. requirements.in
  15. requirements_lock.txt
  16. requirements_windows.txt
  17. WORKSPACE
examples/bzlmod_build_file_generation/README.md

Bzlmod build file generation example

This example demostrates how to use rules_python and gazelle with bzlmod enabled. Bzlmod, the new external dependency subsystem, does not directly work with repo definitions. Instead, it builds a dependency graph from modules, runs extensions on top of the graph, and defines repos accordingly.

Gazelle is setup with the rules_python extension, so that targets like py_library and py_binary can be automatically created just by running:

$ bazel run //:gazelle update

The are other targets that allow you to update the gazelle dependency management when you update the requirements.in file. See:

bazel run //:gazelle_python_manifest.update

For more information on the behavior of the rules_python gazelle extension, see the README.md file in the /gazelle folder.

This example uses a MODULE.bazel file that configures the bzlmod dependency management. See comments in the MODULE.bazel and BUILD.bazel files for more information.