Skip to content

Update dependency rules_python to v2#6

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

Update dependency rules_python to v2#6
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/rules_python-2.x

Conversation

@renovate

@renovate renovate Bot commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

This PR contains the following updates:

Package Type Update Change
rules_python bazel_dep major 1.8.42.2.0

Release Notes

bazel-contrib/rules_python (rules_python)

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}

v2.0.2

Compare Source

{#v2-0-2-added}

Added
  • (toolchains) 3.13.12, 3.14.3 Python toolchain from 20260325 release.
  • (toolchains) 3.10.20, 3.11.15, 3.12.13, 3.13.13 3.14.4, 3.15.0a8
  • Python toolchain from 20260414 release.

{#v2-0-1}

v2.0.1

Compare Source

{#v2-0-1-fixed}

Fixed
  • (pypi) Fix the versions of packages that we are recording to a MODULE.bazel.lock file
    facts by passing all of the versions to the get_index function.
    Fixes #​3756.
  • (bzlmod) Reduce default verbosity of our loggers for non-root modules
    (#​3749).

{#v2-0-0}

v2.0.0

Compare Source

{#v2-0-0-removed}

Removed
  • Nothing removed.

{#v2-0-0-changed}

Changed

Breaking

  • {obj}--windows_enable_symlinks is required. Add startup --windows_enable_symlinks to your .bazelrc to enable Bazel using full
    symlink support on Windows.
  • venv-based binaries are created by default ({obj}--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.
  • (pypi) Previously 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:

  • (pypi) Update dependencies used for compile_pip_requirements, building
    sdists in the whl_library rule and fetching wheels using pip.
  • (pypi) Before using the bazel downloader to fetch the PyPI package metadata
    we will from now on fetch the lists of available packages on each index. The
    used package mappings will be written as facts to the 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) We will now use the download URL specified in the 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.
  • (runfiles): Type annotations are no longer tested for Python 3.9.
  • Windows no longer defaults to creating a zip file and extracting it; a
    symlink-based runfiles tree is created, as on unix-like platforms.

{#v2-0-0-fixed}

Fixed
  • (toolchain) Also set Make variables for local toolchains.
  • (zipapp) Resolve issue passing through compression settings in
    py_zippapp_binary targets
    (#​3646).
  • (toolchains) The pyc created at runtime in the stdlib should no longer
    cause the Python runtime repository to be invalidated. The stdlib pyc files
    may be reused in between invocations, depending upon the sandboxing
    configuration. See the {any}RULES_PYTHON_PYCACHE_DIR environment variable
    for more information.
    (#​3643).
  • (bootstrap) Fixed incorrect runfiles path construction in bootstrap
    scripts when binary is defined in another bazel module
    (#​3563).
  • (bootstrap) Resolve RUNFILES_DIR inheritance issues, which lead to a child
    Python binary incorrectly using it's parent's Python binary environment
    (#​3518).
  • (uv) Downloads for versions >=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.
  • (pypi) Fixes wheel extraction on hosts without python installed,
    Fixes #​3712.

{#v2-0-0-added}

Added
  • (pypi) Write SimpleAPI contents to the 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.
  • (pypi) The --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.
  • (pypi) If cross-compilation is needed, use the {obj}pip.parse.target_platforms
    to specify exactly which platforms should be supported.
    Implements
    #​260.
  • (wheel) Specifying a path ending in / as a destination in data_files
    will now install file(s) to a folder, preserving their basename.
  • Various attributes and fields added to support venvs on Windows:
    • {obj}py_runtime.venv_bin_files and {obj}PyRuntime.venv_binfiles
      field added to specify additional Python runtime files Windows needs for
      venvs.
    • {obj}PyExecutableInfo.venv_interpreter_runfiles, and
      {obj}PyExecutableInfo.venv_interpreter_symlinks adde
  • (wheel) Add support for add_path_prefix argument in py_wheel which can be
    used to prepend a prefix to the files in the wheel.

{#v1-9-1}

v1.9.1

Compare Source

{#v1-9-1-added}

Added
  • (toolchains) 3.13.12, 3.14.3 Python toolchain from [2026032] release.
  • (toolchains) 3.10.20, 3.11.15, 3.12.13, 3.13.13 3.14.4, 3.15.0a8
  • Python toolchain from [2026041] release.

{#v1-9-0}

v1.9.0

Compare Source

{#v1-9-0-removed}

Removed
  • Nothing removed.

{#v1-9-0-changed}

Changed
  • DEPRECATED: implicit zipapp support
    • Implicit zipapp output of 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.
  • (toolchains) stop exposing config settings in python toolchain alias repos.
    Please consider depending on the flags defined in
    //python/config_setting/... and the @platforms package instead.
  • (binaries/tests) The PYTHONBREAKPOINT environment variable is automatically inherited
  • (binaries/tests) The {obj}stamp attribute now transitions the Bazel builtin
    {flag}--stamp flag.
  • (pypi) Now the RECORD file patches will follow the quoted or unquoted filenames convention
    in order to make pytorch and friends easier to patch.
  • (wheel) py_wheel no longer expands the input depset during analysis,
    improving analysis performance for targets with large dependency trees.
  • (binaries/tests) (Windows) --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}

Fixed
  • (tests) No more coverage warnings are being printed if there are no sources.
    (#​2762)
  • (gazelle) Ancestor 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.
  • (binaries/tests) Stamped build data generated by Windows actions is readable

{#v1-9-0-added}

Added
  • (binaries/tests) {obj}--debugger: allows specifying an extra dependency
    to add to binaries/tests for custom debuggers.
  • (binaries/tests) Build information is now included in binaries and tests.
    Use the bazel_binary_info module to access it. The {flag}--stamp flag will
    add {obj}--workspace_status_command information.
  • (gazelle) A new directive 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).
  • (zipapp) {obj}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.
  • (toolchains) Added {obj}PyExecToolsInfo.exec_runtime for more easily
    getting an RBE-compatible runtime to use for build actions.
  • (providers) {obj}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.
  • (tools/wheelmaker.py) Added support for URL requirements according to PEP 508
    in Requires-Dist metadata. (#​3569)
  • (gazelle) A new directive 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}

v1.8.5

Compare Source

{#v1-8-5-fixed}

Fixed
  • (runfiles) Fixed CurrentRepository() raising ValueError on Windows.
    (#​3579)
  • (pypi) pip_parse no longer silently drops PEP 508 URL-based requirements
    (pkg @​ https://...) when extract_url_srcs=False (the default for
    pip_repository).
  • (pypi) Extras in requirement strings are now normalized per PEP 685,
    fixing missing transitive dependencies when extras contain hyphens
    (e.g., sqlalchemy[postgresql-psycopg2binary]).
    (#​3587)

{#v1-8-4}


Configuration

📅 Schedule: (UTC)

  • 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 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 force-pushed the renovate/rules_python-2.x branch from a478293 to 5f54556 Compare May 10, 2026 16:47
@renovate
renovate Bot force-pushed the renovate/rules_python-2.x branch from 5f54556 to c8a2c10 Compare May 23, 2026 09:37
@renovate
renovate Bot force-pushed the renovate/rules_python-2.x branch from c8a2c10 to c783c9e Compare June 16, 2026 05:56
@renovate
renovate Bot force-pushed the renovate/rules_python-2.x branch from c783c9e to f3ae68c Compare June 28, 2026 23:35
@renovate
renovate Bot force-pushed the renovate/rules_python-2.x branch from f3ae68c to dfaf0d2 Compare July 4, 2026 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants