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

Update dependency rules_python to v0.22.0 #3135

Merged
merged 1 commit into from
May 25, 2023

Conversation

zemnmez-renovate-bot
Copy link
Collaborator

@zemnmez-renovate-bot zemnmez-renovate-bot commented May 25, 2023

This PR contains the following updates:

Package Type Update Change
rules_python http_archive minor 0.21.0 -> 0.22.0

Release Notes

bazelbuild/rules_python

v0.22.0

Compare Source

Notable and Breaking Changes

Bzlmod extension paths have changed

As part of fixing some fundamental issues with the bzlmod support, we had to change the path to our extensions. Instead of all extensions being in a single extensions.bzl file, each extension is in its own file. Users must update the file path in their use_repo() statements as follows:

  • use_extension("@​rules_python//python:extensions.bzl", "python") -> use_extension("@​rules_python//python/extensions:python.bzl", "python")
  • use_extension("@​rules_python//python:extensions.bzl", "pip") -> use_extension("@​rules_python//python/extensions:pip.bzl", "pip")

The following sed commands should approximate the necessary changes:

sed 'sXuse_extension("@​rules_python//python:extensions.bzl", "python")Xuse_extension("@​rules_python//python/extensions:python.bzl", "python")X'`
sed 'sXuse_extension("@​rules_python//python:extensions.bzl", "pip")Xuse_extension("@​rules_python//python/extensions:pip.bzl", "pip")X'`

See examples/bzlmod_build_file_generation/MODULE.bazel for an example of the new paths.

Lockfile output churn

The output of lockfiles has slightly changed. Though functionally the same, their integrity hashes will change.


Using Bzlmod with Bazel 6

NOTE: Bzlmod support is still in beta.

Add to your MODULE.bazel file:

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

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

pip.parse(
    name = "pip",
    requirements_lock = "//:requirements_lock.txt",
)

use_repo(pip, "pip")

### (Optional) Register a specific python toolchain instead of using the host version
python = use_extension("@​rules_python//python/extensions:python.bzl", "python")

python.toolchain(
    name = "python3_9",
    python_version = "3.9",
)

use_repo(python, "python3_9_toolchains")

register_toolchains(
    "@​python3_9_toolchains//:all",
)

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 = "863ba0fa944319f7e3d695711427d9ad80ba92c6edd0b7c7443b84e904689539",
    strip_prefix = "rules_python-0.22.0",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.22.0/rules_python-0.22.0.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 = "863ba0fa944319f7e3d695711427d9ad80ba92c6edd0b7c7443b84e904689539",
    strip_prefix = "rules_python-0.22.0/gazelle",
    url = "https://github.com/bazelbuild/rules_python/releases/download/0.22.0/rules_python-0.22.0.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()

What's Changed

New Contributors

Full Changelog: bazelbuild/rules_python@0.21.0...0.22.0


Configuration

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

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, 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 has been generated by Renovate Bot.

@zemnmez-renovate-bot zemnmez-renovate-bot enabled auto-merge (rebase) May 25, 2023 20:22
@zemnmez-renovate-bot zemnmez-renovate-bot merged commit 08aaf2f into main May 25, 2023
@zemnmez-renovate-bot zemnmez-renovate-bot deleted the renovate/rules_python-0.x branch May 25, 2023 20:53
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