-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[build] Script to update Bazel multitool.lock.json (and update ruff) #16061
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
[build] Script to update Bazel multitool.lock.json (and update ruff) #16061
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be even cooler if the script can be run with Bazel, so I don't have to think about installing Pygithub. Let me know if you want to work on that, I'll help.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be even cooler if the script could be run from Bazel itself, so one doesn't need to remember to install dependencies. But either way, great work!
I just improved it so it doesn't use PyGithub and it retrieves hashes from GitHub so it doesn't have to download assets and calculate them. Now there are no external dependencies. |
User description
💥 What does this PR do?
This PR updates the version of Ruff (Python linter/formatter) used by Bazel and for local Python development.
It also includes a new script
./scripts/update_multitool_binaries.py
for keeping the Bazel rules_multitool lockfile (multitool.lock.json
) up to date. Previously, you had to edit this file and supply new URL's and hashes whenever updating a tool's binary versions.See: https://github.com/theoremlp/rules_multitool
🔧 Implementation Notes
To update the lockfile, run
$ ./scripts/update_multitool_binaries.py
from the root of the repo.💡 Additional Considerations
The update script requires that the tool binaries are hosted in a public GitHub repo's Release assets, otherwise the tool is just skipped. Currently, we only have 1 tool (ruff) defined in this file.
🔄 Types of changes
PR Type
Enhancement
Description
Add Python script to automatically update Bazel multitool lockfile
Update Ruff version from 0.11.11/0.11.12 to 0.12.3
Automate URL and hash updates for GitHub-hosted tool binaries
Changes diagram
Changes walkthrough 📝
update_multitool_binaries.py
Add automated multitool binary updater script
scripts/update_multitool_binaries.py
multitool.lock.json
Update Ruff binaries to version 0.12.3
multitool.lock.json
(x86_64)
tox.ini
Update Ruff version in tox configuration
py/tox.ini