For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
Using Bzlmod
Add to your MODULE.bazel
file:
bazel_dep(name = "rules_python", version = "0.39.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 = "62ddebb766b4d6ddf1712f753dac5740bea072646f630eb9982caa09ad8a7687",
strip_prefix = "rules_python-0.39.0",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.39.0/rules_python-0.39.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 = "62ddebb766b4d6ddf1712f753dac5740bea072646f630eb9982caa09ad8a7687",
strip_prefix = "rules_python-0.39.0/gazelle",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.39.0/rules_python-0.39.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: improve the CHANGELOG for the new release by @aignas in #2385
- chore(deps): upgrade some dependencies that will eventually be required by Bazel 8 by @rickeylev in #2383
- feat(toolchain): support freethreaded toolchains by @aignas in #2372
- chore: change the parse_all_requirements_files default value by @aignas in #2389
- feat: add attrs/fields for the runtime's ABI flags by @rickeylev in #2390
- deps: updates for bazel 8 compatibility by @rickeylev in #2379
- chore: remove references to @rules_cc//cc:defs.bzl by @comius in #2293
- fix: Bazel version check by @comius in #2393
- tests: use $(rootpaths) to get executable files paths for Bazel 8 compatibility by @rickeylev in #2395
- fix: skip precompiling if using Bazel-builtin PyRuntimeInfo by @rickeylev in #2394
- chore: remove Thulio from BCR app configs by @aignas in #2397
- chore: update changelog for 0.39.0 by @rickeylev in #2398
Full Changelog: 0.38.0...0.39.0