Skip to content

Files

bzlmod_build_file_generation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Dec 7, 2024
Jan 22, 2025
May 4, 2023
Oct 22, 2024
May 4, 2023
Feb 4, 2025
Mar 21, 2025
May 4, 2023
May 4, 2023
May 4, 2023
Oct 17, 2023
Mar 11, 2025
Mar 11, 2025
May 4, 2023
Dec 8, 2024
Mar 25, 2025
Mar 25, 2025

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.