Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency rules_python to v0.37.2 #380

Merged
merged 4 commits into from
Nov 1, 2024

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 18, 2024

This PR contains the following updates:

Package Type Update Change
rules_python bazel_dep minor 0.36.0 -> 0.37.2
rules_python http_archive minor 0.36.0 -> 0.37.2

Release Notes

bazelbuild/rules_python (rules_python)

v0.37.2

Compare Source

Using Bzlmod

Add to your MODULE.bazel file:

bazel_dep(name = "rules_python", version = "0.37.2")

pip = use_extension("@​rules_python//python/extensions:pip.bzl", "pip")

pip.parse(
    hub_name = "pip",
    python_version = "3.11",
    requirements_lock = "//:requirements_lock.txt",
)

use_repo(pip, "pip")

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 = "c6fb25d0ba0246f6d5bd820dd0b2e66b339ccc510242fd4956b9a639b548d113",
    strip_prefix = "rules_python-0.37.2",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.37.2/rules_python-0.37.2.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 = "c6fb25d0ba0246f6d5bd820dd0b2e66b339ccc510242fd4956b9a639b548d113",
    strip_prefix = "rules_python-0.37.2/gazelle",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.37.2/rules_python-0.37.2.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@0.37.1...0.37.2

v0.37.1

Compare Source

