Skip to content

0.31.0

Compare
Choose a tag to compare
@github-actions github-actions released this 13 Feb 04:57
· 361 commits to main since this release
5f51a44

Using Bzlmod with Bazel 6

NOTE: bzlmod support is still beta. APIs subject to change.

Add to your MODULE.bazel file:

bazel_dep(name = "rules_python", version = "0.31.0")

pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")

pip.parse(
    hub_name = "pip",
    python_version = "3.11",
    requirements_lock = "//:requirements_lock.txt",
)

use_repo(pip, "pip")

Using WORKSPACE

Paste this snippet into your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_python",
    sha256 = "c68bdc4fbec25de5b5493b8819cfc877c4ea299c0dcb15c244c5a00208cde311",
    strip_prefix = "rules_python-0.31.0",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz",
)

load("@rules_python//python:repositories.bzl", "py_repositories")

py_repositories()

Gazelle plugin

Paste this snippet into your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_python_gazelle_plugin",
    sha256 = "c68bdc4fbec25de5b5493b8819cfc877c4ea299c0dcb15c244c5a00208cde311",
    strip_prefix = "rules_python-0.31.0/gazelle",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.31.0/rules_python-0.31.0.tar.gz",
)

# To compile the rules_python gazelle extension from source,
# we must fetch some third-party go dependencies that it uses.

load("@rules_python_gazelle_plugin//:deps.bzl", _py_gazelle_deps = "gazelle_deps")

_py_gazelle_deps()

What's Changed

This release is the same as 0.30.0, except the rules_python implementation of the rules is enabled for Bazel 7. Earlier Bazel versions are unaffected. If you encounter issues, please report them! The rules_python implementation can be disabled by any of the following:

  • Setting RULES_PYTHON_ENABLE_PYSTAR=0 in your environment or using --action_env
  • Downgrading to 0.30.0

Below is a list of commits:

  • feat: enable rules_python Starlark implemention by default for Bazel 7+ by @rickeylev in #1699
  • chore: Update changelog for 0.31.0 by @rickeylev in #1754

Full Changelog: 0.30.0...0.31.0