Skip to content

chore(deps): update dependency rules_python to v2.3.1 - #164

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/rules_python-2.x
Open

chore(deps): update dependency rules_python to v2.3.1#164
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/rules_python-2.x

Conversation

@renovate

@renovate renovate Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
rules_python bazel_dep minor 2.0.22.3.1

Release Notes

bazel-contrib/rules_python (rules_python)

v2.3.1

Compare Source

For more detailed setup instructions, see https://rules-python.readthedocs.io/en/latest/getting-started.html

For the user-facing changelog see here

Using Bzlmod

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")

Using WORKSPACE

Paste this snippet into your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
    name = "rules_python",
    sha256 = "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()
Gazelle plugin

Paste this snippet into your WORKSPACE file:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "rules_python_gazelle_plugin",
    sha256 = "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: bazel-contrib/rules_python@2.3.0...2.3.1

v2.3.0

Compare Source

{#v2-3-0-changed}

Changed
  • (gazelle) BREAKING rules_python 1.5.0 or higher is now required. The Python
    extension selects its standard library list on is_python_3.14, which earlier
    versions do not define.

{#v2-3-0-fixed}

Fixed
  • 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.
  • (compile_pip_requirements) Add the explicit 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) The warning about a missing bundled coverage.py wheel is no longer
    emitted as we are now falling back to a pure python wheel
    (#​3950).
  • (gazelle) The Python extension now uses the correct standard library module list for
    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).
  • (pypi) Allow uv_lock to be specified in pip.parse without requiring
    requirements_lock (or other os-specific requirement file attributes) to be
    set.
  • (pypi) Requirement --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).
  • (pypi) 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).
  • (pypi) correctly parse the 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.
  • (pypi) fixed the URL normalization function to correctly handle local paths
    enabling wheel sources files to point to an absolute path. Currently it supports
    the file://<absolute_path> for linux and windows like paths. We also support
    envsubst for the said paths from now on.

{#v2-3-0-added}

Added
  • (bzlmod) Added MODULE.bazel flag aliases for Starlark-defined flags:
    build_python_zip, incompatible_default_to_explicit_init_py,
    python_path, and experimental_python_import_all_repositories.
  • (cc) Added experimental {obj}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.
  • (pip,python) Added 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) Added an opt-in safeguard against 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}

v2.2.0

Compare Source

