Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
63 changes: 63 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,69 @@ Unreleased changes are tracked as individual files in the [news/](./news)
directory, or view the [latest generated
changelog](https://rules-python.readthedocs.io/en/latest/changelog.html).

{#v2-4-0}
## [2.4.0] - 2026-09-22

[2.4.0]: https://github.com/bazel-contrib/rules_python/releases/tag/2.4.0

{#v2-4-0-changed}
### Changed
* (bootstrap) {obj}`sys.path` adds the Python runtime in runfiles instead
of the underlying Bazel repository cache directory
([#4104](https://github.com/bazel-contrib/rules_python/pull/4104)).
* (gazelle) Deprecate the `requirements` argument of `gazelle_python_manifest`
in favor of the format-agnostic `lockfiles` argument, which supports `uv.lock`.
* (toolchain) Updated default Python 3.15 runtime from `3.15.0a8` to `3.15.0rc1`
([#4122](https://github.com/bazel-contrib/rules_python/pull/4122)).
* (toolchain) Updated the default Python toolchain version from `3.11` to `3.14`
in {obj}`python.defaults`, {obj}`python_register_toolchains`, and
{obj}`python_register_multi_toolchains`
([#4023](https://github.com/bazel-contrib/rules_python/pull/4023)).

{#v2-4-0-fixed}
### Fixed
* Include the Python toolchain's static libraries when `current_py_cc_libs` is used
as a dependency of `cc_shared_library`.
* (bzlmod) Fixed a type mismatch error when using {obj}`coverage_tool` with
{obj}`python.single_version_platform_override`
([#2570](https://github.com/bazel-contrib/rules_python/issues/2570)).
* (precompile) Fixed handling of directory and `.pyc` file inputs in
{obj}`srcs` when {obj}`precompile` is enabled on {obj}`py_library`,
{obj}`py_binary`, and {obj}`py_test` targets
([#4113](https://github.com/bazel-contrib/rules_python/pull/4113)).
* (pypi) Fixed wheel RECORD file generation on Windows so that rewritten shebang
scripts correctly include the `.bat` extension
([#4114](https://github.com/bazel-contrib/rules_python/pull/4114)).
* (pypi) Fixed {obj}`RECORD` file paths for extracted `.data` directory contents
so that {obj}`importlib.metadata.files()` correctly locates installed
distribution files ([#4025](https://github.com/bazel-contrib/rules_python/pull/4025)).
* (pypi) Venv mode now works on NixOS and no longer requires coreutils to process
wheel scripts and RECORD files
([#4125](https://github.com/bazel-contrib/rules_python/pull/4125)).
* (rules) Fixed loading Python extension modules from paths longer than `MAX_PATH` on Windows.
* (runfiles) Updated {obj}`runfiles.Path` method signatures for Python 3.14
typeshed compatibility and fixed {obj}`runfiles.Path.match` on Python 3.12+.
([#4023](https://github.com/bazel-contrib/rules_python/issues/4023))
* (stamping) The build data spawn action is now skipped when `--stamp=false` and,
instead the metadata file is written at analysis time via `ctx.actions.write()`.
* (toolchain) Fixed a crash in {obj}`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](https://github.com/bazel-contrib/rules_python/issues/4079)).
* (toolchain) Fixed a crash on Windows when precompiling is enabled:
the precompiler's interpreter couldn't find its DLLs once relocated
([#4082](https://github.com/bazel-contrib/rules_python/issues/4082)).

{#v2-4-0-added}
### Added
* (runfiles) Added {obj}`Runfiles.CreateOrRaise` to return a `Runfiles` instance
or raise an error if runfiles cannot be found.
* (uv) Added {obj}`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](https://github.com/bazel-contrib/rules_python/issues/4029)).


{#v2-3-3}
## [2.3.3] - 2026-09-04

Expand Down
2 changes: 1 addition & 1 deletion gazelle/docs/installation_and_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ gazelle_python_manifest(
)
```

:::{versionchanged} VERSION_NEXT_FEATURE
:::{versionchanged} 2.4.0
The `requirements` argument is deprecated in favor of `lockfiles`, which can
refer to any dependency lockfile, including `uv.lock`.
:::
Expand Down
2 changes: 1 addition & 1 deletion gazelle/manifest/defs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def gazelle_python_manifest(
**kwargs):
"""A macro for defining the updating and testing targets for the Gazelle manifest file.

:::{versionchanged} VERSION_NEXT_FEATURE
:::{versionchanged} 2.4.0
The `requirements` argument is deprecated in favor of `lockfiles`, which
can refer to any dependency lockfile, including `uv.lock`.
:::
Expand Down
3 changes: 0 additions & 3 deletions news/2570.fixed.md

This file was deleted.

4 changes: 0 additions & 4 deletions news/4023.changed.md

This file was deleted.

3 changes: 0 additions & 3 deletions news/4025.fixed.md

This file was deleted.

4 changes: 0 additions & 4 deletions news/4029.added.md

This file was deleted.

1 change: 0 additions & 1 deletion news/4071.fixed.md

This file was deleted.

4 changes: 0 additions & 4 deletions news/4079.fixed.md

This file was deleted.

3 changes: 0 additions & 3 deletions news/4082.fixed.md

This file was deleted.

3 changes: 0 additions & 3 deletions news/4104.changed.md

This file was deleted.

2 changes: 0 additions & 2 deletions news/4111.changed.md

This file was deleted.

4 changes: 0 additions & 4 deletions news/4113.fixed.md

This file was deleted.

3 changes: 0 additions & 3 deletions news/4114.fixed.md

This file was deleted.

2 changes: 0 additions & 2 deletions news/4122.changed.md

This file was deleted.

3 changes: 0 additions & 3 deletions news/4125.fixed.md

This file was deleted.

2 changes: 0 additions & 2 deletions news/4160.fixed.md

This file was deleted.

2 changes: 0 additions & 2 deletions news/add_runfiles_raise_api.added.md

This file was deleted.

2 changes: 0 additions & 2 deletions news/current-py-cc-libs-shared-library.fixed.md

This file was deleted.

3 changes: 0 additions & 3 deletions news/runfiles_py314_compat.fixed.md

This file was deleted.

2 changes: 1 addition & 1 deletion python/private/attributes.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ As an exception, empty targets in `srcs` that provide {obj}`PyInfo` are
allowed. Ordinary library dependencies should remain in `deps`.
:::

:::{versionchanged} VERSION_NEXT_PATCH
:::{versionchanged} 2.4.0
Allowed `.pyc` and directory inputs in `srcs`.
:::
""",
Expand Down
2 changes: 1 addition & 1 deletion python/private/current_py_cc_libs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ cc_library(
)
```

:::{versionchanged} VERSION_NEXT_PATCH
:::{versionchanged} 2.4.0
Static libraries are included when this target is a dependency of `cc_shared_library`.
:::
""",
Expand Down
4 changes: 2 additions & 2 deletions python/runfiles/runfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -835,7 +835,7 @@ def CreateOrRaise(env: dict[str, str] | None = None) -> Runfiles:
Raises:
RuntimeError: if runfiles cannot be found.

:::{versionadded} VERSION_NEXT_FEATURE
:::{versionadded} 2.4.0
:::
"""
runfiles = Runfiles.Create(env=env)
Expand Down Expand Up @@ -865,7 +865,7 @@ def Create(env: dict[str, str] | None = None) -> Runfiles | None:
def CreateOrRaise(env: dict[str, str] | None = None) -> Runfiles:
"""Refer to `Runfiles.CreateOrRaise`.

:::{versionadded} VERSION_NEXT_FEATURE
:::{versionadded} 2.4.0
:::
"""
return Runfiles.CreateOrRaise(env)
4 changes: 2 additions & 2 deletions python/uv/private/lock.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,8 @@ def lock(
constraints: {type}`list[Label]` The list of constraints files to use.
directory: {type}`str | None` The directory into which we should cd when
running the command. Defaults to `native.package()`. Set to `None`
or `""` to restore behaviour before `VERSION_NEXT_FEATURE`.
{versionadded} VERSION_NEXT_FEATURE
or `""` to restore behaviour before `2.4.0`.
{versionadded} 2.4.0
generate_hashes: {type}`bool` Generate hashes for all of the
requirements. Only meaningful for `requirements.txt` style output.
Defaults to `True`.
Expand Down
Loading