-
-
Notifications
You must be signed in to change notification settings - Fork 255
Commit b52f279
authored
Update dependency rules_python to v1.6.3 (#514)
> [!NOTE]
> Mend has cancelled [the proposed
renaming](https://redirect.github.com/renovatebot/renovate/discussions/37842)
of the Renovate GitHub app being renamed to `mend[bot]`.
>
> This notice will be removed on 2025-10-07.
<hr>
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [rules_python](https://redirect.github.com/bazel-contrib/rules_python)
| bazel_dep | minor | `1.1.0` -> `1.6.3` |
| [rules_python](https://redirect.github.com/bazelbuild/rules_python) |
http_archive | minor | `1.1.0` -> `1.6.3` |
---
### Release Notes
<details>
<summary>bazel-contrib/rules_python (rules_python)</summary>
###
[`v1.6.3`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#163---2025-09-21)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.6.1...1.6.3)
[1.6.3]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.6.3
{#v1-6-3-fixed}
##### Fixed
- (pypi) We now use the Minimal Version Selection (MVS) algorithm to
select
the right wheel when there are multiple wheels for the target platform
(e.g. `musllinux_1_1_x86_64` and `musllinux_1_2_x86_64`). If the user
wants to set the minimum version for the selection algorithm, use the
{attr}`pip.defaults.whl_platform_tags` attribute to configure that. If
`musllinux_*_x86_64` is specified, we will choose the lowest available
wheel version. Fixes
[#​3250](https://redirect.github.com/bazel-contrib/rules_python/issues/3250).
{#v1-6-0}
###
[`v1.6.1`](https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.6.1)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.6.0...1.6.1)
For more detailed setup instructions, see
<https://rules-python.readthedocs.io/en/latest/getting-started.html>
For the user-facing changelog see
[here](https://rules-python.readthedocs.io/en/latest/changelog.html#v1-6-1)
#### Using Bzlmod
Add to your `MODULE.bazel` file:
```starlark
bazel_dep(name = "rules_python", version = "1.6.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")
```
#### Using WORKSPACE
Paste this snippet into your `WORKSPACE` file:
```starlark
load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "f2e80f97f9c0b82e2489e61e725df1e6bdaf16c4dacf5e26b95668787164baff",
strip_prefix = "rules_python-1.6.1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.6.1/rules_python-1.6.1.tar.gz",
)
load("@​rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
```
##### Gazelle plugin
Paste this snippet into your `WORKSPACE` file:
```starlark
load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python_gazelle_plugin",
sha256 = "f2e80f97f9c0b82e2489e61e725df1e6bdaf16c4dacf5e26b95668787164baff",
strip_prefix = "rules_python-1.6.1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.6.1/rules_python-1.6.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.6.0...1.6.1>
###
[`v1.6.0`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#160---2025-08-23)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.5.4...1.6.0)
[1.6.0]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.6.0
{#v1-6-0-changed}
##### Changed
- (gazelle) update minimum gazelle version to 0.36.0 - may cause BUILD
file changes
- (gazelle) update minimum rules\_go version to 0.55.1
- (gazelle) remove custom go-tree-sitter module BUILD file
- (gazelle) For package mode, resolve dependencies when imports are
relative
to the package path. This is enabled via the
`# gazelle:python_experimental_allow_relative_imports` true directive
({gh-issue}`2203`).
- (gazelle) Types for exposed members of `python.ParserOutput` are now
all public.
- (gazelle) Removed the requirement for `__init__.py`, `__main__.py`, or
`__test__.py` files to be
present in a directory to generate a `BUILD.bazel` file.
- (toolchain) Updated the following toolchains to build [20250808] to
patch CVE-2025-47273:
- 3.9.23
- 3.10.18
- 3.11.13
- 3.12.11
- 3.14.0rc1
- (toolchain) Python 3.13 now references 3.13.6
- (gazelle) Switched back to smacker/go-tree-sitter, fixing
[#​2630](https://redirect.github.com/bazel-contrib/rules_python/issues/2630)
- (pypi) From now on the list of default platforms only includes
`linux_x86_64`, `linux_aarch64`,
`osx_x86_64`, `osx_aarch64` and `windows_x86_64`. If you are on other
platforms, you need to
use the `pip.default` to configure it yourself. If you are interested in
graduating the
platform, consider helping set us up CI for them and update the
documentation.
- (ci) We are now testing on Ubuntu 22.04 for RBE and non-RBE
configurations.
- (core) `#!/usr/bin/env bash` is now used as a shebang in the stage1
bootstrap template.
- (gazelle:docs) The Gazelle docs have been migrated from
{gh-path}`gazelle/README.md` to
{gh-path}`gazelle/docs` and are now available on the primary
documentation site
at
<https://rules-python.readthedocs.io/en/latest/gazelle/docs/index.html>
[20250808]:
https://redirect.github.com/astral-sh/python-build-standalone/releases/tag/20250808
{#v1-6-0-fixed}
##### Fixed
- (toolchains) `local_runtime_repo` now respects changes to the
`DEVELOPER_DIR` and `XCODE_VERSION`
repo env vars, fixing stale cache issues on macOS with system (i.e.
Xcode-supplied) Python
([#​3123](https://redirect.github.com/bazel-contrib/rules_python/issues/3123)).
- (pypi) Fixes an issue where builds using a `bazel vendor` vendor
directory
would fail if the constraints file contained environment markers. Fixes
[#​2996](https://redirect.github.com/bazel-contrib/rules_python/issues/2996).
- (pypi) Wheels with BUILD.bazel (or other special Bazel files) no
longer
result in missing files at runtime
([#​2782](https://redirect.github.com/bazel-contrib/rules_python/issues/2782)).
- (runfiles) The pypi runfiles package now includes `py.typed` to
indicate it
supports type checking
([#​2503](https://redirect.github.com/bazel-contrib/rules_python/issues/2503)).
- (pypi) The pipstar `defaults` configuration now supports any custom
platform
name.
- (pypi) The selection of the whls has been changed and should no longer
result
in ambiguous select matches ({gh-issue}`2759`) and should be much more
efficient
when running `bazel query` due to fewer repositories being included
({gh-issue}`2849`).
- Multi-line python imports (e.g. with escaped newlines) are now
correctly processed by Gazelle.
- (toolchains) `local_runtime_repo` works with multiarch Debian with
Python 3.8
([#​3099](https://redirect.github.com/bazel-contrib/rules_python/issues/3099)).
- (pypi) Expose pypi packages only common to all Python versions in
`all_requirements`
([#​2921](https://redirect.github.com/bazel-contrib/rules_python/issues/2921)).
- (repl) Normalize the path for the `REPL` stub to make it possible to
use the
default stub template from outside `rules_python` ({gh-issue}`3101`).
- (gazelle) Fixes gazelle adding sibling module dependencies to resolve
absolute imports (Python 2's behavior without `absolute_import`).
Previous
behavior can be restored using the directive
`# gazelle:python_resolve_sibling_imports true`
- (pypi) Show overridden index URL of packages when downloading metadata
have failed.
([#​2985](https://redirect.github.com/bazel-contrib/rules_python/issues/2985)).
- (toolchains) use "command -v" to find interpreter in `$PATH`
([#​3150](https://redirect.github.com/bazel-contrib/rules_python/pull/3150)).
- (pypi) `bazel vendor` now works in `bzlmod` ({gh-issue}`3079`).
- (toolchains) `local_runtime_repo` now works on Windows
([#​3055](https://redirect.github.com/bazel-contrib/rules_python/issues/3055)).
- (toolchains) `local_runtime_repo` supports more types of Python
installations (Mac frameworks, missing dynamic libraries, and other
esoteric cases, see
[#​3148](https://redirect.github.com/bazel-contrib/rules_python/pull/3148)
for details).
- (pypi) Support `requirements.txt` files that use different versions of
the same
package targeting different target platforms.
([#​2797](https://redirect.github.com/bazel-contrib/rules_python/issues/2797)).
- (py\_wheel) Add directories in deterministic order.
{#v1-6-0-added}
##### Added
- (repl) Default stub now has tab completion, where `readline` support
is available,
see
([#​3114](https://redirect.github.com/bazel-contrib/rules_python/pull/3114)).
([#​3114](https://redirect.github.com/bazel-contrib/rules_python/pull/3114)).
- (pypi) To configure the environment for `requirements.txt` evaluation,
use the newly added
developer preview of the `pip.default` tag class. Only `rules_python`
and root modules can use
this feature. You can also configure custom `config_settings` using
`pip.default`. It
can also be used to set the global `netrc` or `auth_patterns` variables.
- (pypi) PyPI dependencies now expose an `:extracted_whl_files`
filegroup target
of all the files extracted from the wheel. This can be used in lieu of
{obj}`whl_filegroup` to avoid copying/extracting wheel multiple times to
get a subset of their files.
- (gazelle) New directive `gazelle:python_generate_pyi_deps`; when
`true`,
dependencies added to satisfy type-only imports (`if TYPE_CHECKING`) and
type
stub packages are added to `pyi_deps` instead of `deps`.
- (toolchain) Add toolchains for aarch64 windows for
- 3.11.13
- 3.12.11
- 3.13.6
- 3.14.0rc1
- (gazelle): New annotation `gazelle:include_pytest_conftest`. When not
set (the
default) or `true`, gazelle will inject any `conftest.py` file found in
the same
directory as a {obj}`py_test` target to that {obj}`py_test` target's
`deps`.
This behavior is unchanged from previous versions. When `false`, the
`:conftest`
dep is not added to the {obj}`py_test` target.
- (gazelle) New directive `gazelle:python_generate_proto`; when `true`,
Gazelle generates `py_proto_library` rules for `proto_library`. `false`
by default.
- Note: Users must manually configure their Gazelle target to support
the
proto language.
- (gazelle) New directive `gazelle:python_proto_naming_convention`;
controls
naming of `py_proto_library` rules.
{#v1-6-0-removed}
##### Removed
- Nothing removed.
{#v1-5-4}
###
[`v1.5.4`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#154---2025-08-27)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.5.3...1.5.4)
[1.5.4]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.5.4
{#v1-5-4-fixed}
##### Fixed
- (toolchains) `local_runtime_repo` now checks if the include directory
exists
before attempting to watch it, fixing issues on macOS with system Python
([#​3043](https://redirect.github.com/bazel-contrib/rules_python/issues/3043)).
{#v1-5-3}
###
[`v1.5.3`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#153---2025-08-11)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.5.2...1.5.3)
[1.5.3]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.5.3
##### Fixed
- (toolchains) `local_runtime_repo` now checks if the include directory
exists
before attempting to watch it, fixing issues on macOS with system Python
([#​3043](https://redirect.github.com/bazel-contrib/rules_python/issues/3043)).
{#v1-5-2}
###
[`v1.5.2`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#152---2025-08-11)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.5.1...1.5.2)
[1.5.2]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.5.2
{#v1-5-2-changed}
##### Changed
- (deps) (bzlmod) Upgraded to `bazel-skylib` version
[1.8.1](https://redirect.github.com/bazelbuild/bazel-skylib/releases/tag/1.8.1)
to remove deprecation warnings.
{#v1-5-2-fixed}
##### Fixed
- (pypi) Correctly pull `sdist` distributions using `pip`
([#​3131](https://redirect.github.com/bazel-contrib/rules_python/pull/3131)).
- (core) builds work again on `7.x` `WORKSPACE` configurations
([#​3119](https://redirect.github.com/bazel-contrib/rules_python/issues/3119)).
{#v1-5-1}
###
[`v1.5.1`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#151---2025-07-06)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.5.0...1.5.1)
[1.5.1]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.5.1
{#v1-5-1-fixed}
##### Fixed
- (pypi) Namespace packages work by default (pkgutil shims are generated
by default again)
([#​3038](https://redirect.github.com/bazel-contrib/rules_python/issues/3038)).
{#v1-5-0}
###
[`v1.5.0`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#150---2025-06-11)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.4.2...1.5.0)
[1.5.0]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.5.0
{#v1-5-0-changed}
##### Changed
- (toolchain) Bundled toolchain version updates:
- 3.9 now references 3.9.23
- 3.10 now references 3.10.18
- 3.11 now references 3.11.13
- 3.12 now references 3.12.11
- 3.13 now references 3.13.4
- (rules) On Windows, {obj}`--bootstrap_impl=system_python` is forced.
This
allows setting `--bootstrap_impl=script` in bazelrc for mixed-platform
environments.
- (rules) {obj}`compile_pip_requirements` now generates a `.test`
target. The
`_test` target is deprecated and will be removed in the next major
release.
([#​2794](https://redirect.github.com/bazel-contrib/rules_python/issues/2794)
- (py\_wheel) py\_wheel always creates zip64-capable wheel zips
- (providers) (experimental) {obj}`PyInfo.venv_symlinks` replaces
`PyInfo.site_packages_symlinks`
- (deps) Updated setuptools to 78.1.1 to patch CVE-2025-47273. This
effectively makes
Python 3.9 the minimum supported version for using `pip_parse`.
{#v1-5-0-fixed}
##### Fixed
- (rules) PyInfo provider is now advertised by py\_test, py\_binary, and
py\_library;
this allows aspects using required\_providers to function correctly.
([#​2506](https://redirect.github.com/bazel-contrib/rules_python/issues/2506)).
- Fixes when using {obj}`--bootstrap_impl=script`:
- `compile_pip_requirements` now works with it
- The `sys._base_executable` value will reflect the underlying
interpreter,
not venv interpreter.
- The {obj}`//python/runtime_env_toolchains:all` toolchain now works
with it.
- (rules) Better handle flakey platform.win32\_ver() calls by calling
them
multiple times.
- (tools/wheelmaker.py) Extras are now preserved in Requires-Dist
metadata when using requires\_file
to specify the requirements.
- (pypi) Use bazel downloader for direct URL references and correctly
detect the filenames from
various URL formats - URL encoded version strings get correctly
resolved, sha256 value can be
also retrieved from the URL as opposed to only the `--hash` parameter.
Fixes
[#​2363](https://redirect.github.com/bazel-contrib/rules_python/issues/2363).
- (pypi) `whl_library` now infers file names from its `urls` attribute
correctly.
- (pypi) When running under `bazel test`, be sure that temporary
`requirements` file
remains writable.
- (py\_test, py\_binary) Allow external files to be used for main
- (pypi) Correctly aggregate the sources when the hashes specified in
the lockfile differ
by platform even though the same version is used. Fixes
[#​2648](https://redirect.github.com/bazel-contrib/rules_python/issues/2648).
- (pypi) `compile_pip_requirements` test rule works behind the proxy
- (toolchains) The hermetic toolchains now correctly statically
advertise the
`releaselevel` and `serial` for pre-release hermetic toolchains
({gh-issue}`2837`).
{#v1-5-0-added}
##### Added
- Repo utilities `execute_unchecked`, `execute_checked`, and
`execute_checked_stdout` now
support `log_stdout` and `log_stderr` keyword arg booleans. When these
are `True`
(the default), the subprocess's stdout/stderr will be logged.
- (toolchains) Local toolchains can be activated with custom flags. See
\[Conditionally using local toolchains] docs for how to configure.
- (pypi) Starlark-based evaluation of environment markers
(requirements.txt conditionals)
available (not enabled by default) for improved multi-platform build
support.
Set the `RULES_PYTHON_ENABLE_PIPSTAR=1` environment variable to enable
it.
- (utils) Add a way to run a REPL for any `rules_python` target that
returns
a `PyInfo` provider.
- (uv) Handle `.netrc` and `auth_patterns` auth when downloading `uv`.
Work towards
[#​1975](https://redirect.github.com/bazel-contrib/rules_python/issues/1975).
- (toolchains) Arbitrary python-build-standalone runtimes can be
registered
and activated with custom flags. See the \[Registering custom runtimes]
docs and {obj}`single_version_platform_override()` API docs for more
information.
- (rules) Added support for a using constraints files with
`compile_pip_requirements`.
Useful when an intermediate dependency needs to be upgraded to pull in
security patches.
- (toolchains): 3.14.0b2 has been added as a preview.
{#v1-5-0-removed}
##### Removed
- Nothing removed.
{#v1-4-2}
###
[`v1.4.2`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#142---2025-08-13)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.4.1...1.4.2)
[1.4.2]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.4.2
##### Fixed
- (toolchains) `local_runtime_repo` now checks if the include directory
exists
before attempting to watch it, fixing issues on macOS with system Python
([#​3043](https://redirect.github.com/bazel-contrib/rules_python/issues/3043)).
{#v1-4-1}
###
[`v1.4.1`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#141---2025-05-08)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.4.0...1.4.1)
[1.4.1]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.4.1
{#v1-4-1-fixed}
##### Fixed
- (pypi) Fix a typo not allowing users to benefit from using the
downloader when the hashes in the
requirements file are not present. Fixes
[#​2863](https://redirect.github.com/bazel-contrib/rules_python/issues/2863).
{#v1-4-0}
###
[`v1.4.0`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#140---2025-04-19)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.3.0...1.4.0)
[1.4.0]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.4.0
{#v1-4-0-changed}
##### Changed
- (toolchain) The `exec` configuration toolchain now has the forwarded
`exec_interpreter` now also forwards the `ToolchainInfo` provider. This
is
for increased compatibility with the `RBE` setups where access to the
`exec`
configuration interpreter is needed.
- (toolchains) Use the latest astral-sh toolchain release [20250317] for
Python versions:
- 3.9.21
- 3.10.16
- 3.11.11
- 3.12.9
- 3.13.2
- (pypi) Use `xcrun xcodebuild --showsdks` to find XCode root.
- (toolchains) Remove all but `3.8.20` versions of the Python `3.8`
interpreter who has
reached EOL. If users still need other versions of the `3.8`
interpreter, please supply
the URLs manually {bzl:obj}`python.toolchain` or
{bzl:obj}`python_register_toolchains` calls.
- (toolchains) Previously
[#​2636](https://redirect.github.com/bazel-contrib/rules_python/pull/2636)
changed the semantics of `ignore_root_user_error` from "ignore" to
"warning". This is now
flipped back to ignoring the issue, and will only emit a warning when
the attribute is set
`False`.
- (pypi) The PyPI extension will no longer write the lock file entries
as the
extension has been marked reproducible.
Fixes
[#​2434](https://redirect.github.com/bazel-contrib/rules_python/issues/2434).
- (gazelle) Lazily load and parse manifest files when running Gazelle.
This ensures no
manifest files are loaded when Gazelle is run over a set of non-python
directories
[PR
#​2746](https://redirect.github.com/bazel-contrib/rules_python/pull/2746).
- (rules) {attr}`py_binary.srcs` and {attr}`py_test.srcs` is no longer
mandatory when
`main_module` is specified (for `--bootstrap_impl=script`)
[20250317]:
https://redirect.github.com/astral-sh/python-build-standalone/releases/tag/20250317
{#v1-4-0-fixed}
##### Fixed
- (pypi) Platform specific extras are now correctly handled when using
universal lock files with environment markers. Fixes
[#​2690](https://redirect.github.com/bazel-contrib/rules_python/pull/2690).
- (runfiles) ({obj}`--bootstrap_impl=script`) Follow symlinks when
searching for runfiles.
- (toolchains) Do not try to run `chmod` when downloading non-windows
hermetic toolchain
repositories on Windows. Fixes
[#​2660](https://redirect.github.com/bazel-contrib/rules_python/issues/2660).
- (logging) Allow repo rule logging level to be set to `FAIL` via the
`RULES_PYTHON_REPO_DEBUG_VERBOSITY` environment variable.
- (toolchains) The toolchain matching is has been fixed when writing
transitions transitioning on the `python_version` flag.
Fixes
[#​2685](https://redirect.github.com/bazel-contrib/rules_python/issues/2685).
- (toolchains) Run the check on the Python interpreter in isolated mode,
to ensure it's not affected by userland environment variables, such as
`PYTHONPATH`.
- (toolchains) Ensure temporary `.pyc` and `.pyo` files are also
excluded from the interpreters repository files.
- (pypi) Run interpreter version call in isolated mode, to ensure it's
not affected by userland environment variables, such as `PYTHONPATH`.
- (packaging) An empty `requires_file` is treated as if it were omitted,
resulting in a valid `METADATA` file.
- (rules) py\_wheel and sphinxdocs rules now propagate
`target_compatible_with` to all targets they create.
[PR
#​2788](https://redirect.github.com/bazel-contrib/rules_python/pull/2788).
- (pypi) Correctly handle `METADATA` entries when `python_full_version`
is used in
the environment marker.
Fixes
[#​2319](https://redirect.github.com/bazel-contrib/rules_python/issues/2319).
- (pypi) Correctly handle `python_version` parameter and transition the
requirement
locking to the right interpreter version when using
{obj}`compile_pip_requirements` rule.
See
[#​2819](https://redirect.github.com/bazel-contrib/rules_python/pull/2819).
{#v1-4-0-added}
##### Added
- (pypi) From now on `sha256` values in the `requirements.txt` is no
longer
mandatory when enabling {attr}`pip.parse.experimental_index_url`
feature.
This means that `rules_python` will attempt to fetch metadata for all
packages through SimpleAPI unless they are pulled through direct URL
references. Fixes
[#​2023](https://redirect.github.com/bazel-contrib/rules_python/issues/2023).
In case you see issues with `rules_python` being too eager to fetch the
SimpleAPI
metadata, you can use the newly added {attr}`pip.parse.simpleapi_skip`
to skip metadata fetching for those packages.
- (uv) A {obj}`lock` rule that is the replacement for the
{obj}`compile_pip_requirements`. This may still have rough corners
so please report issues with it in the
[#​1975](https://redirect.github.com/bazel-contrib/rules_python/issues/1975).
Main highlights - the locking can be done within a build action or
outside
it, there is no more automatic `test` target (but it can be added on the
user
side by using `native_test`). For customizing the `uv` version that is
used,
please check the {obj}`uv.configure` tag class.
- Add support for riscv64 linux platform.
- (toolchains) Add python 3.13.2 and 3.12.9 toolchains
- (providers) (experimental) `PyInfo.site_packages_symlinks` field added
to
allow specifying links to create within the venv site packages (only
applicable with {obj}`--bootstrap_impl=script`)
([#​2156](https://redirect.github.com/bazelbuild/rules_python/issues/2156)).
- (toolchains) Local Python installs can be used to create a toolchain
equivalent to the standard toolchains. See \[Local toolchains] docs for
how to
configure them.
- (toolchains) Expose `$(PYTHON2_ROOTPATH)` and `$(PYTHON3_ROOTPATH)`
which are runfiles
locations equivalents of `$(PYTHON2)` and \`$(PYTHON3) respectively.
{#v1-4-0-removed}
##### Removed
- Nothing removed.
{#v1-3-0}
###
[`v1.3.0`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#130---2025-03-27)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.2.0...1.3.0)
[1.3.0]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.3.0
{#v1-3-0-changed}
##### Changed
- (deps) platforms 0.0.4 -> 0.0.11
- (py\_wheel) Package `py_library.pyi_srcs` (`.pyi` files) in the wheel.
- (py\_package) Package `py_library.pyi_srcs` (`.pyi` files) in
`py_package`.
- (gazelle) The generated manifest file (default: `gazelle_python.yaml`)
will now include the
YAML document start `---` line. Implemented in
[#​2656](https://redirect.github.com/bazel-contrib/rules_python/pull/2656).
{#v1-3-0-fixed}
##### Fixed
- (pypi) The `ppc64le` is now pointing to the right target in the
`platforms` package.
- (gazelle) No longer incorrectly merge `py_binary` targets during
partial updates in
`file` generation mode. Fixed in
[#​2619](https://redirect.github.com/bazel-contrib/rules_python/pull/2619).
- (bzlmod) Running as root is no longer an error.
`ignore_root_user_error=True`
is now the default. Note that running as root may still cause spurious
Bazel cache invalidation
([#​1169](https://redirect.github.com/bazel-contrib/rules_python/issues/1169)).
- (gazelle) Don't collapse depsets to a list or into args when
generating the modules mapping file.
Support spilling modules mapping args into a params file.
- (coverage) Fix missing files in the coverage report if they have no
tests.
- (pypi) From now on `python` invocations in repository and module
extension
evaluation contexts will invoke Python interpreter with `-B` to avoid
creating `.pyc` files.
- (deps) doublestar 4.7.1 (required for recent Gazelle versions)
{#v1-3-0-added}
##### Added
- (python) {obj}`python.defaults` has been added to allow users to
set the default python version in the root module by reading the
default version number from a file or an environment variable.
- {obj}`//python/bin:python`: convenience target for directly running an
interpreter. {obj}`--//python/bin:python_src` can be used to specify a
binary whose interpreter to use.
- (uv) Now the extension can be fully configured via `bzlmod` APIs
without the
need to patch `rules_python`. The documentation has been added to
`rules_python`
docs but usage of the extension may result in your setup breaking
without any
notice. What is more, the URLs and SHA256 values will be retrieved from
the
GitHub releases page metadata published by the `uv` project.
- (pypi) An extra argument to add the interpreter lib dir to `LDFLAGS`
when
building wheels from `sdist`.
- (pypi) Direct HTTP urls for wheels and sdists are now supported when
using
{obj}`experimental_index_url` (bazel downloader).
Partially fixes
[#​2363](https://redirect.github.com/bazel-contrib/rules_python/issues/2363).
- (rules) APIs for creating custom rules based on the core py\_binary,
py\_test,
and py\_library rules
([#​1647](https://redirect.github.com/bazel-contrib/rules_python/issues/1647))
- (rules) Added env-var to allow additional interpreter args for stage1
bootstrap.
See {any}`RULES_PYTHON_ADDITIONAL_INTERPRETER_ARGS` environment
variable.
Only applicable for {obj}`--bootstrap_impl=script`.
- (rules) Added {obj}`interpreter_args` attribute to `py_binary` and
`py_test`,
which allows pass arguments to the interpreter before the regular args.
- (rules) Added {obj}`main_module` attribute to `py_binary` and
`py_test`,
which allows specifying a module name to run (i.e. `python -m
<module>`).
{#v1-3-0-removed}
##### Removed
- Nothing removed.
{#v1-2-0}
###
[`v1.2.0`](https://redirect.github.com/bazel-contrib/rules_python/blob/HEAD/CHANGELOG.md#120---2025-02-21)
[Compare
Source](https://redirect.github.com/bazel-contrib/rules_python/compare/1.1.0...1.2.0)
[1.2.0]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.2.0
{#v1-2-0-changed}
##### Changed
- (rules) `py_proto_library` is deprecated in favour of the
implementation in <https://github.com/protocolbuffers/protobuf>. It will
be
removed in the future release.
- (pypi) {obj}`pip.override` will now be ignored instead of raising an
error,
fixes
[#​2550](https://redirect.github.com/bazel-contrib/rules_python/issues/2550).
- (rules) deprecation warnings for deprecated symbols have been turned
off by
default for now and can be enabled with
`RULES_PYTHON_DEPRECATION_WARNINGS`
env var.
- (pypi) Downgraded versions of packages: `pip` from `24.3.2` to
`24.0.0` and
`packaging` from `24.2` to `24.0`.
{#v1-2-0-fixed}
##### Fixed
- (rules) `python_zip_file` output with `--bootstrap_impl=script` works
again
([#​2596](https://redirect.github.com/bazel-contrib/rules_python/issues/2596)).
- (docs) Using `python_version` attribute for specifying python versions
introduced in `v1.1.0`
- (gazelle) Providing multiple input requirements files to
`gazelle_python_manifest` now works correctly.
- (pypi) Handle trailing slashes in pip index URLs in environment
variables,
fixes
[#​2554](https://redirect.github.com/bazel-contrib/rules_python/issues/2554).
- (runfiles) Runfile manifest and repository mapping files are now
interpreted
as UTF-8 on all platforms.
- (coverage) Coverage with `--bootstrap_impl=script` is fixed
([#​2572](https://redirect.github.com/bazel-contrib/rules_python/issues/2572)).
- (pypi) Non deterministic behaviour in requirement file usage has been
fixed
by reverting
[#​2514](https://redirect.github.com/bazel-contrib/rules_python/pull/2514).
The related issue is
[#​908](https://redirect.github.com/bazel-contrib/rules_python/issue/908).
- (sphinxdocs) Do not crash when `tag_class` does not have a populated
`doc` value.
Fixes
([#​2579](https://redirect.github.com/bazel-contrib/rules_python/issues/2579)).
- (binaries/tests) Fix packaging when using `--bootstrap_impl=script`:
set
{obj}`--venvs_use_declare_symlink=no` to have it not create symlinks at
build time (they will be created at runtime instead).
(Fixes
[#​2489](https://redirect.github.com/bazel-contrib/rules_python/issues/2489))
{#v1-2-0-added}
##### Added
- Nothing added.
{#v1-2-0-removed}
##### Removed
- Nothing removed.
{#v1-1-0}
</details>
<details>
<summary>bazelbuild/rules_python (rules_python)</summary>
###
[`v1.6.3`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#163---2025-09-21)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.6.1...1.6.3)
[1.6.3]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.6.3
{#v1-6-3-fixed}
##### Fixed
- (pypi) We now use the Minimal Version Selection (MVS) algorithm to
select
the right wheel when there are multiple wheels for the target platform
(e.g. `musllinux_1_1_x86_64` and `musllinux_1_2_x86_64`). If the user
wants to set the minimum version for the selection algorithm, use the
{attr}`pip.defaults.whl_platform_tags` attribute to configure that. If
`musllinux_*_x86_64` is specified, we will choose the lowest available
wheel version. Fixes
[#​3250](https://redirect.github.com/bazel-contrib/rules_python/issues/3250).
{#v1-6-0}
###
[`v1.6.1`](https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.6.1)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.6.0...1.6.1)
For more detailed setup instructions, see
<https://rules-python.readthedocs.io/en/latest/getting-started.html>
For the user-facing changelog see
[here](https://rules-python.readthedocs.io/en/latest/changelog.html#v1-6-1)
#### Using Bzlmod
Add to your `MODULE.bazel` file:
```starlark
bazel_dep(name = "rules_python", version = "1.6.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")
```
#### Using WORKSPACE
Paste this snippet into your `WORKSPACE` file:
```starlark
load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python",
sha256 = "f2e80f97f9c0b82e2489e61e725df1e6bdaf16c4dacf5e26b95668787164baff",
strip_prefix = "rules_python-1.6.1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.6.1/rules_python-1.6.1.tar.gz",
)
load("@​rules_python//python:repositories.bzl", "py_repositories")
py_repositories()
```
##### Gazelle plugin
Paste this snippet into your `WORKSPACE` file:
```starlark
load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_python_gazelle_plugin",
sha256 = "f2e80f97f9c0b82e2489e61e725df1e6bdaf16c4dacf5e26b95668787164baff",
strip_prefix = "rules_python-1.6.1/gazelle",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.6.1/rules_python-1.6.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.6.0...1.6.1>
###
[`v1.6.0`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#160---2025-08-23)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.5.4...1.6.0)
[1.6.0]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.6.0
{#v1-6-0-changed}
##### Changed
- (gazelle) update minimum gazelle version to 0.36.0 - may cause BUILD
file changes
- (gazelle) update minimum rules\_go version to 0.55.1
- (gazelle) remove custom go-tree-sitter module BUILD file
- (gazelle) For package mode, resolve dependencies when imports are
relative
to the package path. This is enabled via the
`# gazelle:python_experimental_allow_relative_imports` true directive
({gh-issue}`2203`).
- (gazelle) Types for exposed members of `python.ParserOutput` are now
all public.
- (gazelle) Removed the requirement for `__init__.py`, `__main__.py`, or
`__test__.py` files to be
present in a directory to generate a `BUILD.bazel` file.
- (toolchain) Updated the following toolchains to build [20250808] to
patch CVE-2025-47273:
- 3.9.23
- 3.10.18
- 3.11.13
- 3.12.11
- 3.14.0rc1
- (toolchain) Python 3.13 now references 3.13.6
- (gazelle) Switched back to smacker/go-tree-sitter, fixing
[#​2630](https://redirect.github.com/bazel-contrib/rules_python/issues/2630)
- (pypi) From now on the list of default platforms only includes
`linux_x86_64`, `linux_aarch64`,
`osx_x86_64`, `osx_aarch64` and `windows_x86_64`. If you are on other
platforms, you need to
use the `pip.default` to configure it yourself. If you are interested in
graduating the
platform, consider helping set us up CI for them and update the
documentation.
- (ci) We are now testing on Ubuntu 22.04 for RBE and non-RBE
configurations.
- (core) `#!/usr/bin/env bash` is now used as a shebang in the stage1
bootstrap template.
- (gazelle:docs) The Gazelle docs have been migrated from
{gh-path}`gazelle/README.md` to
{gh-path}`gazelle/docs` and are now available on the primary
documentation site
at
<https://rules-python.readthedocs.io/en/latest/gazelle/docs/index.html>
[20250808]:
https://redirect.github.com/astral-sh/python-build-standalone/releases/tag/20250808
{#v1-6-0-fixed}
##### Fixed
- (toolchains) `local_runtime_repo` now respects changes to the
`DEVELOPER_DIR` and `XCODE_VERSION`
repo env vars, fixing stale cache issues on macOS with system (i.e.
Xcode-supplied) Python
([#​3123](https://redirect.github.com/bazel-contrib/rules_python/issues/3123)).
- (pypi) Fixes an issue where builds using a `bazel vendor` vendor
directory
would fail if the constraints file contained environment markers. Fixes
[#​2996](https://redirect.github.com/bazel-contrib/rules_python/issues/2996).
- (pypi) Wheels with BUILD.bazel (or other special Bazel files) no
longer
result in missing files at runtime
([#​2782](https://redirect.github.com/bazel-contrib/rules_python/issues/2782)).
- (runfiles) The pypi runfiles package now includes `py.typed` to
indicate it
supports type checking
([#​2503](https://redirect.github.com/bazel-contrib/rules_python/issues/2503)).
- (pypi) The pipstar `defaults` configuration now supports any custom
platform
name.
- (pypi) The selection of the whls has been changed and should no longer
result
in ambiguous select matches ({gh-issue}`2759`) and should be much more
efficient
when running `bazel query` due to fewer repositories being included
({gh-issue}`2849`).
- Multi-line python imports (e.g. with escaped newlines) are now
correctly processed by Gazelle.
- (toolchains) `local_runtime_repo` works with multiarch Debian with
Python 3.8
([#​3099](https://redirect.github.com/bazel-contrib/rules_python/issues/3099)).
- (pypi) Expose pypi packages only common to all Python versions in
`all_requirements`
([#​2921](https://redirect.github.com/bazel-contrib/rules_python/issues/2921)).
- (repl) Normalize the path for the `REPL` stub to make it possible to
use the
default stub template from outside `rules_python` ({gh-issue}`3101`).
- (gazelle) Fixes gazelle adding sibling module dependencies to resolve
absolute imports (Python 2's behavior without `absolute_import`).
Previous
behavior can be restored using the directive
`# gazelle:python_resolve_sibling_imports true`
- (pypi) Show overridden index URL of packages when downloading metadata
have failed.
([#​2985](https://redirect.github.com/bazel-contrib/rules_python/issues/2985)).
- (toolchains) use "command -v" to find interpreter in `$PATH`
([#​3150](https://redirect.github.com/bazel-contrib/rules_python/pull/3150)).
- (pypi) `bazel vendor` now works in `bzlmod` ({gh-issue}`3079`).
- (toolchains) `local_runtime_repo` now works on Windows
([#​3055](https://redirect.github.com/bazel-contrib/rules_python/issues/3055)).
- (toolchains) `local_runtime_repo` supports more types of Python
installations (Mac frameworks, missing dynamic libraries, and other
esoteric cases, see
[#​3148](https://redirect.github.com/bazel-contrib/rules_python/pull/3148)
for details).
- (pypi) Support `requirements.txt` files that use different versions of
the same
package targeting different target platforms.
([#​2797](https://redirect.github.com/bazel-contrib/rules_python/issues/2797)).
- (py\_wheel) Add directories in deterministic order.
{#v1-6-0-added}
##### Added
- (repl) Default stub now has tab completion, where `readline` support
is available,
see
([#​3114](https://redirect.github.com/bazel-contrib/rules_python/pull/3114)).
([#​3114](https://redirect.github.com/bazel-contrib/rules_python/pull/3114)).
- (pypi) To configure the environment for `requirements.txt` evaluation,
use the newly added
developer preview of the `pip.default` tag class. Only `rules_python`
and root modules can use
this feature. You can also configure custom `config_settings` using
`pip.default`. It
can also be used to set the global `netrc` or `auth_patterns` variables.
- (pypi) PyPI dependencies now expose an `:extracted_whl_files`
filegroup target
of all the files extracted from the wheel. This can be used in lieu of
{obj}`whl_filegroup` to avoid copying/extracting wheel multiple times to
get a subset of their files.
- (gazelle) New directive `gazelle:python_generate_pyi_deps`; when
`true`,
dependencies added to satisfy type-only imports (`if TYPE_CHECKING`) and
type
stub packages are added to `pyi_deps` instead of `deps`.
- (toolchain) Add toolchains for aarch64 windows for
- 3.11.13
- 3.12.11
- 3.13.6
- 3.14.0rc1
- (gazelle): New annotation `gazelle:include_pytest_conftest`. When not
set (the
default) or `true`, gazelle will inject any `conftest.py` file found in
the same
directory as a {obj}`py_test` target to that {obj}`py_test` target's
`deps`.
This behavior is unchanged from previous versions. When `false`, the
`:conftest`
dep is not added to the {obj}`py_test` target.
- (gazelle) New directive `gazelle:python_generate_proto`; when `true`,
Gazelle generates `py_proto_library` rules for `proto_library`. `false`
by default.
- Note: Users must manually configure their Gazelle target to support
the
proto language.
- (gazelle) New directive `gazelle:python_proto_naming_convention`;
controls
naming of `py_proto_library` rules.
{#v1-6-0-removed}
##### Removed
- Nothing removed.
{#v1-5-4}
###
[`v1.5.4`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#154---2025-08-27)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.5.3...1.5.4)
[1.5.4]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.5.4
{#v1-5-4-fixed}
##### Fixed
- (toolchains) `local_runtime_repo` now checks if the include directory
exists
before attempting to watch it, fixing issues on macOS with system Python
([#​3043](https://redirect.github.com/bazel-contrib/rules_python/issues/3043)).
{#v1-5-3}
###
[`v1.5.3`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#153---2025-08-11)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.5.2...1.5.3)
[1.5.3]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.5.3
##### Fixed
- (toolchains) `local_runtime_repo` now checks if the include directory
exists
before attempting to watch it, fixing issues on macOS with system Python
([#​3043](https://redirect.github.com/bazel-contrib/rules_python/issues/3043)).
{#v1-5-2}
###
[`v1.5.2`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#152---2025-08-11)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.5.1...1.5.2)
[1.5.2]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.5.2
{#v1-5-2-changed}
##### Changed
- (deps) (bzlmod) Upgraded to `bazel-skylib` version
[1.8.1](https://redirect.github.com/bazelbuild/bazel-skylib/releases/tag/1.8.1)
to remove deprecation warnings.
{#v1-5-2-fixed}
##### Fixed
- (pypi) Correctly pull `sdist` distributions using `pip`
([#​3131](https://redirect.github.com/bazel-contrib/rules_python/pull/3131)).
- (core) builds work again on `7.x` `WORKSPACE` configurations
([#​3119](https://redirect.github.com/bazel-contrib/rules_python/issues/3119)).
{#v1-5-1}
###
[`v1.5.1`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#151---2025-07-06)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.5.0...1.5.1)
[1.5.1]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.5.1
{#v1-5-1-fixed}
##### Fixed
- (pypi) Namespace packages work by default (pkgutil shims are generated
by default again)
([#​3038](https://redirect.github.com/bazel-contrib/rules_python/issues/3038)).
{#v1-5-0}
###
[`v1.5.0`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#150---2025-06-11)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.4.2...1.5.0)
[1.5.0]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.5.0
{#v1-5-0-changed}
##### Changed
- (toolchain) Bundled toolchain version updates:
- 3.9 now references 3.9.23
- 3.10 now references 3.10.18
- 3.11 now references 3.11.13
- 3.12 now references 3.12.11
- 3.13 now references 3.13.4
- (rules) On Windows, {obj}`--bootstrap_impl=system_python` is forced.
This
allows setting `--bootstrap_impl=script` in bazelrc for mixed-platform
environments.
- (rules) {obj}`compile_pip_requirements` now generates a `.test`
target. The
`_test` target is deprecated and will be removed in the next major
release.
([#​2794](https://redirect.github.com/bazel-contrib/rules_python/issues/2794)
- (py\_wheel) py\_wheel always creates zip64-capable wheel zips
- (providers) (experimental) {obj}`PyInfo.venv_symlinks` replaces
`PyInfo.site_packages_symlinks`
- (deps) Updated setuptools to 78.1.1 to patch CVE-2025-47273. This
effectively makes
Python 3.9 the minimum supported version for using `pip_parse`.
{#v1-5-0-fixed}
##### Fixed
- (rules) PyInfo provider is now advertised by py\_test, py\_binary, and
py\_library;
this allows aspects using required\_providers to function correctly.
([#​2506](https://redirect.github.com/bazel-contrib/rules_python/issues/2506)).
- Fixes when using {obj}`--bootstrap_impl=script`:
- `compile_pip_requirements` now works with it
- The `sys._base_executable` value will reflect the underlying
interpreter,
not venv interpreter.
- The {obj}`//python/runtime_env_toolchains:all` toolchain now works
with it.
- (rules) Better handle flakey platform.win32\_ver() calls by calling
them
multiple times.
- (tools/wheelmaker.py) Extras are now preserved in Requires-Dist
metadata when using requires\_file
to specify the requirements.
- (pypi) Use bazel downloader for direct URL references and correctly
detect the filenames from
various URL formats - URL encoded version strings get correctly
resolved, sha256 value can be
also retrieved from the URL as opposed to only the `--hash` parameter.
Fixes
[#​2363](https://redirect.github.com/bazel-contrib/rules_python/issues/2363).
- (pypi) `whl_library` now infers file names from its `urls` attribute
correctly.
- (pypi) When running under `bazel test`, be sure that temporary
`requirements` file
remains writable.
- (py\_test, py\_binary) Allow external files to be used for main
- (pypi) Correctly aggregate the sources when the hashes specified in
the lockfile differ
by platform even though the same version is used. Fixes
[#​2648](https://redirect.github.com/bazel-contrib/rules_python/issues/2648).
- (pypi) `compile_pip_requirements` test rule works behind the proxy
- (toolchains) The hermetic toolchains now correctly statically
advertise the
`releaselevel` and `serial` for pre-release hermetic toolchains
({gh-issue}`2837`).
{#v1-5-0-added}
##### Added
- Repo utilities `execute_unchecked`, `execute_checked`, and
`execute_checked_stdout` now
support `log_stdout` and `log_stderr` keyword arg booleans. When these
are `True`
(the default), the subprocess's stdout/stderr will be logged.
- (toolchains) Local toolchains can be activated with custom flags. See
\[Conditionally using local toolchains] docs for how to configure.
- (pypi) Starlark-based evaluation of environment markers
(requirements.txt conditionals)
available (not enabled by default) for improved multi-platform build
support.
Set the `RULES_PYTHON_ENABLE_PIPSTAR=1` environment variable to enable
it.
- (utils) Add a way to run a REPL for any `rules_python` target that
returns
a `PyInfo` provider.
- (uv) Handle `.netrc` and `auth_patterns` auth when downloading `uv`.
Work towards
[#​1975](https://redirect.github.com/bazel-contrib/rules_python/issues/1975).
- (toolchains) Arbitrary python-build-standalone runtimes can be
registered
and activated with custom flags. See the \[Registering custom runtimes]
docs and {obj}`single_version_platform_override()` API docs for more
information.
- (rules) Added support for a using constraints files with
`compile_pip_requirements`.
Useful when an intermediate dependency needs to be upgraded to pull in
security patches.
- (toolchains): 3.14.0b2 has been added as a preview.
{#v1-5-0-removed}
##### Removed
- Nothing removed.
{#v1-4-2}
###
[`v1.4.2`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#142---2025-08-13)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.4.1...1.4.2)
[1.4.2]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.4.2
##### Fixed
- (toolchains) `local_runtime_repo` now checks if the include directory
exists
before attempting to watch it, fixing issues on macOS with system Python
([#​3043](https://redirect.github.com/bazel-contrib/rules_python/issues/3043)).
{#v1-4-1}
###
[`v1.4.1`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#141---2025-05-08)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.4.0...1.4.1)
[1.4.1]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.4.1
{#v1-4-1-fixed}
##### Fixed
- (pypi) Fix a typo not allowing users to benefit from using the
downloader when the hashes in the
requirements file are not present. Fixes
[#​2863](https://redirect.github.com/bazel-contrib/rules_python/issues/2863).
{#v1-4-0}
###
[`v1.4.0`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#140---2025-04-19)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.3.0...1.4.0)
[1.4.0]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.4.0
{#v1-4-0-changed}
##### Changed
- (toolchain) The `exec` configuration toolchain now has the forwarded
`exec_interpreter` now also forwards the `ToolchainInfo` provider. This
is
for increased compatibility with the `RBE` setups where access to the
`exec`
configuration interpreter is needed.
- (toolchains) Use the latest astral-sh toolchain release [20250317] for
Python versions:
- 3.9.21
- 3.10.16
- 3.11.11
- 3.12.9
- 3.13.2
- (pypi) Use `xcrun xcodebuild --showsdks` to find XCode root.
- (toolchains) Remove all but `3.8.20` versions of the Python `3.8`
interpreter who has
reached EOL. If users still need other versions of the `3.8`
interpreter, please supply
the URLs manually {bzl:obj}`python.toolchain` or
{bzl:obj}`python_register_toolchains` calls.
- (toolchains) Previously
[#​2636](https://redirect.github.com/bazel-contrib/rules_python/pull/2636)
changed the semantics of `ignore_root_user_error` from "ignore" to
"warning". This is now
flipped back to ignoring the issue, and will only emit a warning when
the attribute is set
`False`.
- (pypi) The PyPI extension will no longer write the lock file entries
as the
extension has been marked reproducible.
Fixes
[#​2434](https://redirect.github.com/bazel-contrib/rules_python/issues/2434).
- (gazelle) Lazily load and parse manifest files when running Gazelle.
This ensures no
manifest files are loaded when Gazelle is run over a set of non-python
directories
[PR
#​2746](https://redirect.github.com/bazel-contrib/rules_python/pull/2746).
- (rules) {attr}`py_binary.srcs` and {attr}`py_test.srcs` is no longer
mandatory when
`main_module` is specified (for `--bootstrap_impl=script`)
[20250317]:
https://redirect.github.com/astral-sh/python-build-standalone/releases/tag/20250317
{#v1-4-0-fixed}
##### Fixed
- (pypi) Platform specific extras are now correctly handled when using
universal lock files with environment markers. Fixes
[#​2690](https://redirect.github.com/bazel-contrib/rules_python/pull/2690).
- (runfiles) ({obj}`--bootstrap_impl=script`) Follow symlinks when
searching for runfiles.
- (toolchains) Do not try to run `chmod` when downloading non-windows
hermetic toolchain
repositories on Windows. Fixes
[#​2660](https://redirect.github.com/bazel-contrib/rules_python/issues/2660).
- (logging) Allow repo rule logging level to be set to `FAIL` via the
`RULES_PYTHON_REPO_DEBUG_VERBOSITY` environment variable.
- (toolchains) The toolchain matching is has been fixed when writing
transitions transitioning on the `python_version` flag.
Fixes
[#​2685](https://redirect.github.com/bazel-contrib/rules_python/issues/2685).
- (toolchains) Run the check on the Python interpreter in isolated mode,
to ensure it's not affected by userland environment variables, such as
`PYTHONPATH`.
- (toolchains) Ensure temporary `.pyc` and `.pyo` files are also
excluded from the interpreters repository files.
- (pypi) Run interpreter version call in isolated mode, to ensure it's
not affected by userland environment variables, such as `PYTHONPATH`.
- (packaging) An empty `requires_file` is treated as if it were omitted,
resulting in a valid `METADATA` file.
- (rules) py\_wheel and sphinxdocs rules now propagate
`target_compatible_with` to all targets they create.
[PR
#​2788](https://redirect.github.com/bazel-contrib/rules_python/pull/2788).
- (pypi) Correctly handle `METADATA` entries when `python_full_version`
is used in
the environment marker.
Fixes
[#​2319](https://redirect.github.com/bazel-contrib/rules_python/issues/2319).
- (pypi) Correctly handle `python_version` parameter and transition the
requirement
locking to the right interpreter version when using
{obj}`compile_pip_requirements` rule.
See
[#​2819](https://redirect.github.com/bazel-contrib/rules_python/pull/2819).
{#v1-4-0-added}
##### Added
- (pypi) From now on `sha256` values in the `requirements.txt` is no
longer
mandatory when enabling {attr}`pip.parse.experimental_index_url`
feature.
This means that `rules_python` will attempt to fetch metadata for all
packages through SimpleAPI unless they are pulled through direct URL
references. Fixes
[#​2023](https://redirect.github.com/bazel-contrib/rules_python/issues/2023).
In case you see issues with `rules_python` being too eager to fetch the
SimpleAPI
metadata, you can use the newly added {attr}`pip.parse.simpleapi_skip`
to skip metadata fetching for those packages.
- (uv) A {obj}`lock` rule that is the replacement for the
{obj}`compile_pip_requirements`. This may still have rough corners
so please report issues with it in the
[#​1975](https://redirect.github.com/bazel-contrib/rules_python/issues/1975).
Main highlights - the locking can be done within a build action or
outside
it, there is no more automatic `test` target (but it can be added on the
user
side by using `native_test`). For customizing the `uv` version that is
used,
please check the {obj}`uv.configure` tag class.
- Add support for riscv64 linux platform.
- (toolchains) Add python 3.13.2 and 3.12.9 toolchains
- (providers) (experimental) `PyInfo.site_packages_symlinks` field added
to
allow specifying links to create within the venv site packages (only
applicable with {obj}`--bootstrap_impl=script`)
([#​2156](https://redirect.github.com/bazelbuild/rules_python/issues/2156)).
- (toolchains) Local Python installs can be used to create a toolchain
equivalent to the standard toolchains. See \[Local toolchains] docs for
how to
configure them.
- (toolchains) Expose `$(PYTHON2_ROOTPATH)` and `$(PYTHON3_ROOTPATH)`
which are runfiles
locations equivalents of `$(PYTHON2)` and \`$(PYTHON3) respectively.
{#v1-4-0-removed}
##### Removed
- Nothing removed.
{#v1-3-0}
###
[`v1.3.0`](https://redirect.github.com/bazelbuild/rules_python/blob/HEAD/CHANGELOG.md#130---2025-03-27)
[Compare
Source](https://redirect.github.com/bazelbuild/rules_python/compare/1.2.0...1.3.0)
[1.3.0]:
https://redirect.github.com/bazel-contrib/rules_python/releases/tag/1.3.0
{#v1-3-0-changed}
##### Changed
- (deps) platforms 0.0.4 -> 0.0.11
- (py\_wheel) Package `py_library.pyi_srcs` (`.pyi` files) in the wheel.
- (py\_package) Package `py_library.pyi_srcs` (`.pyi` files) in
`py_package`.
- (gazelle) The generated manifest fi
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/bazel-contrib/toolchains_llvm).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MC42Mi4xIiwidXBkYXRlZEluVmVyIjoiNDEuMTMxLjkiLCJ0YXJnZXRCcmFuY2giOiJtYXN0ZXIiLCJsYWJlbHMiOltdfQ==-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>1 parent 2ab0ae8 commit b52f279Copy full SHA for b52f279
File tree
Expand file treeCollapse file tree
2 files changed
+4
-4
lines changedFilter options
- tests
Expand file treeCollapse file tree
2 files changed
+4
-4
lines changedCollapse file: tests/MODULE.bazel
+1-1Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
29 | 29 |
| |
30 | 30 |
| |
31 | 31 |
| |
32 |
| - | |
| 32 | + | |
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
|
Collapse file: tests/WORKSPACE
+3-3Lines changed: 3 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
279 | 279 |
| |
280 | 280 |
| |
281 | 281 |
| |
282 |
| - | |
283 |
| - | |
284 |
| - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
285 | 285 |
| |
286 | 286 |
| |
287 | 287 |
| |
|
0 commit comments