0.20.0
Using Bzlmod with Bazel 6
Add to your MODULE.bazel
file:
bazel_dep(name = "rules_python", version = "0.20.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 = "a644da969b6824cc87f8fe7b18101a8a6c57da5db39caa6566ec6109f37d2141",
strip_prefix = "rules_python-0.20.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.20.0/rules_python-0.20.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 = "a644da969b6824cc87f8fe7b18101a8a6c57da5db39caa6566ec6109f37d2141",
strip_prefix = "rules_python-0.20.0/gazelle",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.20.0/rules_python-0.20.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
- chore: fix some lingering GH archive URLs by @alexeagle in #1108
- feat: add bzlmod support for gazelle plugin by @aignas in #1077
- docs: Simplify pull request template by @rickeylev in #1100
- chore: fix syntax that stardoc misunderstands as HTML by @alexeagle in #1110
- fix: update gazelle to properly handle dot in package name. by @OniOni in #1083
- fix(bzlmod): expose ignore_root_user_error attribute from python_register_toolchains by @alexeagle in #1114
- feat: add bzl_library for defs.bzl and its dependencies by @rickeylev in #1115
- fix: docs for ignore_root_user_error at the module level by @stonier in #1112
- fix: generation of toolchain aliases //:defs.bzl file. by @oxidase in #1088
- feat: make variable substitution for py_wheel abi, python_tag args by @stonier in #1113
- feat: add bzl_library for proto.bzl by @rickeylev in #1116
- cleanup: Remove license comment in proto build file by @rickeylev in #1118
- fix: restrict proto package visibility to private by @rickeylev in #1117
- cleanup: rename proto BUILD -> BUILD.bazel by @rickeylev in #1119
- feat: bzl file per rule/provider by @rickeylev in #1122
- cleanup: fix typo: libraries, not libaries by @rickeylev in #1127
- feat: add public entry point for PyCcLinkParamsInfo by @rickeylev in #1128
- cleanup: reformat defs.bzl doc string. by @rickeylev in #1126
- fix: Include filename when parsing imports for gazelle by @jlaxson in #1133
New Contributors
Full Changelog: 0.19.0...0.20.0