Skip to content

Releases: aryamccarthy/rules_python

0.31.0-sc

02 Apr 22:51

Choose a tag to compare

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-sc")

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 = "bd75f7532e1944120c2347eb56af2462cc9d51117cc139eadb20eeffc258366a",
    strip_prefix = "rules_python-0.31.0-sc",
    url = "https://github.com/aryamccarthy/rules_python/releases/download/0.31.0-sc/rules_python-0.31.0-sc.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 = "bd75f7532e1944120c2347eb56af2462cc9d51117cc139eadb20eeffc258366a",
    strip_prefix = "rules_python-0.31.0-sc/gazelle",
    url = "https://github.com/aryamccarthy/rules_python/releases/download/0.31.0-sc/rules_python-0.31.0-sc.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()

Full Changelog: https://github.com/aryamccarthy/rules_python/commits/0.31.0-sc