Skip to content

0.21.0

Compare
Choose a tag to compare
@github-actions github-actions released this 20 Apr 16:51
· 683 commits to main since this release
c72c7bc

Using Bzlmod with Bazel 6

Add to your MODULE.bazel file:

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

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

pip.parse(
    name = "pip",
    requirements_lock = "//:requirements_lock.txt",
)

use_repo(pip, "pip")

# (Optional) Register a specific python toolchain instead of using the host version
python = use_extension("@rules_python//python:extensions.bzl", "python")

python.toolchain(
    name = "python3_9",
    python_version = "3.9",
)

use_repo(python, "python3_9_toolchains")

register_toolchains(
    "@python3_9_toolchains//:all",
)

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 = "94750828b18044533e98a129003b6a68001204038dc4749f40b195b24c38f49f",
    strip_prefix = "rules_python-0.21.0",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.21.0/rules_python-0.21.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 = "94750828b18044533e98a129003b6a68001204038dc4749f40b195b24c38f49f",
    strip_prefix = "rules_python-0.21.0/gazelle",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.21.0/rules_python-0.21.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

  • cleanup: factor reexports.bzl into the respective implementation files by @rickeylev in #1137
  • fix: bump installer to handle windows better by @f0rmiga in #1138
  • build: Fixing buildifier by @chrislovecnm in #1148
  • docs: Updating documentation for bzlmod by @chrislovecnm in #1149
  • fix: use a consistent buildifier version for CI and pre-commit by @aignas in #1151
  • chore: bump buildifier to 6.1.0 by @aignas in #1152
  • fix: correct the labels returned by all_requirements lists by @aignas in #1146
  • fix: gazelle correctly adds new py_test rules by @amartani in #1143
  • fix: respect kind mapping by @OniOni in #1158
  • test: cleanup gazelle tests and run them in parallel by @aignas in #1159
  • [docs] Fixing rule name in coverage.md docs by @anfelbar in #1162
  • feat: Support specifying multiple download URLs in tool_versions. by @quval in #1145

New Contributors

Full Changelog: 0.20.0...0.21.0