NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI
PyPI, #1469 most downloaded on PyPI
Latest stable
2.4.6
Last release 12 days ago
09 Nov 2026
Ships on a steady schedule
a new release about every 9 days
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
128 releases · first in 2023
Drag across the ruler to compare, or tap a release to open it.
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.5.0-rc4")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "b17466277d9a49239289d3a87c4c354e27f7366107842a1b0f5c96a61a159656",
strip_prefix = "rules_python-2.5.0-rc4",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.5.0-rc4/rules_python-2.5.0-rc4.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "b17466277d9a49239289d3a87c4c354e27f7366107842a1b0f5c96a61a159656",
strip_prefix = "rules_python-2.5.0-rc4/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.5.0-rc4/rules_python-2.5.0-rc4.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/bazel-contrib/rules_python/compare/2.5.0-rc3...2.5.0-rc4
Your coding agent can read these notes before it upgrades. Set up the MCP server →
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.5.0-rc3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "9567509d7bf5b4e2fcaad522a98a720fe216368463f20012e281186555c27f14",
strip_prefix = "rules_python-2.5.0-rc3",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.5.0-rc3/rules_python-2.5.0-rc3.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "9567509d7bf5b4e2fcaad522a98a720fe216368463f20012e281186555c27f14",
strip_prefix = "rules_python-2.5.0-rc3/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.5.0-rc3/rules_python-2.5.0-rc3.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/bazel-contrib/rules_python/compare/2.5.0-rc0...2.5.0-rc3
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.5.0-rc2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "010464cc8227ed9d771e4c30d07814ed0da94eecb154c68ee266fb1b24c59edb",
strip_prefix = "rules_python-2.5.0-rc2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.5.0-rc2/rules_python-2.5.0-rc2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "010464cc8227ed9d771e4c30d07814ed0da94eecb154c68ee266fb1b24c59edb",
strip_prefix = "rules_python-2.5.0-rc2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.5.0-rc2/rules_python-2.5.0-rc2.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/bazel-contrib/rules_python/compare/2.5.0-rc0...2.5.0-rc2
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.5.0-rc0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "2bf5f5ff0be99bf9f6e02ab4086848a181c9093a09e04719ab80bc27a59d7645",
strip_prefix = "rules_python-2.5.0-rc0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.5.0-rc0/rules_python-2.5.0-rc0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "2bf5f5ff0be99bf9f6e02ab4086848a181c9093a09e04719ab80bc27a59d7645",
strip_prefix = "rules_python-2.5.0-rc0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.5.0-rc0/rules_python-2.5.0-rc0.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()
py_test main validation by @rdesgroppes in https://github.com/bazel-contrib/rules_python/pull/4079uv cache in runnable lock targets by @hartikainen in https://github.com/bazel-contrib/rules_python/pull/4180uv wrapper runfiles in lock targets by @hartikainen in https://github.com/bazel-contrib/rules_python/pull/4182pyi_deps in runtime runfiles by @faximan in https://github.com/bazel-contrib/rules_python/pull/4178imports attribute. by @dougthor42 in https://github.com/bazel-contrib/rules_python/pull/4283Full Changelog: https://github.com/bazel-contrib/rules_python/compare/2.3.0-rc0...2.5.0-rc0
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.6")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "4765b9a4a9c6e0fb89f465aac5b5b0ac06589c9477144340859310777ad801a7",
strip_prefix = "rules_python-2.4.6",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.6/rules_python-2.4.6.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "4765b9a4a9c6e0fb89f465aac5b5b0ac06589c9477144340859310777ad801a7",
strip_prefix = "rules_python-2.4.6/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.6/rules_python-2.4.6.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/bazel-contrib/rules_python/compare/2.4.5...2.4.6
{#v2-4-6-changed}
3.10.22, 3.11.18,
3.12.16, 3.13.18, 3.14.10, and 3.15.2, and removed 3.15.0 pre-release
toolchains (#4358).{#v2-4-5}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.5")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "05088402fa356af097064dbccd7082a061171ef39fbd748fab946e9775f46a16",
strip_prefix = "rules_python-2.4.5",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.5/rules_python-2.4.5.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "05088402fa356af097064dbccd7082a061171ef39fbd748fab946e9775f46a16",
strip_prefix = "rules_python-2.4.5/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.5/rules_python-2.4.5.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/bazel-contrib/rules_python/compare/2.4.4...2.4.5
{#v2-4-5-changed}
uv version to 0.13.5 to address
GHSA-hq85-5cpj-mr62
(#4299).{#v2-4-4}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.4")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "ce2b9317d21f3af1283aaa8f502b34f980407fcc8eb10beaa6bf9dbf39ea27ed",
strip_prefix = "rules_python-2.4.4",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.4/rules_python-2.4.4.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "ce2b9317d21f3af1283aaa8f502b34f980407fcc8eb10beaa6bf9dbf39ea27ed",
strip_prefix = "rules_python-2.4.4/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.4/rules_python-2.4.4.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/bazel-contrib/rules_python/compare/2.4.3...2.4.4
{#v2-4-4-changed}
pip to 26.2.2, pip-tools to 7.6.2, and other internal
dependencies used for compile_pip_requirements, building sdists in
whl_library, and fetching wheels using pip
(#4299).{#v2-4-3}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "4d8b6d82a51fba064431257a2941a6bc6b45e2365a40b9d6ecaef3e297bcf97e",
strip_prefix = "rules_python-2.4.3",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.3/rules_python-2.4.3.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "4d8b6d82a51fba064431257a2941a6bc6b45e2365a40b9d6ecaef3e297bcf97e",
strip_prefix = "rules_python-2.4.3/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.3/rules_python-2.4.3.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/bazel-contrib/rules_python/compare/2.4.2...2.4.3
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "14f8fc9adbf471c7c1258cbf0998de3f63d8d3c81f88e2b96cadff44d71adf71",
strip_prefix = "rules_python-2.4.2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.2/rules_python-2.4.2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "14f8fc9adbf471c7c1258cbf0998de3f63d8d3c81f88e2b96cadff44d71adf71",
strip_prefix = "rules_python-2.4.2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.2/rules_python-2.4.2.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/bazel-contrib/rules_python/compare/2.4.1...2.4.2
{#v2-4-2-fixed}
py_zipapp_binary reaches through
Bazel's _solib symlinks are stored as files again, instead of as symlinks to
absolute paths in the build machine's output base that dangle wherever the
zipapp runs.{#v2-4-1}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "7338fac5da94920b9a2db88add662246e7c41cc5c357ea93670ef23f1f153d4f",
strip_prefix = "rules_python-2.4.1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.1/rules_python-2.4.1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "7338fac5da94920b9a2db88add662246e7c41cc5c357ea93670ef23f1f153d4f",
strip_prefix = "rules_python-2.4.1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.1/rules_python-2.4.1.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/bazel-contrib/rules_python/compare/2.4.0...2.4.1
{#v2-4-1-changed}
3.15.0rc2 to
3.15.0rc3.{#v2-4-0}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "4f4e68bd0e385fb8550b72c77f11ff51c8abd39ea872bfb2f62cc9032c600751",
strip_prefix = "rules_python-2.4.0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0/rules_python-2.4.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "4f4e68bd0e385fb8550b72c77f11ff51c8abd39ea872bfb2f62cc9032c600751",
strip_prefix = "rules_python-2.4.0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0/rules_python-2.4.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()
data attribute to compile_pip_requirements and forward it to the generated py_binary by @granatam in https://github.com/bazel-contrib/rules_python/pull/3865py_test main validation by @rdesgroppes in https://github.com/bazel-contrib/rules_python/pull/4079Full Changelog: https://github.com/bazel-contrib/rules_python/compare/2.1.0...2.4.0
{#v2-4-0-changed}
sys.path adds the Python runtime in runfiles instead
of the underlying Bazel repository cache directory
(#4104).requirements argument of gazelle_python_manifest
in favor of the format-agnostic lockfiles argument, which supports uv.lock.3.15.0a8 to 3.15.0rc1
(#4122).3.15.0rc1 to
3.15.0rc2.3.11 to 3.14
in {obj}python.defaults, {obj}python_register_toolchains, and
{obj}python_register_multi_toolchains
(#4023).libpython*.so* files are now excluded by default from
hermetic Python runtime files for recognized Astral python-build-standalone
builds (20250517 and newer), which statically link libpython into the
interpreter. Older, custom, or unrecognized runtimes retain them. Set
libpython = "include" or "exclude" on {obj}python.override,
{obj}python.single_version_override,
{obj}python.single_version_platform_override, or
{obj}python_register_toolchains to override this behavior
(#4165).{#v2-4-0-fixed}
current_py_cc_libs is used
as a dependency of cc_shared_library.coverage_tool with
{obj}python.single_version_platform_override
(#2570)..pyc file inputs in
{obj}srcs when {obj}precompile is enabled on {obj}py_library,
{obj}py_binary, and {obj}py_test targets
(#4113)..bat extension
(#4114).RECORD file paths for extracted .data directory contents
so that {obj}importlib.metadata.files() correctly locates installed
distribution files (#4025).MAX_PATH on Windows.runfiles.Path method signatures for Python 3.14
typeshed compatibility and fixed {obj}runfiles.Path.match on Python 3.12+.
(#4023)--stamp=false and,
instead the metadata file is written at analysis time via ctx.actions.write().py_test main validation
({obj}validate_test_main) on Windows: the interpreter used for the check
couldn't find its DLLs or its stdlib once relocated
(#4079).libpython files from recognized statically linked Astral
runtime builds.{#v2-4-0-added}
py.typed files from wheels are now included in the pyi_srcs of the
wheel's py_library, alongside .pyi files. The py.typed file of
//python/runfiles is now included in its pyi_srcs as well.Runfiles.CreateOrRaise to return a Runfiles instance
or raise an error if runfiles cannot be found.directory attribute to {obj}lock to support running uv
commands within subdirectories when generating lock files. Defaults to the
package directory, set it to None or "" to set it to the root of the repo
(#4029).{#v2-3-4}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.0-rc3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "acf425401f347cec1e2a5efbb97f1fa4930e180996ab00594e19c300dfa45319",
strip_prefix = "rules_python-2.4.0-rc3",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0-rc3/rules_python-2.4.0-rc3.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "acf425401f347cec1e2a5efbb97f1fa4930e180996ab00594e19c300dfa45319",
strip_prefix = "rules_python-2.4.0-rc3/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0-rc3/rules_python-2.4.0-rc3.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/bazel-contrib/rules_python/compare/2.4.0-rc2...2.4.0-rc3
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.0-rc2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "a97164eb05b089d421dea53edb77a64ae5b10ab97b49dbb53c6a42b5bcf32903",
strip_prefix = "rules_python-2.4.0-rc2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0-rc2/rules_python-2.4.0-rc2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "a97164eb05b089d421dea53edb77a64ae5b10ab97b49dbb53c6a42b5bcf32903",
strip_prefix = "rules_python-2.4.0-rc2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0-rc2/rules_python-2.4.0-rc2.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/bazel-contrib/rules_python/compare/2.4.0-rc1...2.4.0-rc2
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.0-rc1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "58fd35411be71dc5db35a349f0c341b9c8f8491bb5502bab9a89ab5bc733610f",
strip_prefix = "rules_python-2.4.0-rc1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0-rc1/rules_python-2.4.0-rc1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "58fd35411be71dc5db35a349f0c341b9c8f8491bb5502bab9a89ab5bc733610f",
strip_prefix = "rules_python-2.4.0-rc1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0-rc1/rules_python-2.4.0-rc1.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/bazel-contrib/rules_python/compare/2.4.0-rc0...2.4.0-rc1
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.4.0-rc0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.14",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.14",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "2e600c6842f47e21fcc2d7df32c5a6430c54bd7f5489e40408bc11903eeb11ce",
strip_prefix = "rules_python-2.4.0-rc0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0-rc0/rules_python-2.4.0-rc0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "2e600c6842f47e21fcc2d7df32c5a6430c54bd7f5489e40408bc11903eeb11ce",
strip_prefix = "rules_python-2.4.0-rc0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.0-rc0/rules_python-2.4.0-rc0.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()
py_test main validation by @rdesgroppes in https://github.com/bazel-contrib/rules_python/pull/4079Full Changelog: https://github.com/bazel-contrib/rules_python/compare/2.3.0-rc0...2.4.0-rc0
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.3.4")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "a535712f12ba25253d73975ba2932994b5e53773f94b58fb3f8fa7827de8b6b7",
strip_prefix = "rules_python-2.3.4",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.4/rules_python-2.3.4.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "a535712f12ba25253d73975ba2932994b5e53773f94b58fb3f8fa7827de8b6b7",
strip_prefix = "rules_python-2.3.4/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.4/rules_python-2.3.4.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/bazel-contrib/rules_python/compare/2.3.3...2.3.4
{#v2-3-4-added}
i686-pc-windows-msvc) Python runtimes for
versions 3.9.25, 3.10.20, 3.11.15, 3.12.13, 3.13.13, and 3.14.4
(#4156).{#v2-3-3}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.3.3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "f700c75859a827a2e3e3ba4c9c0ec2d796e191bf0438ac3fee0b7851d83a3d4c",
strip_prefix = "rules_python-2.3.3",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.3/rules_python-2.3.3.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "f700c75859a827a2e3e3ba4c9c0ec2d796e191bf0438ac3fee0b7851d83a3d4c",
strip_prefix = "rules_python-2.3.3/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.3/rules_python-2.3.3.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/bazel-contrib/rules_python/compare/2.3.2...2.3.3
{#v2-3-3-changed}
{#v2-3-3-fixed}
PyRuntimeInfo with files = None so creating
zipapp archives does not error.{#v2-3-2}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.3.2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "25a00d55e4376ef6d9f28938b68038faca17c95580c9afe6953e7dde013d00e4",
strip_prefix = "rules_python-2.3.2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.2/rules_python-2.3.2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "25a00d55e4376ef6d9f28938b68038faca17c95580c9afe6953e7dde013d00e4",
strip_prefix = "rules_python-2.3.2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.2/rules_python-2.3.2.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/bazel-contrib/rules_python/compare/2.3.1...2.3.2
{#v2-3-2-fixed}
pip.parse for source-less wheels with
dependencies. (#4053)pip_archive and {obj}whl_archive
repository rules within the {obj}whl_library. From now on we are dropping unsupported args.pip.parse repository names for Git sources in uv.lock
files by excluding URL query and fragment components
(#4084).{#v2-3-1}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.3.1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "678358df0f4ae7f00a33ce33cced97c301f3c523bdd71cb2573d20a93efbf6c6",
strip_prefix = "rules_python-2.3.1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.1/rules_python-2.3.1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "678358df0f4ae7f00a33ce33cced97c301f3c523bdd71cb2573d20a93efbf6c6",
strip_prefix = "rules_python-2.3.1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.1/rules_python-2.3.1.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/bazel-contrib/rules_python/compare/2.3.0...2.3.1
{#v2-3-1-fixed}
{#v2-3-0}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.3.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "70c519e8f0a5d9244c0d3496a6993bd42edf111c4499b68ce2f155c26fc8d4ee",
strip_prefix = "rules_python-2.3.0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.0/rules_python-2.3.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "70c519e8f0a5d9244c0d3496a6993bd42edf111c4499b68ce2f155c26fc8d4ee",
strip_prefix = "rules_python-2.3.0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.0/rules_python-2.3.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()
data attribute to compile_pip_requirements and forward it to the generated py_binary by @granatam in https://github.com/bazel-contrib/rules_python/pull/3865Full Changelog: https://github.com/bazel-contrib/rules_python/compare/2.1.0...2.3.0
{#v2-3-0-changed}
is_python_3.14, which earlier
versions do not define.{#v2-3-0-fixed}
py_binary_rule_builder() / py_test_rule_builder() (from python/api/executables.bzl)
failing at analysis time with a visibility error when used to construct a custom rule from an
external module.data attribute and forward it
directly to the generated py_binary, so files passed via data can be
referenced from extra_args using $(location ...).coverage.py wheel is no longer
emitted as we are now falling back to a pure python wheel
(#3950).python_version 3.13 and 3.14; previously both fell back to the 3.11 list, so modules
added or removed since then (e.g. compression.zstd, telnetlib) were misclassified. The
fallback list for unrecognized versions is now the newest available one rather than 3.11
(#3978).uv_lock to be specified in pip.parse without requiring
requirements_lock (or other os-specific requirement file attributes) to be
set.pkg[extra] entries in a package's own Requires-Dist). The loop compared
the number of extras discovered in the current round against the number known
before it, rather than against the size of the merged set. As a result it
could stop before every extra was resolved, silently dropping dependencies
only reachable through two or more pkg[extra] hops, and for the common case
of a package with no self-referencing extras it never converged at all,
running all 10000 rounds while evaluating each wheel's generated BUILD file
(#4039).--hash=<algo>:<digest> pins and Simple API
#<algo>=<digest> URL fragments are now parsed for all hash algorithms
instead of silently dropping everything except sha256. Non-sha256 pins are
matched against the digests advertised by the index and downloads are verified
using the corresponding Subresource Integrity value, and the pins are kept in
the requirement line when falling back to pip
(#3972).
As part of this, whl_library repos created by pip.parse now always pass
the digest via the integrity attribute (SRI format) instead of sha256,
and the lock file facts store digests as <algo>:<digest> values (the facts
version was bumped, so cached index information is refreshed once).pip.parse(uv_lock = ...) no longer exposes uv workspace/root members
that resolve to no wheel or sdist (e.g. source = { virtual = "." } or editable
installs). Previously these source-less packages were added to the hub's
all_requirements / all_whl_requirements with an alias to a subpackage that
does not exist, breaking analysis for anything enumerating the full set such as
modules_mapping(wheels = all_whl_requirements)
(#3934).index_url for each wheel so that the source registry is forwarded to
the {obj}whl_library. This is so that the purl for package_metadata can be correctly
constructed.file://<absolute_path> for linux and windows like paths. We also support
envsubst for the said paths from now on.{#v2-3-0-added}
build_python_zip, incompatible_default_to_explicit_init_py,
python_path, and experimental_python_import_all_repositories.{obj}explicit_init_py tag class to the `{obj}`config module extension for configuring implicit __init__.py file
generation module-wide.
(#3997,
#2945)py_extension macro for creating C/C++ Python
extension modules
(#3283).
(cc) Added libc, platform_machine, platform_tag, soabi, and
sys_platform attributes and info fields to {obj}py_cc_toolchain /
{obj}PyCcToolchainInfo.pyproject_toml attribute to {obj}pip.default, {obj}pip.parse and {obj}python.defaults to read the default Python version from the requires-python field of pyproject.toml.py_test targets that silently
pass without running any tests. Set
{obj}--@rules_python//python/config_settings:validate_test_main=enabled to
fail the build when a test's main module only contains inert top-level
statements (definitions, imports, assignments) and never invokes a test
runner (#3824).{#v2-2-0}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.3.0-rc2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "f4cd893907e7851cecabf5d1ed2a8eda5ee027f189d808c4bba74c33ee96ffb0",
strip_prefix = "rules_python-2.3.0-rc2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.0-rc2/rules_python-2.3.0-rc2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "f4cd893907e7851cecabf5d1ed2a8eda5ee027f189d808c4bba74c33ee96ffb0",
strip_prefix = "rules_python-2.3.0-rc2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.0-rc2/rules_python-2.3.0-rc2.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/bazel-contrib/rules_python/compare/2.3.0-rc1...2.3.0-rc2
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.3.0-rc1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "2d0c04e94f8f173d07db0b1e452a41c77672c051c2bb085caa212507558f393f",
strip_prefix = "rules_python-2.3.0-rc1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.0-rc1/rules_python-2.3.0-rc1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "2d0c04e94f8f173d07db0b1e452a41c77672c051c2bb085caa212507558f393f",
strip_prefix = "rules_python-2.3.0-rc1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.0-rc1/rules_python-2.3.0-rc1.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/bazel-contrib/rules_python/compare/2.3.0-rc0...2.3.0-rc1
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.3.0-rc0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "5ca87b04971e29b6bf5cd22c6b6581530291893eb31870d75bc46d0f7dd38386",
strip_prefix = "rules_python-2.3.0-rc0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.0-rc0/rules_python-2.3.0-rc0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "5ca87b04971e29b6bf5cd22c6b6581530291893eb31870d75bc46d0f7dd38386",
strip_prefix = "rules_python-2.3.0-rc0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.3.0-rc0/rules_python-2.3.0-rc0.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()
data attribute to compile_pip_requirements and forward it to the generated py_binary by @granatam in https://github.com/bazel-contrib/rules_python/pull/3865Full Changelog: https://github.com/bazel-contrib/rules_python/compare/2.1.0...2.3.0-rc0
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.2.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "e11d2e1efce1589e5bdfa93986712c74fc7467a0f093143d489d2ef5ebb1ed2a",
strip_prefix = "rules_python-2.2.0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.2.0/rules_python-2.2.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "e11d2e1efce1589e5bdfa93986712c74fc7467a0f093143d489d2ef5ebb1ed2a",
strip_prefix = "rules_python-2.2.0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.2.0/rules_python-2.2.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()
Full Changelog: https://github.com/bazel-contrib/rules_python/compare/2.1.0...2.2.0
{#v2-2-0-changed}
{foo}_bzl to {foo} to follow
gazelle naming conventions. Deprecated aliases are left for backwards
compatibility.__init__.py creation.{#v2-2-0-fixed}
cat.experimental_index_url checking truthiness before envsubst
expansion.py_binary and py_test targets whose
names contain path separators so distinct targets with the same basename no
longer share the same venv output directory.{#v2-2-0-added}
features.loadable_symbols to allow detecting public symbols
exported by bzl files.VenvSymlinkEntry and {bzl:obj}VenvSymlinkKind in
{bzl:target}//python:py_info.bzl.@pypi repo: a unified hub of pip.parse hubs.dep tag class to the pip bzlmod extension. This allows
modules to declare abstract PyPI dependencies, ensuring target structures
exist in the unified hub, while allowing other modules to provide the
concrete implementation via pip.parse.uv.lock generation via the lock rule
and basic support for importing the uv.lock file itself. Since this
may have bugs, please report this by creating new tickets.
Work towards #2787
and #1975.{#v2-1-0}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.2.0-rc1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "07e7f836037e9d3d323005124663f92df5a00b3ea70356a775523b226cadfcc0",
strip_prefix = "rules_python-2.2.0-rc1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.2.0-rc1/rules_python-2.2.0-rc1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "07e7f836037e9d3d323005124663f92df5a00b3ea70356a775523b226cadfcc0",
strip_prefix = "rules_python-2.2.0-rc1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.2.0-rc1/rules_python-2.2.0-rc1.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/bazel-contrib/rules_python/compare/2.2.0-rc0...2.2.0-rc1
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.2.0-rc0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "9324bb2ea2dab82cb8dc5d7526674711fb370959199d11955b2a7dd31c648d34",
strip_prefix = "rules_python-2.2.0-rc0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.2.0-rc0/rules_python-2.2.0-rc0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "9324bb2ea2dab82cb8dc5d7526674711fb370959199d11955b2a7dd31c648d34",
strip_prefix = "rules_python-2.2.0-rc0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.2.0-rc0/rules_python-2.2.0-rc0.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/bazel-contrib/rules_python/compare/2.1.0...2.2.0-rc0
fix: Updating setuptools to patch CVE-2025-47273 by @aaronmaxlevy in https://github.com/bazel-contrib/rules_python/pull/2955
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.1.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "5453dafcb177e886961cd1ec9812972316db4beca5ca379916a627732d4b7d11",
strip_prefix = "rules_python-2.1.0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.1.0/rules_python-2.1.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "5453dafcb177e886961cd1ec9812972316db4beca5ca379916a627732d4b7d11",
strip_prefix = "rules_python-2.1.0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.1.0/rules_python-2.1.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()
--no_legacy_external_runfiles by @FrankPortman in https://github.com/bazel-contrib/rules_python/pull/2772METADATA correctly if given empty requires_file by @FrankPortman in https://github.com/bazel-contrib/rules_python/pull/2771pip_compile generate a *.test target; deprecate *_test by @dougthor42 in https://github.com/bazel-contrib/rules_python/pull/2812python.ParserOutput are now all public by @yushan26 in https://github.com/bazel-contrib/rules_python/pull/2959include_pytest_conftest annotation by @dougthor42 in https://github.com/bazel-contrib/rules_python/pull/3080python_proto_naming_convention directive controls py_proto_library naming by @shaldengeki in https://github.com/bazel-contrib/rules_python/pull/3093has_py3_only_sources in the PyInfo constructor by @oprypin in https://github.com/bazel-contrib/rules_python/pull/3315py_console_script_binary compatible with symbolic macros by @janwinkler1 in https://github.com/bazel-contrib/rules_python/pull/3195pip.default arguments in multi-platform example by @hartikainen in https://github.com/bazel-contrib/rules_python/pull/3358lock rule has no implicit test target by @martis42 in https://github.com/bazel-contrib/rules_python/pull/3411_py_toolchain_type py_binary attribute by @rickeylev in https://github.com/bazel-contrib/rules_python/pull/3560versionadded details to some Gazelle directives.md by @dougthor42 in https://github.com/bazel-contrib/rules_python/pull/3624py_zipapp_binary target by @nate-england in https://github.com/bazel-contrib/rules_python/pull/3653Note truncated.
{#v2-1-0-removed}
coverage.py wheel set, since coverage.py 7.6.2 dropped it.{#v2-1-0-changed}
TOOL_VERSIONS in python/versions.bzl is now empty under
bzlmod.python_generate_pyi_deps and python_generate_pyi_srcs now
default to true.configure_coverage_tool = True is set but the bundled
coverage.py wheel set has no entry for the requested python version and
platform, a warning is now printed instead of silently producing an empty
coverage report.{#v2-1-0-fixed}
py_library and py_test targets with missing source files can now be
removed by Gazelle (#3375).
However map_kind and alias_kind will not be removed unless people are running a
gazelle version that includes
bazel-gazelle#2362__init__.py files when generating py_binary
targets (#3729).mypy type checking will be skipped on the generated
files (#3126).--experimental_isolated_extension_usages
(#3668).importlib.metadata.files by ensuring RECORD is included in
installed wheel targets, except when built from sdist
(#3024).sys._base_executable
(#3774).py_test/py_binary failure when the target name contains
path separators; the bootstrap stub is now declared as a sibling of the
.exe launcher
(#3789).target_compatible_with from compile_pip_requirements
towards the underlying *.update target.
(#3787)--action_env to allow
setting authentication for the index URL.
(#3405)uv pip compile in the sandbox. Work
towards better supporting uv out of the box on our platforms.
(#1975)--project parameter based on the source files.
(#3087){#v2-1-0-added}
PyRuntimeInfo.interpreter_files_to_run so action
consumers can execute an in-build runtime interpreter with its runfiles.python.override(add_runtime_manifest_urls = ..., runtime_manifest_sha = ...).python.override.toolchain_target_settings to allow
adding config_setting labels to all registered toolchains.--venvs_site_packages=yes to enable.--venv_site_packages=yes is enabled,
wheel data, bin, and include files are populated into the venv.Runfiles.root()
Fixes #3296.package_metadata support, fixes
#2054.coverage.py to 7.10.7.{#v2-0-3}
chore: print zipapp deprecation for non-windows platforms by @rickeylev in https://github.com/bazel-contrib/rules_python/pull/3591
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.1.0-rc0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "8c8c28f9fc1cc8fd2a24df47deb9da8dc0d5567fa5ab48085515fa92c8cb56d0",
strip_prefix = "rules_python-2.1.0-rc0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.1.0-rc0/rules_python-2.1.0-rc0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "8c8c28f9fc1cc8fd2a24df47deb9da8dc0d5567fa5ab48085515fa92c8cb56d0",
strip_prefix = "rules_python-2.1.0-rc0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.1.0-rc0/rules_python-2.1.0-rc0.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()
_py_toolchain_type py_binary attribute by @rickeylev in https://github.com/bazel-contrib/rules_python/pull/3560versionadded details to some Gazelle directives.md by @dougthor42 in https://github.com/bazel-contrib/rules_python/pull/3624py_zipapp_binary target by @nate-england in https://github.com/bazel-contrib/rules_python/pull/3653pip.parse by @ouillie in https://github.com/bazel-contrib/rules_python/pull/3669Full Changelog: https://github.com/bazel-contrib/rules_python/compare/1.8.0-rc1...2.1.0-rc0
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.0.3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "2610f57b934dc55d1df2728290199519b11cc53508dec34fd5ef0424bcb50242",
strip_prefix = "rules_python-2.0.3",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.3/rules_python-2.0.3.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "2610f57b934dc55d1df2728290199519b11cc53508dec34fd5ef0424bcb50242",
strip_prefix = "rules_python-2.0.3/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.3/rules_python-2.0.3.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/bazel-contrib/rules_python/compare/2.0.2...2.0.3
{#v2-0-3-fixed}
{#v2-0-2}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.0.2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "2119ca04726066c53b8f1ff42dffa090ea7f3e42a75679f1cfda937406cf7753",
strip_prefix = "rules_python-2.0.2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.2/rules_python-2.0.2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "2119ca04726066c53b8f1ff42dffa090ea7f3e42a75679f1cfda937406cf7753",
strip_prefix = "rules_python-2.0.2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.2/rules_python-2.0.2.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/bazel-contrib/rules_python/compare/2.0.1...2.0.2
{#v2-0-2-added}
3.13.12, 3.14.3 Python toolchain from 20260325 release.3.10.20, 3.11.15, 3.12.13, 3.13.13 3.14.4, 3.15.0a8{#v2-0-1}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.0.1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "d4dd58e857a7c1bfc7da68adaef1178a20b197b1176c877afd2373369857e65c",
strip_prefix = "rules_python-2.0.1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.1/rules_python-2.0.1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "d4dd58e857a7c1bfc7da68adaef1178a20b197b1176c877afd2373369857e65c",
strip_prefix = "rules_python-2.0.1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.1/rules_python-2.0.1.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/bazel-contrib/rules_python/compare/2.0.0...2.0.1
{#v2-0-1-fixed}
MODULE.bazel.lock file
facts by passing all of the versions to the get_index function.
Fixes #3756.{#v2-0-0}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.0.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "f4f709b1e354b0089038001854400938962d60d749cd910e12d5883a084510d3",
strip_prefix = "rules_python-2.0.0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0/rules_python-2.0.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "f4f709b1e354b0089038001854400938962d60d749cd910e12d5883a084510d3",
strip_prefix = "rules_python-2.0.0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0/rules_python-2.0.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()
py_zipapp_binary target by @nate-england in https://github.com/bazel-contrib/rules_python/pull/3653Full Changelog: https://github.com/bazel-contrib/rules_python/compare/1.9.0...2.0.0
{#v2-0-0-removed}
{#v2-0-0-changed}
Breaking
--windows_enable_symlinks is required. Add startup --windows_enable_symlinks to your .bazelrc to enable Bazel using full
symlink support on Windows.--bootstrap_impl=system_python)
on supported platforms (Linux/Mac with Bazel 8+, or Windows).--build_python_zip on Windows is ignored. Use {obj}py_zipapp_binary to create
zips of Python programs.experimental_index_url users would not need to specify
target platforms if cross-building is required. From now we will only pull
wheels for the host OS to better align with how the rules work with the legacy
pip implementation. Use {obj}pip.parse.target_platforms to customize the
behavior.
Related to #260.Other changes:
compile_pip_requirements, building
sdists in the whl_library rule and fetching wheels using pip.MODULE.bazel.lock file
on supported bazel versions and it should be done at most once. As a result,
per-package {obj}experimental_index_url_overrides is no longer needed, but
if specified, it needs to be provided for all packages not on the default index. What
is more, the flags for --index_url and --extra-index-url now behave in the
same way as in uv or pip, i.e. we default to --index-url if the package
is not found in --extra-index-url. Fixes
(#3260 and
#2632).uv's
dist_manifest.json file. If you have redirects or blocking rules as part of
your downloader setup, you may need to adjust them. What is more, the default
uv version has been bumped 0.11.2.{#v2-0-0-fixed}
py_zippapp_binary targets
(#3646).RULES_PYTHON_PYCACHE_DIR environment variable
for more information.
(#3643).RUNFILES_DIR inheritance issues, which lead to a child
Python binary incorrectly using it's parent's Python binary environment
(#3518).>=0.10 work again. In order to fix this we had
drop support for powerpc64 platform. People interested in the platform can
bring it back via the uv.default API. Like:uv.default(
compatible_with = [
"@platforms//os:linux",
"@platforms//cpu:ppc",
],
platform = "powerpc64-unknown-linux-gnu",
)
Fixes #3676.{#v2-0-0-added}
MODULE.bazel.lock file if using
{obj}experimental_index_url which should speed up consecutive
initializations and should no longer require the network access if the cache is
hydrated. Implements
#2731.--index-url and --extra-index-url is now parsed from the lock
file and the {obj}pip.parse.experimental_index_url and
{obj}pip.parse.experimental_extra_index_urls is
no longer mandatory to leverage the bazel downloader.
Implements
#1357,
#2951.pip.parse.target_platforms
to specify exactly which platforms should be supported.
Implements
#260./ as a destination in data_files
will now install file(s) to a folder, preserving their basename.py_runtime.venv_bin_files and {obj}PyRuntime.venv_binfiles
field added to specify additional Python runtime files Windows needs for
venvs.PyExecutableInfo.venv_interpreter_runfiles, and
{obj}PyExecutableInfo.venv_interpreter_symlinks addeadd_path_prefix argument in py_wheel which can be
used to prepend a prefix to the files in the wheel.{#v1-9-1}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.0.0-rc4")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "e249ed0ec948f3f27bd2a551e1e30493a8720231edcc0152fe24fc948e9fdb03",
strip_prefix = "rules_python-2.0.0-rc4",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0-rc4/rules_python-2.0.0-rc4.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "e249ed0ec948f3f27bd2a551e1e30493a8720231edcc0152fe24fc948e9fdb03",
strip_prefix = "rules_python-2.0.0-rc4/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0-rc4/rules_python-2.0.0-rc4.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/bazel-contrib/rules_python/compare/2.0.0-rc3...2.0.0-rc4
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.0.0-rc3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "29c9420b5f8fa4e51fd475517186c07a5b0c2269163ce6537e63e5344faca01a",
strip_prefix = "rules_python-2.0.0-rc3",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0-rc3/rules_python-2.0.0-rc3.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "29c9420b5f8fa4e51fd475517186c07a5b0c2269163ce6537e63e5344faca01a",
strip_prefix = "rules_python-2.0.0-rc3/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0-rc3/rules_python-2.0.0-rc3.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/bazel-contrib/rules_python/compare/2.0.0-rc2...2.0.0-rc3
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.0.0-rc2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "f8952649277165e482e6234195ffd7aac535dab78a0546dbd70bbe576f1d8685",
strip_prefix = "rules_python-2.0.0-rc2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0-rc2/rules_python-2.0.0-rc2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "f8952649277165e482e6234195ffd7aac535dab78a0546dbd70bbe576f1d8685",
strip_prefix = "rules_python-2.0.0-rc2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0-rc2/rules_python-2.0.0-rc2.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/bazel-contrib/rules_python/compare/2.0.0-rc1...2.0.0-rc2
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.0.0-rc1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "12c176a65700317e7750ae34196ad3a595af37338b2c322ae30fed70b5a807d1",
strip_prefix = "rules_python-2.0.0-rc1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0-rc1/rules_python-2.0.0-rc1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "12c176a65700317e7750ae34196ad3a595af37338b2c322ae30fed70b5a807d1",
strip_prefix = "rules_python-2.0.0-rc1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0-rc1/rules_python-2.0.0-rc1.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/bazel-contrib/rules_python/compare/2.0.0-rc0...2.0.0-rc1
chore: print zipapp deprecation for non-windows platforms by @rickeylev in https://github.com/bazel-contrib/rules_python/pull/3591
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "2.0.0-rc0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "e91c374f6821fb963abb674cfd3780cd3310a62c54d8990e22d66571df5d7ed0",
strip_prefix = "rules_python-2.0.0-rc0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0-rc0/rules_python-2.0.0-rc0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "e91c374f6821fb963abb674cfd3780cd3310a62c54d8990e22d66571df5d7ed0",
strip_prefix = "rules_python-2.0.0-rc0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.0.0-rc0/rules_python-2.0.0-rc0.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()
_py_toolchain_type py_binary attribute by @rickeylev in https://github.com/bazel-contrib/rules_python/pull/3560versionadded details to some Gazelle directives.md by @dougthor42 in https://github.com/bazel-contrib/rules_python/pull/3624py_zipapp_binary target by @nate-england in https://github.com/bazel-contrib/rules_python/pull/3653Full Changelog: https://github.com/bazel-contrib/rules_python/compare/1.8.0-rc1...2.0.0-rc0
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.9.2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "98880e2942e66fbe23202bd4174c089a54a203c32fc1cbc1c6c86df9f97ad7e3",
strip_prefix = "rules_python-1.9.2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.2/rules_python-1.9.2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "98880e2942e66fbe23202bd4174c089a54a203c32fc1cbc1c6c86df9f97ad7e3",
strip_prefix = "rules_python-1.9.2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.2/rules_python-1.9.2.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/bazel-contrib/rules_python/compare/1.9.1...1.9.2
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.9.1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "4a02240a4a6a8b04077a7e49921949d2e6879d6f047be1e870d222de6709c7d1",
strip_prefix = "rules_python-1.9.1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.1/rules_python-1.9.1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "4a02240a4a6a8b04077a7e49921949d2e6879d6f047be1e870d222de6709c7d1",
strip_prefix = "rules_python-1.9.1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.1/rules_python-1.9.1.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/bazel-contrib/rules_python/compare/1.9.0...1.9.1
{#v1-9-1-added}
3.13.12, 3.14.3 Python toolchain from [20260325] release.3.10.20, 3.11.15, 3.12.13, 3.13.13 3.14.4, 3.15.0a8{#v1-9-0}
fix: Updating setuptools to patch CVE-2025-47273 by @aaronmaxlevy in https://github.com/bazel-contrib/rules_python/pull/2955
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.9.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "098ba13578e796c00c853a2161f382647f32eb9a77099e1c88bc5299333d0d6e",
strip_prefix = "rules_python-1.9.0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0/rules_python-1.9.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "098ba13578e796c00c853a2161f382647f32eb9a77099e1c88bc5299333d0d6e",
strip_prefix = "rules_python-1.9.0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0/rules_python-1.9.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()
--no_legacy_external_runfiles by @FrankPortman in https://github.com/bazel-contrib/rules_python/pull/2772METADATA correctly if given empty requires_file by @FrankPortman in https://github.com/bazel-contrib/rules_python/pull/2771pip_compile generate a *.test target; deprecate *_test by @dougthor42 in https://github.com/bazel-contrib/rules_python/pull/2812python.ParserOutput are now all public by @yushan26 in https://github.com/bazel-contrib/rules_python/pull/2959include_pytest_conftest annotation by @dougthor42 in https://github.com/bazel-contrib/rules_python/pull/3080python_proto_naming_convention directive controls py_proto_library naming by @shaldengeki in https://github.com/bazel-contrib/rules_python/pull/3093has_py3_only_sources in the PyInfo constructor by @oprypin in https://github.com/bazel-contrib/rules_python/pull/3315py_console_script_binary compatible with symbolic macros by @janwinkler1 in https://github.com/bazel-contrib/rules_python/pull/3195pip.default arguments in multi-platform example by @hartikainen in https://github.com/bazel-contrib/rules_python/pull/3358lock rule has no implicit test target by @martis42 in https://github.com/bazel-contrib/rules_python/pull/3411_py_toolchain_type py_binary attribute by @rickeylev in https://github.com/bazel-contrib/rules_python/pull/3560versionadded details to some Gazelle directives.md by @dougthor42 in https://github.com/bazel-contrib/rules_python/pull/3624Full Changelog: https://github.com/bazel-contrib/rules_python/compare/1.3.0...1.9.0
{#v1-9-0-removed}
{#v1-9-0-changed}
py_binary/py_test has been deprecated and
replaced by separate {obj}py_zipapp_binary and {obj}py_zipapp_test
rules. See
#3567
for a detailed migration guide.//python/config_setting/... and the @platforms package instead.PYTHONBREAKPOINT environment variable is automatically inheritedstamp attribute now transitions the Bazel builtin
{flag}--stamp flag.pytorch and friends easier to patch.py_wheel no longer expands the input depset during analysis,
improving analysis performance for targets with large dependency trees.--enable_runfiles=true is the default for
py_binary/py_test. Prior behavior can be restored by adding
@rules_python//command_line_option:enable_runfiles=false or
@rules_python//command_line_option:enable_runfiles=INHERIT to the
config_settings attribute. NOTE: enable_runfiles=true will
soon become required for Windows.{#v1-9-0-fixed}
conftest.py files are added in addition to sibling conftest.py.
(#3497) Note
that this behavior can be reverted to the pre-1.9.0 behavior by setting the new
python_include_ancestor_conftest directive to false.{#v1-9-0-added}
--debugger: allows specifying an extra dependency
to add to binaries/tests for custom debuggers.bazel_binary_info module to access it. The {flag}--stamp flag will
add {obj}--workspace_status_command information.python_generate_pyi_srcs has been added. When
true, a py_* target's pyi_srcs attribute will be set if any .pyi files
that are associated with the target's srcs are present.
(#3354).py_zipapp_binary and {obj}py_zipapp_test rules added. These
will replace --build_python_zip and the zip output group of
py_binary/py_test. The zipapp rules support more functionality, correctness,
and have better build performance.PyExecToolsInfo.exec_runtime for more easily
getting an RBE-compatible runtime to use for build actions.PyExecutableInfo has several new fields to aid packaging
of binaries: {obj}PyExecutableInfo.app_runfiles,
{obj}PyExecutableInfo.interpreter_args,
{obj}PyExecutableInfo.stage2_bootstrap, and
{obj}PyExecutableInfo.venv_python_exe.python_include_ancestor_conftest has been added.
When false, ancestor conftest targets are not automatically added to
{bzl:obj}py_test target dependencies. This false behavior is how things
were in rules_python before 1.9.0. The default is true, as the prior behavior
was technically incorrect.
(#3596){#v1-8-5}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.9.0-rc1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "f4e65a01b6eca51f107d285c8d60869f42cbf4eac32711530399c704e9ba417a",
strip_prefix = "rules_python-1.9.0-rc1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0-rc1/rules_python-1.9.0-rc1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "f4e65a01b6eca51f107d285c8d60869f42cbf4eac32711530399c704e9ba417a",
strip_prefix = "rules_python-1.9.0-rc1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0-rc1/rules_python-1.9.0-rc1.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/bazel-contrib/rules_python/compare/1.9.0-rc0...1.9.0-rc1
chore: print zipapp deprecation for non-windows platforms by @rickeylev in https://github.com/bazel-contrib/rules_python/pull/3591
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.9.0-rc0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "e7159a7365501365469ec9e812b14b3c5933587b7993fea26e63d395f01daa1a",
strip_prefix = "rules_python-1.9.0-rc0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0-rc0/rules_python-1.9.0-rc0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "e7159a7365501365469ec9e812b14b3c5933587b7993fea26e63d395f01daa1a",
strip_prefix = "rules_python-1.9.0-rc0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.0-rc0/rules_python-1.9.0-rc0.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()
_py_toolchain_type py_binary attribute by @rickeylev in https://github.com/bazel-contrib/rules_python/pull/3560versionadded details to some Gazelle directives.md by @dougthor42 in https://github.com/bazel-contrib/rules_python/pull/3624Full Changelog: https://github.com/bazel-contrib/rules_python/compare/1.8.0-rc1...1.9.0-rc0
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.5")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "8964aa1e7525fea5244ba737458694a057ada1be96a92998a41caa1983562d00",
strip_prefix = "rules_python-1.8.5",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.5/rules_python-1.8.5.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "8964aa1e7525fea5244ba737458694a057ada1be96a92998a41caa1983562d00",
strip_prefix = "rules_python-1.8.5/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.5/rules_python-1.8.5.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/bazel-contrib/rules_python/compare/1.8.4...1.8.5
{#v1-8-5-fixed}
CurrentRepository() raising ValueError on Windows.
(#3579)pip_parse no longer silently drops PEP 508 URL-based requirements
(pkg @ https://...) when extract_url_srcs=False (the default for
pip_repository).sqlalchemy[postgresql-psycopg2binary]).
(#3587){#v1-8-4}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.4")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "c85d5db38d3eac06167a13b10c9dba54b003a986cd4f1ebc00806b74e7c12f06",
strip_prefix = "rules_python-1.8.4",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.4/rules_python-1.8.4.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "c85d5db38d3eac06167a13b10c9dba54b003a986cd4f1ebc00806b74e7c12f06",
strip_prefix = "rules_python-1.8.4/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.4/rules_python-1.8.4.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/bazel-contrib/rules_python/compare/1.8.3...1.8.4
{#v1-8-4-fixed}
"1.2" ~= "1.2.0")
has been fixed improving compatibility with the PEP440 standard.
Fixes #3580.whl file is missing them.
Fixes #3554.{#v1-8-3}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "94a2b4c5d9c45323a9737f8de8f841923bb628cace1e8e51fec5525ed9ccfb2d",
strip_prefix = "rules_python-1.8.3",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.3/rules_python-1.8.3.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "94a2b4c5d9c45323a9737f8de8f841923bb628cace1e8e51fec5525ed9ccfb2d",
strip_prefix = "rules_python-1.8.3/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.3/rules_python-1.8.3.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/bazel-contrib/rules_python/compare/1.8.2...1.8.3
{#v1-8-3-fixed}
{#v1-8-2}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "6810ff4b137b62e86ce3cedfebeeb2c988d8c5a16c4fc8081da21ad8f998a141",
strip_prefix = "rules_python-1.8.2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.2/rules_python-1.8.2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "6810ff4b137b62e86ce3cedfebeeb2c988d8c5a16c4fc8081da21ad8f998a141",
strip_prefix = "rules_python-1.8.2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.2/rules_python-1.8.2.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/bazel-contrib/rules_python/compare/1.8.1...1.8.2
{#v1-8-2-fixed}
{#v1-8-1}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "7ae25c0d3b52124fffe199a34520f43e496f4027d59452df70184eced23b96ef",
strip_prefix = "rules_python-1.8.1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.1/rules_python-1.8.1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "7ae25c0d3b52124fffe199a34520f43e496f4027d59452df70184eced23b96ef",
strip_prefix = "rules_python-1.8.1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.1/rules_python-1.8.1.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/bazel-contrib/rules_python/compare/1.8.0...1.8.1
{#v1-8-1-fixed}
{#v1-8-0}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "0558021abbd244f3e2b51120a7ec4bded37c6cb02c372aaa188da9ba375560d8",
strip_prefix = "rules_python-1.8.0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0/rules_python-1.8.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "0558021abbd244f3e2b51120a7ec4bded37c6cb02c372aaa188da9ba375560d8",
strip_prefix = "rules_python-1.8.0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0/rules_python-1.8.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()
lock rule has no implicit test target by @martis42 in https://github.com/bazel-contrib/rules_python/pull/3411Full Changelog: https://github.com/bazel-contrib/rules_python/compare/1.7.0...1.8.0
{#v1-8-0-known-issues}
{#v1-8-0-removed}
(toolchain) Remove all of the python 3.8 toolchain support out of the box. Users need
to pass the TOOL_VERSIONS that include 3.8 toolchains or use the bzlmod APIs to add
them back. This means any hub pip.parse calls that target 3.8 will be ignored from
now on. (#2704)
{bzl:obj}python.single_version_override, like:
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.single_version_override(
python_version = "3.8.20",
sha256 = {
"aarch64-apple-darwin": "2ddfc04bdb3e240f30fb782fa1deec6323799d0e857e0b63fa299218658fd3d4",
"aarch64-unknown-linux-gnu": "9d8798f9e79e0fc0f36fcb95bfa28a1023407d51a8ea5944b4da711f1f75f1ed",
"x86_64-apple-darwin": "68d060cd373255d2ca5b8b3441363d5aa7cc45b0c11bbccf52b1717c2b5aa8bb",
"x86_64-pc-windows-msvc": "41b6709fec9c56419b7de1940d1f87fa62045aff81734480672dcb807eedc47e",
"x86_64-unknown-linux-gnu": "285e141c36f88b2e9357654c5f77d1f8fb29cc25132698fe35bb30d787f38e87",
},
urls = ["https://github.com/astral-sh/python-build-standalone/releases/download/20241002/cpython-{python_version}+20241002-{platform}-{build}.tar.gz"],
)
(toolchain) Remove all of the python 3.9 toolchain versions except for the 3.9.25.
This version has reached EOL and will no longer receive any security fixes, please update to
3.10 or above. (#2704)
(toolchain) ignore_root_user_error has now been flipped to be always enabled and
the chmod of the python toolchain directories have been removed. From now on rules_python
always adds the pyc files to the glob excludes and in order to avoid any problems when using
the toolchains in the repository phase, ensure that you pass -B to the python interpreter.
(#2016)
{#v1-8-0-changed}
pipstar has been enabled for all whl_library instances where the whl
is passed through a label or downloaded using the bazel downloader
(#2949).pipstar flag default has been flipped to be on by default.
It can be disabled through RULES_PYTHON_ENABLE_PIPSTAR=0 environment variable.
If you do need to disable it, please add a comment to
#2949.{#v1-8-0-fixed}
py_binary targets with invalid srcs. This includes files
that are not generated or regular files.
#3046sys.abiflags value of the
underlying runtime.python_headers target is now compatible with
layering_check.gazelle_python_manifest.test so that it accesses manifest files via runfile path handling rather than directly (#3397)..serve target is now compatible with Bazel's --symlink_prefix
flag (#3410).{#v1-8-0-added}
3.9.25 Python toolchain from 20251031 release.3.13.10, 3.14.1 Python toolchain from 20251202 release.3.13.11, 3.14.2, 3.15.0a2 Python toolchains from 20251209 release.pip.parse which platforms users care about. This is very useful to ensure
that when users do bazel query for their deps, they don't have to download all of the
dependencies for all of the available wheels. Torch wheels can be up of 1GB and it takes a lot
of time to download those, which is unnecessary if only the host platform builds are necessary
to be performed. This is mainly for backwards/forwards compatibility whilst rolling out
RULES_PYTHON_ENABLE_PIPSTAR=1 by default. Users of experimental_index_url that perform
cross-builds should add {obj}target_platforms to their pip.parse invocations, which will
become mandatory if any cross-builds are required from the next release.namespace_package_files added. It is a hint for
optimizing venv creation.{#v1-7-0}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.0-rc4")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "fd9317dfb618a822b65ed348e70d4fdc792a0a517d83e4b187a6e44114f00764",
strip_prefix = "rules_python-1.8.0-rc4",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc4/rules_python-1.8.0-rc4.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "fd9317dfb618a822b65ed348e70d4fdc792a0a517d83e4b187a6e44114f00764",
strip_prefix = "rules_python-1.8.0-rc4/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc4/rules_python-1.8.0-rc4.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/bazel-contrib/rules_python/compare/1.8.0-rc3...1.8.0-rc4
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.0-rc3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "ba4016696c347574847feac1ee808ba503d1396325ed25c93507b7cb4da4cb07",
strip_prefix = "rules_python-1.8.0-rc3",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc3/rules_python-1.8.0-rc3.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "ba4016696c347574847feac1ee808ba503d1396325ed25c93507b7cb4da4cb07",
strip_prefix = "rules_python-1.8.0-rc3/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc3/rules_python-1.8.0-rc3.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/bazel-contrib/rules_python/compare/1.8.0-rc2...1.8.0-rc3
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.0-rc2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "c707a3cad27f95adaf860df32f410e7ca27bb2d0d5a84507027e6286a8be3656",
strip_prefix = "rules_python-1.8.0-rc2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc2/rules_python-1.8.0-rc2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "c707a3cad27f95adaf860df32f410e7ca27bb2d0d5a84507027e6286a8be3656",
strip_prefix = "rules_python-1.8.0-rc2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc2/rules_python-1.8.0-rc2.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/bazel-contrib/rules_python/compare/1.8.0-rc1...1.8.0-rc2
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.0-rc1")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "a8d24cb0d53d8df4ef08741d70157f19481bb577a956b7de2cd445bc393e625b",
strip_prefix = "rules_python-1.8.0-rc1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc1/rules_python-1.8.0-rc1.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "a8d24cb0d53d8df4ef08741d70157f19481bb577a956b7de2cd445bc393e625b",
strip_prefix = "rules_python-1.8.0-rc1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc1/rules_python-1.8.0-rc1.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/bazel-contrib/rules_python/compare/1.8.0-rc0...1.8.0-rc1
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.8.0-rc0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "7cd5bab76de50f35e2050b6171f3ea8a341d80a562f7b47ef549f6c174cee0af",
strip_prefix = "rules_python-1.8.0-rc0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc0/rules_python-1.8.0-rc0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "7cd5bab76de50f35e2050b6171f3ea8a341d80a562f7b47ef549f6c174cee0af",
strip_prefix = "rules_python-1.8.0-rc0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.8.0-rc0/rules_python-1.8.0-rc0.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()
has_py3_only_sources in the PyInfo constructor by @oprypin in https://github.com/bazel-contrib/rules_python/pull/3315py_console_script_binary compatible with symbolic macros by @janwinkler1 in https://github.com/bazel-contrib/rules_python/pull/3195pip.default arguments in multi-platform example by @hartikainen in https://github.com/bazel-contrib/rules_python/pull/3358lock rule has no implicit test target by @martis42 in https://github.com/bazel-contrib/rules_python/pull/3411Full Changelog: https://github.com/bazel-contrib/rules_python/compare/1.6.0-rc0...1.8.0-rc0
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.7.0")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "f609f341d6e9090b981b3f45324d05a819fd7a5a56434f849c761971ce2c47da",
strip_prefix = "rules_python-1.7.0",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0/rules_python-1.7.0.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "f609f341d6e9090b981b3f45324d05a819fd7a5a56434f849c761971ce2c47da",
strip_prefix = "rules_python-1.7.0/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0/rules_python-1.7.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()
has_py3_only_sources in the PyInfo constructor by @oprypin in https://github.com/bazel-contrib/rules_python/pull/3315py_console_script_binary compatible with symbolic macros by @janwinkler1 in https://github.com/bazel-contrib/rules_python/pull/3195pip.default arguments in multi-platform example by @hartikainen in https://github.com/bazel-contrib/rules_python/pull/3358Full Changelog: https://github.com/bazel-contrib/rules_python/compare/1.6.3...1.7.0
{#v1-7-0-removed}
{#v1-7-0-changed}
0.1.5.--bootstrap_impl=system_python, PYTHONPATH is no
longer used to add import paths. The sys.path order has changed from
[app paths, stdlib, runtime site-packages] to [stdlib, app paths, runtime site-packages].--bootstrap_impl=system_python, the sys.path order has
changed from [app paths, stdlib, runtime site-packages] to [stdlib, app paths, runtime site-packages].experimental_index_url.
(#2937).py_runtime and PyRuntimeInfo reject Python 2 settings.
Setting py_runtime.python_version = "PY2" or non-None
PyRuntimeInfo.py2_runtime is an error.pipstar flag has been implemented for WORKSPACE and can be flipped to be enabled using RULES_PYTHON_ENABLE_PIPSTAR=1 environment variable. If you do, please
add a comment to
#2949 if you run into any
problems.
With this release we are deprecating {obj}pip.parse.experimental_target_platforms and
pip_repository.experimental_target_platforms. For users using WORKSPACE and
vendoring the requirements.bzl file, please re-vendor so that downstream is unaffected
when the APIs get removed. If you need to customize the way the dependencies get
evaluated, see our docs on customizing Requires-Dist resolution.bazel-skylib version
1.8.2{#v1-7-0-fixed}
PyInfo constructor was setting the wrong value for
has_py3_only_sources - this is now fixed.RUNFILES_DIR
environments, fixing issues where a py_binary calls another py_binary
(#3187).--bootstrap_impl=script now supports the -S interpreter
setting.--venvs_site_packages=yes no longer errors when packages with
overlapping files or directories are used together.
(#3204).--venvs_site_packages=yes works for packages that dynamically
link to shared libraries
(#3228).--venvs_site_packages=yes includes pth files at the root of the
site-packages folder
(#3339).//python/uv:lock.bzl%lock now works with a local platform
runtime.linux_riscv64 is added to the platforms list in _pip_repository_impl,
which fixes a build issue for tensorflow on riscv64.--py_linux_libc=musl and --py_freethreaded=yes now
activate them, respectively.
(#3262).py_console_script_binary is now compatible with symbolic macros
(#3195).{#v1-7-0-added}
--incompatible_compact_repo_mapping_manifest flag.--bootstrap_impl=system_python now supports the
{obj}main_module attribute.--bootstrap_impl=system_python now supports the
{any}RULES_PYTHON_ADDITIONAL_INTERPRETER_ARGS environment variable.py_binary, py_test, and py_wheel rules now have a
{obj}config_settings attribute to control build flags within the build graph.
Custom settings can be added using {obj}config.add_transition_setting in
MODULE.bazel files, or {obj}py_repositories(transition_settings=...) in
WORKSPACE files. See the
{ref}common-deps-with-multiple-pypi-versions guide on using common
dependencies with multiple PyPI versions` for an example.//python/cc:current_py_cc_headers_abi3. This allows Windows builds
a way to depend on headers without the potentially Python unstable ABI
objects from the regular {obj}//python/cc:current_py_cc_headers target
being included.
//python/cc:current_py_cc_headers_abi3,
{obj}py_cc_toolchain.headers_abi3, and {obj}PyCcToolchainInfo.headers_abi3.//python:features.bzl%features.headers_abi3 can be used to
feature-detect the presense of the above.experimental_index_url handling for
Windows ARM64 for Python 3.11 and later
(#2276).{#v1-6-3}
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.7.0-rc6")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "df04602e341fe0414d3774b5297c34cbcd8d9e0a525d28a87c25adae4588c11d",
strip_prefix = "rules_python-1.7.0-rc6",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0-rc6/rules_python-1.7.0-rc6.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "df04602e341fe0414d3774b5297c34cbcd8d9e0a525d28a87c25adae4588c11d",
strip_prefix = "rules_python-1.7.0-rc6/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0-rc6/rules_python-1.7.0-rc6.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/bazel-contrib/rules_python/compare/1.7.0-rc5...1.7.0-rc6
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.7.0-rc5")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "6b9185460d11d57a32139b103363fce39d81889206561ef582678273b74372ac",
strip_prefix = "rules_python-1.7.0-rc5",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0-rc5/rules_python-1.7.0-rc5.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "6b9185460d11d57a32139b103363fce39d81889206561ef582678273b74372ac",
strip_prefix = "rules_python-1.7.0-rc5/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0-rc5/rules_python-1.7.0-rc5.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/bazel-contrib/rules_python/compare/1.7.0-rc4...1.7.0-rc5
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.7.0-rc4")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "e7d0a548ce2302b3186f4b0d2d7c7d39d68dd62955468e9b160746af1aa234d1",
strip_prefix = "rules_python-1.7.0-rc4",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0-rc4/rules_python-1.7.0-rc4.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "e7d0a548ce2302b3186f4b0d2d7c7d39d68dd62955468e9b160746af1aa234d1",
strip_prefix = "rules_python-1.7.0-rc4/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0-rc4/rules_python-1.7.0-rc4.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/bazel-contrib/rules_python/compare/1.7.0-rc2...1.7.0-rc4
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.7.0-rc3")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "feb1d874c45fe21e15aecabb5c9925d77b3667f978ed1695b304b29afb1f3663",
strip_prefix = "rules_python-1.7.0-rc3",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0-rc3/rules_python-1.7.0-rc3.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "feb1d874c45fe21e15aecabb5c9925d77b3667f978ed1695b304b29afb1f3663",
strip_prefix = "rules_python-1.7.0-rc3/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0-rc3/rules_python-1.7.0-rc3.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/bazel-contrib/rules_python/compare/1.7.0-rc1...1.7.0-rc3
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html
For the user-facing changelog see here
Add to your MODULE.bazel file:
bazel_dep(name = "rules_python", version = "1.7.0-rc2")
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
python.toolchain(
python_version = "3.13",
)
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi",
python_version = "3.13",
requirements_lock = "//:requirements_lock.txt",
)
use_repo(pip, "pypi")
Paste this snippet into your WORKSPACE file:
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "8a4910fc15f813846dce138099d6cb37ec327a49abded2b07da93eaae142c31c",
strip_prefix = "rules_python-1.7.0-rc2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0-rc2/rules_python-1.7.0-rc2.tar.gz",
)
load("@rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
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 = "8a4910fc15f813846dce138099d6cb37ec327a49abded2b07da93eaae142c31c",
strip_prefix = "rules_python-1.7.0-rc2/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.7.0-rc2/rules_python-1.7.0-rc2.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/bazel-contrib/rules_python/compare/1.7.0-rc1...1.7.0-rc2
One column per quarter.