{#v0-37-1-fixed}

Fixed
  • (rules) Setting --incompatible_python_disallow_native_rules no longer
    causes rules_python rules to fail
    (#​2326).

{#v0-37-0}

v0.37.0

Compare Source

{#v0-37-0-changed}

Changed
  • BREAKING py_library no longer puts its source files or generated pyc
    files in runfiles; it's the responsibility of consumers (e.g. binaries) to
    populate runfiles with the necessary files. Adding source files to runfiles
    can be temporarily restored by setting {obj}--add_srcs_to_runfiles=enabled,
    but this flag will be removed in a subsequent releases.
  • {obj}PyInfo.transitive_sources is now added to runfiles. These files are
    .py files that are required to be added to runfiles by downstream binaries
    (or equivalent).
  • (toolchains) py_runtime.implementation_name now defaults to cpython
    (previously it defaulted to None).
  • (toolchains) The exec tools toolchain is enabled by default. It can be
    disabled by setting
    {obj}--@​rules_python//python/config_settings:exec_tools_toolchain=disabled.
  • (deps) stardoc 0.6.2 added as dependency.

{#v0-37-0-fixed}

Fixed
  • (bzlmod) The python.override(minor_mapping) now merges the default and the
    overridden versions ensuring that the resultant minor_mapping will always
    have all of the python versions.
  • (bzlmod) The default value for the {obj}--python_version flag will now be
    always set to the default python toolchain version value.
  • (bzlmod) correctly wire the {attr}pip.parse.extra_pip_args all the
    way to {obj}whl_library. What is more we will pass the extra_pip_args to
    {obj}whl_library for sdist distributions when using
    {attr}pip.parse.experimental_index_url. See
    #​2239.
  • (whl_filegroup): Provide per default also the RECORD file
  • (py_wheel): RECORD file entry elements are now quoted if necessary when a
    wheel is created
  • (whl_library) truncate progress messages from the repo rule to better handle
    case where a requirement has many --hash=sha256:... flags
  • (rules) compile_pip_requirements passes env to the X.update target (and
    not only to the X_test target, a bug introduced in
    #​1067).
  • (bzlmod) In hybrid bzlmod with WORKSPACE builds,
    python_register_toolchains(register_toolchains=True) is respected
    (#​1675).
  • (precompiling) The {obj}pyc_collection attribute now correctly
    enables (or disables) using pyc files from targets transitively
  • (pip) Skip patching wheels not matching pip.override's file
    (#​2294).
  • (chore): Add a rules_shell dev dependency and moved a sh_test target
    outside of the //:BUILD.bazel file.
    Fixes #​2299.

{#v0-37-0-added}

Added
  • (py_wheel) Now supports compress = (True|False) to allow disabling
    compression to speed up development.
  • (toolchains): A public //python/config_settings:python_version_major_minor has
    been exposed for users to be able to match on the X.Y version of a Python
    interpreter.
  • (api) Added {obj}merge_py_infos() so user rules can merge and propagate
    PyInfo without losing information.
  • (toolchains) New Python versions available: 3.13.0 using the 20241008 release.
  • (toolchains): Bump default toolchain versions to:
    • 3.8 -> 3.8.20
    • 3.9 -> 3.9.20
    • 3.10 -> 3.10.15
    • 3.11 -> 3.11.10
    • 3.12 -> 3.12.7
  • (coverage) Add support for python 3.13 and bump coverage.py to 7.6.1.
  • (bzlmod) Add support for download_only flag to disable usage of sdists
    when {bzl:attr}pip.parse.experimental_index_url is set.
  • (api) PyInfo fields: {obj}PyInfo.transitive_implicit_pyc_files,
    {obj}PyInfo.transitive_implicit_pyc_source_files.

{#v0-37-0-removed}

Removed
  • (precompiling) {obj}--precompile_add_to_runfiles has been removed.
  • (precompiling) {obj}--pyc_collection has been removed. The pyc_collection
    attribute now bases its default on {obj}--precompile.
  • (precompiling) The {obj}precompile=if_generated_source value has been removed.
  • (precompiling) The {obj}precompile_source_retention=omit_if_generated_source value has been removed.

{#v0-36-0}


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

👻 Immortal: This PR will be recreated if closed unmerged. Get config help if that's undesired.


  • 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 (rebase) October 18, 2024 19:41
@renovate renovate bot force-pushed the renovate/rules_python-0.x branch 3 times, most recently from 16fea69 to cdcb070 Compare October 23, 2024 08:23
@renovate renovate bot changed the title chore(deps): update dependency rules_python to v0.37.0 chore(deps): update dependency rules_python to v0.37.1 Oct 23, 2024
@renovate renovate bot force-pushed the renovate/rules_python-0.x branch from cdcb070 to 16f2825 Compare October 27, 2024 04:39
@renovate renovate bot changed the title chore(deps): update dependency rules_python to v0.37.1 chore(deps): update dependency rules_python Oct 27, 2024
@renovate renovate bot force-pushed the renovate/rules_python-0.x branch from 16f2825 to b5b4d3a Compare October 28, 2024 17:53
@renovate renovate bot changed the title chore(deps): update dependency rules_python chore(deps): update dependency rules_python to v0.37.2 Oct 28, 2024
@renovate renovate bot force-pushed the renovate/rules_python-0.x branch 3 times, most recently from d60377c to e8d4676 Compare October 29, 2024 10:15
@renovate renovate bot force-pushed the renovate/rules_python-0.x branch from e8d4676 to 246165a Compare November 1, 2024 07:39
This is to resolve the error
```
util/BUILD.bazel:50:10: in deps attribute of py_binary rule //util:update_filegroups: '@@rules_python~//python/runfiles:runfiles' does not have mandatory providers: 'PyInfo' or 'CcInfo'. Since this rule was created by the macro 'py_binary', the error might have been caused by the macro implementation
```
Observed [on
CI](https://github.com/aherrmann/rules_zig/actions/runs/11571742693/job/32210283098?pr=380#step:3:758)
for [#380](#380) caused by
different identities assigned to the builtin and the @rules_python
`PyInfo` and `CcInfo` providers.
```
$ bazel cquery --output starlark --starlark:expr 'providers(target)' @@rules_python~//python/runfiles:runfiles
{
  "@@rules_python~//python/private:py_info.bzl%PyInfo": struct(...),
  "@@rules_python~//python/private:py_cc_link_params_info.bzl%PyCcLinkParamsInfo": struct(cc_info = struct(..)),
  ...
}
```
This reverts commit 1348c3b.

The --incompatible_python_disallow_native_rules flag fails in WORKSPACE
mode due to incompatible use in the builtin `@bazel_tools` repo.
See https://github.com/aherrmann/rules_zig/actions/runs/11626106944/job/32377199087?pr=380#step:3:762
```
(07:45:07) ERROR:
/home/runner/.cache/bazel-repo/bazel/_bazel_runner/e97befc866f153aa83e528704066dbd2/external/bazel_tools/tools/python/BUILD:110:31:
in py_runtime rule
@@bazel_tools//tools/python:_autodetecting_py3_runtime:
Traceback (most recent call last):
File "/virtual_builtins_bzl/common/python/py_runtime_rule.bzl",
  line 24, column 25, in _py_runtime_impl
File "/virtual_builtins_bzl/common/python/common.bzl",
  line 520, column 13, in check_native_allowed
Error in fail:
  @bazel_tools//tools/python:_autodetecting_py3_runtime
  not allowed to use native.py_runtime
Generated by:
  define_autodetecting_toolchain(name=autodetecting_toolchain)
  in tools/python/BUILD:110:31
Allowlist: no allowlist specified; all disallowed;
  specify one with --python_native_rules_allowlist
  Migrate to using @rules_python, see
  bazelbuild/bazel#17773
FIXCMD: add_python_loads
  --target=@bazel_tools//tools/python:_autodetecting_py3_runtime
  --rule=py_runtime
  --generator_name=autodetecting_toolchain
  --location=tools/python/BUILD:110:31
```

The `@bazel_tools` repo cannot be modified, so the `FIXCMD` solution
does not apply.
The allowlist flag expects a package_group, but `@bazel_tools` has no
pre-defined package_group, and a user defined `package_group` cannot
refer to other workspaces because elements of the `packages` attribute
must start with `//`.

See the discussion around the following comment for other solutions:
bazelbuild/bazel#17773 (comment)
@aherrmann aherrmann force-pushed the renovate/rules_python-0.x branch from a067de8 to 3beeee9 Compare November 1, 2024 08:05
@renovate renovate bot merged commit de42c0b into main Nov 1, 2024
47 checks passed
@renovate renovate bot deleted the renovate/rules_python-0.x branch November 1, 2024 08:59
renovate bot pushed a commit that referenced this pull request Nov 1, 2024
This is to resolve the error
```
util/BUILD.bazel:50:10: in deps attribute of py_binary rule //util:update_filegroups: '@@rules_python~//python/runfiles:runfiles' does not have mandatory providers: 'PyInfo' or 'CcInfo'. Since this rule was created by the macro 'py_binary', the error might have been caused by the macro implementation
```
Observed [on
CI](https://github.com/aherrmann/rules_zig/actions/runs/11571742693/job/32210283098?pr=380#step:3:758)
for [#380](#380) caused by
different identities assigned to the builtin and the @rules_python
`PyInfo` and `CcInfo` providers.
```
$ bazel cquery --output starlark --starlark:expr 'providers(target)' @@rules_python~//python/runfiles:runfiles
{
  "@@rules_python~//python/private:py_info.bzl%PyInfo": struct(...),
  "@@rules_python~//python/private:py_cc_link_params_info.bzl%PyCcLinkParamsInfo": struct(cc_info = struct(..)),
  ...
}
```
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.

1 participant