0.19.0
Using Bzlmod with Bazel 6
Add to your MODULE.bazel
file:
bazel_dep(name = "rules_python", version = "0.19.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 = "ffc7b877c95413c82bfd5482c017edcf759a6250d8b24e82f41f3c8b8d9e287e",
strip_prefix = "rules_python-0.19.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.19.0/rules_python-0.19.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 = "ffc7b877c95413c82bfd5482c017edcf759a6250d8b24e82f41f3c8b8d9e287e",
strip_prefix = "rules_python-0.19.0/gazelle",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.19.0/rules_python-0.19.0.tar.gz",
)
What's Changed
- Making exclusions more strict by @linzhp in #1054
- docs: fix requirement line for runfiles example by @alexeagle in #1052
- fix: make py_proto_library respect PyInfo imports by @aignas in #1046
- Make toolchain acceptance tests work with latest Bazel build CI pipeline by @rickeylev in #1062
- Only set
py_runtime.coverage_tool
for Bazel 6 and higher. by @rickeylev in #1061 - Allow building with unreleased Bazel versions. by @rickeylev in #1063
- Extending server process timeout by @linzhp in #1060
- chore: regenerate gazelle_python.yaml manifest by @aignas in #1066
- feat: wheel publishing by @alexeagle in #1015
- fix: checked-in requirements imports generated requirements by @f0rmiga in #1053
- fix: Propagate testonly et al for wheel
.dist
targets by @rickeylev in #1064 - fix: correctly advertise minimum supported version by @aignas in #1065
- refactor: starlark reimplementation of pip_repository by @aignas in #1043
- Add some docs about how to configure coverage. by @rickeylev in #1074
- Remove empty line between copyright and build file docstring. by @rickeylev in #1084
- cleanup: Remove license type comment; they're no longer required by @rickeylev in #1078
- fix: Use GitHub download URL for BCR URL instead of archive URL. by @rickeylev in #1093
- Add a script to add missing license headers by @rickeylev in #1094
- fix: Update pre-commit dependency versions so isort works. by @rickeylev in #1096
- docs: doc that the Conventional Commit style should be used for merged commits and PRs by @rickeylev in #1099
- test(core): Add analysis tests for base Python rules. by @rickeylev in #1102
Full Changelog: 0.18.0...0.19.0