You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is documenting the current state and closing the last remaining
TODO items for 1.0 release.
Work towards bazel-contrib#1361.
---------
Co-authored-by: Greg Roodt <[email protected]>
Co-authored-by: Richard Levasseur <[email protected]>
Copy file name to clipboardexpand all lines: BZLMOD_SUPPORT.md
+30-12
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,12 @@
2
2
3
3
## `rules_python``bzlmod` support
4
4
5
-
- Status: Beta
5
+
- Status: GA
6
6
- Full Feature Parity: No
7
+
-`rules_python`: Yes
8
+
-`rules_python_gazelle_plugin`: No (see below).
7
9
8
-
Some features are missing or broken, and the public APIs are not yet stable.
10
+
In general `bzlmod` has more features than `WORKSPACE` and users are encouraged to migrate.
9
11
10
12
## Configuration
11
13
@@ -27,15 +29,6 @@ A user does not use `local_path_override` stanza and would define the version in
27
29
28
30
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
31
30
-
## Feature parity
31
-
32
-
This rule set does not have full feature partity with the older `WORKSPACE` type configuration:
33
-
34
-
1. 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.
35
-
2. We have some features that are still not fully flushed out, and the user interface may change.
36
-
37
-
Check ["issues"](/bazelbuild/rules_python/issues) for an up to date list.
38
-
39
32
## Differences in behavior from WORKSPACE
40
33
41
34
### Default toolchain is not the local system Python
@@ -52,10 +45,35 @@ platforms.
52
45
If you want to use the same toolchain as what WORKSPACE used, then manually
53
46
register the builtin Bazel Python toolchain by doing
Examples are in the {gh-path}`examples` directory.
7
+
The core Python rules -- `py_library`, `py_binary`, `py_test`,
8
+
`py_proto_library`, and related symbols that provide the basis for Python
9
+
support in Bazel.
11
10
12
-
Currently, the core rules build into the Bazel binary, and the symbols in this
13
-
repository are simple aliases. However, we are migrating the rules to Starlark and removing them from the Bazel binary. Therefore, the future-proof way to depend on Python rules is via this repository. See
14
-
{ref}`Migrating from the Bundled Rules` below.
11
+
When using Bazel 6 (or earlier), the core rules are bundled into the Bazel binary, and the symbols
12
+
in this repository are simple aliases. On Bazel 7 and above `rules_python` uses
13
+
a separate Starlark implementation,
14
+
see {ref}`Migrating from the Bundled Rules` below.
15
15
16
-
The core rules are stable. Their implementation in Bazel is subject to Bazel's
Once migrated to rules_python, they may evolve at a different
19
-
rate, but this repository will still follow [semantic versioning](https://semver.org).
16
+
Once rules_python 1.0 is released, they will follow
17
+
[semantic versioning](https://semver.org) and the breaking change policy
18
+
outlined in the [support](support) page.
20
19
21
-
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See
22
-
{gh-path}`How to contribute <CONTRIBUTING.md>` for information on our development workflow.
20
+
:::
23
21
24
-
## Bzlmod support
22
+
:::{topic} PyPI integration
25
23
26
-
- Status: Beta
27
-
- Full Feature Parity: No
24
+
Package installation rules for integrating with PyPI and other SimpleAPI
25
+
compatible indexes.
28
26
29
-
See {gh-path}`Bzlmod support <BZLMOD_SUPPORT.md>` for more details
27
+
These rules work and can be used in production, but the cross-platform building
28
+
that supports pulling PyPI dependencies for a target platform that is different
29
+
from the host platform is still in beta and the APIs that are subject to potential
30
+
change are marked as `experimental`.
31
+
32
+
:::
33
+
34
+
:::{topic} Sphinxdocs
35
+
36
+
`sphinxdocs` rules allow users to generate documentation using Sphinx powered by Bazel, with additional functionality for documenting
37
+
Starlark and Bazel code.
38
+
39
+
The functionality is exposed because other projects find it useful, but
40
+
it is available as is and **the semantic versioning and
41
+
compatibility policy used by `rules_python` does not apply**.
42
+
43
+
:::
44
+
45
+
:::{topic} Gazelle plugin
46
+
47
+
`gazelle` plugin for generating `BUILD.bazel` files based on Python source
48
+
code.
49
+
50
+
This is available as is and the semantic versioning used by `rules_python` does
51
+
not apply.
52
+
53
+
:::
54
+
55
+
The Bazel community maintains this repository. Neither Google nor the Bazel
56
+
team provides support for the code. However, this repository is part of the
57
+
test suite used to vet new Bazel releases. See {gh-path}`How to contribute
58
+
<CONTRIBUTING.md>` for information on our development workflow.
59
+
60
+
## Examples
61
+
62
+
This documentation is an example of `sphinxdocs` rules and the rest of the
63
+
components have examples in the {gh-path}`examples` directory.
30
64
31
65
## Migrating from the bundled rules
32
66
33
67
The core rules are currently available in Bazel as built-in symbols, but this
34
68
form is deprecated. Instead, you should depend on rules_python in your
35
-
`WORKSPACE` file and load the Python rules from
36
-
`@rules_python//python:defs.bzl`.
69
+
`WORKSPACE`or `MODULE.bazel`file and load the Python rules from
70
+
`@rules_python//python:defs.bzl` or load paths described in the API documentation.
37
71
38
72
A [buildifier](https://github.com/bazelbuild/buildtools/blob/master/buildifier/README.md)
39
73
fix is available to automatically migrate `BUILD` and `.bzl` files to add the
@@ -44,13 +78,18 @@ appropriate `load()` statements and rewrite uses of `native.py_*`.
0 commit comments