{#v2-2-0-changed}

Changed
  • Renamed most public bzl_library targets from {foo}_bzl to {foo} to follow
    gazelle naming conventions. Deprecated aliases are left for backwards
    compatibility.
  • (binaries/tests) Added a deprecation warning for targets relying on implicit __init__.py creation.

{#v2-2-0-fixed}

Fixed
  • Fixed a flaky error on Windows 2022 when looking up the win32 version during
    site initialization by retrying the lookup
    (#​3721).
  • (binaries) Fixed building of legacy zipapps on Windows execution platforms by
    using a hermetic tool instead of host cat.
  • (bootstrap) Fixed stage 1 bootstrap imports when target outputs shadow
    standard library modules.
  • (coverage) Skip lcov report when no data was collected.
  • (pypi) Fixed experimental_index_url checking truthiness before envsubst
    expansion.
  • (rules) Fixed venv output paths for 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.
  • (windows) Fixed build data generation on localized Windows installations.

{#v2-2-0-added}

Added
  • Added {bzl:obj}features.loadable_symbols to allow detecting public symbols
    exported by bzl files.
  • Exposed {bzl:obj}VenvSymlinkEntry and {bzl:obj}VenvSymlinkKind in
    {bzl:target}//python:py_info.bzl.
  • (pypi) Added @pypi repo: a unified hub of pip.parse hubs.
  • (pypi) Added a 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) Support for basic 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}

v2.1.0

Compare Source

{#v2-1-0-removed}

Removed
  • (build_data) Removed CONFIG_MODE from build data
    (#​3793).
  • (coverage) Support for python 3.8 has been dropped from the bundled
    coverage.py wheel set, since coverage.py 7.6.2 dropped it.

{#v2-1-0-changed}

Changed
  • (bzlmod) How default runtimes are registered has changed to use a manifest
    of SHAs and URLs. TOOL_VERSIONS in python/versions.bzl is now empty under
    bzlmod.
  • (gazelle) WORKSPACE's bazel-gazelle dependency bumped from 0.36.0 to 0.47.0.
    The go version was also bumped from 1.21.13 to 1.22.9.
  • (gazelle) python_generate_pyi_deps and python_generate_pyi_srcs now
    default to true.
  • (pypi) The data files of a wheel (bin, includes, etc) are now always included
    as a library's data dependencies.
  • (coverage) When 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}

Fixed
  • (gazelle) 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
  • (bootstrap) Fixed a potential race condition with symlink creation during
    startup.
  • (gazelle) Fixed handling of auto-included __init__.py files when generating py_binary
    targets (#​3729).
  • (entry_point) From now on mypy type checking will be skipped on the generated
    files (#​3126).
  • (pypi) Support --experimental_isolated_extension_usages
    (#​3668).
  • (uv) use the astral.sh mirror as the preferred url for binary downloads,
    with github.com as a fallback; for uv >= 0.11.0, read the checksums directly
    from the dist-manifest contents.
  • (pypi) Fix importlib.metadata.files by ensuring RECORD is included in
    installed wheel targets, except when built from sdist
    (#​3024).
  • (system_python) Fix AttributeError exception on Debian 10 Buster
    python installations which may not set sys._base_executable
    (#​3774).
  • (windows) Fix 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).
  • Fix the forwarding of target_compatible_with from compile_pip_requirements
    towards the underlying *.update target.
    (#​3787)
  • (uv) allow user overwrite the build environment using --action_env to allow
    setting authentication for the index URL.
    (#​3405)
  • (uv) fix the execution of the uv pip compile in the sandbox. Work
    towards better supporting uv out of the box on our platforms.
    (#​1975)
  • (uv) automatically pass the --project parameter based on the source files.
    (#​3087)
  • (coverage) handle nested coverage collection
    (#​3823)

{#v2-1-0-added}

Added
  • (toolchain) Added {obj}PyRuntimeInfo.interpreter_files_to_run so action
    consumers can execute an in-build runtime interpreter with its runfiles.
  • (toolchains) Support dynamically fetching and registering Python runtimes
    from a python-build-standalone manifest file using
    python.override(add_runtime_manifest_urls = ..., runtime_manifest_sha = ...).
  • (toolchain) Added {obj}python.override.toolchain_target_settings to allow
    adding config_setting labels to all registered toolchains.
  • (windows) Full venv support for Windows is available. Set
    {obj}--venvs_site_packages=yes to enable.
  • (test/binaries) When {obj}--venv_site_packages=yes is enabled,
    wheel data, bin, and include files are populated into the venv.
  • (runfiles) Added a pathlib-compatible API: {obj}Runfiles.root()
    Fixes #​3296.
  • (gazelle) Support alias_kind directive.
    Fixes #​3183.
  • (pypi) package_metadata support, fixes
    #​2054.
  • (coverage) Add support for python 3.14 and bump coverage.py to 7.10.7.

{#v2-0-3}

v2.0.3

Compare Source

{#v2-0-3-fixed}

Fixed
  • (pypi) Assume that all of the packages are available on a particular hub if
    there is only a single PyPI compatible index to be used. This saves us an expensive
    PyPI download and supports PyPI mirror implementations that do not support the root
    index functionality. Fixes #​3769.

{#v2-0-2}


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • "every weekend"
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
renovate Bot enabled auto-merge June 20, 2026 02:55
@renovate
renovate Bot force-pushed the renovate/rules_python-2.x branch from 1d5aa86 to e5aea00 Compare June 29, 2026 02:57
@renovate renovate Bot changed the title chore(deps): update dependency rules_python to v2.0.3 chore(deps): update dependency rules_python to v2.1.0 Jun 29, 2026
@renovate
renovate Bot force-pushed the renovate/rules_python-2.x branch from e5aea00 to 02957ae Compare July 4, 2026 09:26
@renovate renovate Bot changed the title chore(deps): update dependency rules_python to v2.1.0 chore(deps): update dependency rules_python to v2.2.0 Jul 4, 2026
@renovate
renovate Bot force-pushed the renovate/rules_python-2.x branch from 02957ae to 0dbd9c4 Compare August 14, 2026 18:36
@renovate renovate Bot changed the title chore(deps): update dependency rules_python to v2.2.0 chore(deps): update dependency rules_python to v2.3.0 Aug 14, 2026
@renovate
renovate Bot force-pushed the renovate/rules_python-2.x branch from 0dbd9c4 to ebedbdc Compare August 15, 2026 00:03
@renovate renovate Bot changed the title chore(deps): update dependency rules_python to v2.3.0 chore(deps): update dependency rules_python to v2.3.1 Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants