Skip to content

Commit 9268d91

Browse files
authored
Adding bzlmod support document (#1214)
This markdown file maintains the current status of our bzlmod implementation. Created section in README and linked to the bzlmod doc.
1 parent 46537cf commit 9268d91

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

BZLMOD_SUPPORT.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Bzlmod support
2+
3+
## `rule_python` `bzlmod` support
4+
5+
- Status: Beta
6+
- Full Feature Parity: No
7+
8+
Some features are missing or broken, and the public APIs are not yet stable.
9+
10+
## Configuration
11+
12+
The releases page will give you the latest version number, and a basic example. The release page is located [here](/bazelbuild/rules_python/releases).
13+
14+
## What is bzlmod?
15+
16+
> Bazel supports external dependencies, source files (both text and binary) used in your build that are not from your workspace. For example, they could be a ruleset hosted in a GitHub repo, a Maven artifact, or a directory on your local machine outside your current workspace.
17+
>
18+
> As of Bazel 6.0, there are two ways to manage external dependencies with Bazel: the traditional, repository-focused WORKSPACE system, and the newer module-focused MODULE.bazel system (codenamed Bzlmod, and enabled with the flag `--enable_bzlmod`). The two systems can be used together, but Bzlmod is replacing the WORKSPACE system in future Bazel releases.
19+
> -- <cite>https://bazel.build/external/overview</cite>
20+
21+
## Examples
22+
23+
We have two examples that demonstrate how to configure `bzlmod`.
24+
25+
The first example is in [examples/bzlmod](examples/bzlmod), and it demonstrates basic bzlmod configuration.
26+
A user does not use `local_path_override` stanza and would define the version in the `bazel_dep` line.
27+
28+
A second example, in [examples/bzlmod_build_file_generation](examples/bzlmod_build_file_generation) demonstrates the use of `bzlmod` to configure `gazelle` support for `rules_python`.
29+
30+
## Feature parity
31+
32+
This rule set does not have full feature partity with the older `WORKSPACE` type configuration:
33+
34+
1. Multiple python versions are not yet supported, as demonstrated in [this](examples/multi_python_versions) example.
35+
2. Gazelle does not support finding deps in sub-modules. For instance we can have a dep like ` "@our_other_module//other_module/pkg:lib",` in a `py_test` definition.
36+
37+
Check ["issues"](/bazelbuild/rules_python/issues) for an up to date list.

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ Bazel team, provides support for the code. However, this repository is part of
3131
the test suite used to vet new Bazel releases. See the [How to
3232
contribute](CONTRIBUTING.md) page for information on our development workflow.
3333

34+
## `bzlmod` support
35+
36+
- Status: Beta
37+
- Full Feature Parity: No
38+
39+
See [Bzlmod support](BZLMOD_SUPPORT.md) for more details.
40+
3441
## Getting started
3542

3643
The next two sections cover using `rules_python` with bzlmod and

0 commit comments

Comments
 (0)