local_path_override(
module_name = "rules_python",
path = "..",
)
This repository is the home of the core Python rules -- py_library,
py_binary, py_test, and related symbols that provide the basis for Python
support in Bazel. It also contains package installation rules for integrating
with PyPI and other indices.
Documentation for rules_python is at https://rules-python.readthedocs.io and in the Bazel Build Encyclopedia.
Examples live in the examples directory.
The core rules are stable. Their implementation is subject to Bazel's backward compatibility policy. This repository aims to follow semantic versioning.
The Bazel community maintains this repository. Neither Google nor the Bazel team provides support for the code. However, this repository is part of the test suite used to vet new Bazel releases. See How to contribute page for information on our development workflow.
requirements.txt is how users have been defining dependencies for a long
time. We support this to support legacy usecases or package managers that we
don't support directly. Any additional information that we need will be
retrieved from the SimpleAPI during the bzlmod extension evaluation phase.
Then it will be written to the MODULE.bazel.lock file for future reuse. We
have plans to support uv.lock file directly. uv is recommended for
generating a fully locked requirements.txt file and we do provide a rule for
it.py_binary, py_test rules should scale to large monorepos and we work
hard to minimize the work done during analysis and build phase. What is more,
the space requirements for should be minimal, so we strive to use symlinks
rather than extracting wheels at build time. This means that for different
configurations of the same build, we are not extracting the wheel multiple
times thus scaling better over the time. From 2.0 onwards we are creating a
virtual env for each target by creating an actual minimal virtual environment
using symlinks. We plan on creating the traditional site-packages layout in
the future by default.rules_python and this has resulted in a few PEPs supported within
pure starlark - PEP440, PEP509.Common misconceptions:
rules_python has to keep backwards compatibility with google3. Whilst this
might have been true in the past, rules_python is an open source project and
any compatibility needs should come from the community - we have no
requirement to keep this compatibility and are allowed to make our decisions.
However, we do want to keep backwards compatibility as long as possible to not
upset users with never ending migrations.rules_python is not caching pip downloads. With 2.0, we use Bazel's
downloader by default and rely on bazel to provide the repository caching
mechanisms. This means that for simpler setups this should result in
transparent and scalable caching with the most recent bazel versions unless
there are issues in the bazel itself.For detailed documentation, see https://rules-python.readthedocs.io
See Bzlmod support for more details.
2.0.1 +12d2026-05-10 | |
2.0.0 +3d2026-04-28 | |
2.0.0-rc4 +3d2026-04-24 | |
2.0.0-rc3 +3d2026-04-20 | |
2.0.0-rc2 +1.5mo2026-04-17 | |
1.9.0 +8d2026-03-04 | |
1.9.0-rc1 +12h2026-02-23 | |
1.8.5 +2h2026-02-23 | |
1.9.0-rc0 +11d2026-02-23 | |
1.8.4 +14d2026-02-11 | |
1.8.3 +2d2026-01-28 | |
1.8.2 +4d2026-01-25 | |
1.8.1 +4d2026-01-21 | |
1.8.0 +1d2026-01-16 | |
1.8.0-rc4 +3d2026-01-15 | |
1.8.0-rc3 +16h2026-01-11 | |
1.8.0-rc2 +18d2026-01-11 | |
1.8.0-rc1 +1d2025-12-23 | |
1.8.0-rc0 +1.6mo2025-12-22 | |
1.7.0-rc4 +1.4mo2025-11-03 | |
1.6.3 +13d2025-09-21 | |
1.6.1 +4d2025-09-08 | |
1.6.0 +6d2025-09-03 | |
1.5.4 +3d2025-08-28 | |
1.6.0-rc0 +6d2025-08-24 | |
1.4.2 +6d2025-08-18 | |
1.5.3 +15h2025-08-11 | |
1.5.2 +1.2mo2025-08-11 | |
1.5.0 +4d2025-06-30 | |
1.5.0-rc4 +11h2025-06-26 | |
1.5.0-rc3 +5d2025-06-25 | |
1.5.0-rc2 +2d2025-06-20 | |
1.5.0-rc1 +5d2025-06-17 | |
1.5.0-rc0 +1.1mo2025-06-12 | |
1.4.1 +3d2025-05-08 | |
1.4.0 +6d2025-05-05 | |
1.4.0-rc4 +10h2025-04-29 | |
1.4.0-rc3 +4d2025-04-29 | |
1.4.0-rc2 +2d2025-04-24 | |
1.4.0-rc1 +1d2025-04-22 | |
1.4.0-rc0 +24d2025-04-21 | |
1.3.0 +6d2025-03-27 | |
1.3.0-rc1 +22d2025-03-21 | |
1.2.0 +4d2025-02-27 | |
1.2.0-rc1 +8d2025-02-22 | |
1.2.0-rc0 +28d2025-02-14 | |
1.1.0 +3d2025-01-17 | |
1.1.0-rc1 +3d2025-01-13 | |
1.1.0-rc0 +1.1mo2025-01-09 | |
1.0.0-rc2 +3d2024-11-29 | |
1.0.0-rc1 +3d2024-11-26 | |
1.0.0-rc0 +4d2024-11-22 | |
0.40.0 +2d2024-11-17 | |
0.39.0 +5d2024-11-14 | |
0.38.0 +10d2024-11-08 | |
0.37.2 +5d2024-10-28 | |
0.37.1 +4d2024-10-23 | |
0.37.0 +24d2024-10-18 | |
0.36.0 +1.3mo2024-09-24 | |
0.35.0 +1.2mo2024-08-16 | |
0.34.0 +20d2024-07-10 | |
0.33.2 +6d2024-06-19 | |
0.33.1 +21h2024-06-13 | |
0.33.0 +28d2024-06-12 | |
0.32.2 +21h2024-05-14 | |
0.32.1 +3.0mo2024-05-13 | |
0.31.0 +<1h2024-02-13 | |
0.30.0 +21d2024-02-13 | |
0.29.0 +1.6mo2024-01-22 | |
0.27.1 +15d2023-12-05 | |
0.27.0 +1.4mo2023-11-20 | |
0.26.0 +1.6mo2023-10-09 | |
0.25.0 +1.4mo2023-08-22 | |
0.24.0 +28d2023-07-11 | |
0.23.1 +11d2023-06-13 | |
0.22.0 +1.3mo2023-06-02 | |
0.21.02023-04-24 |