-
-
Notifications
You must be signed in to change notification settings - Fork 557
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
Use uv for linter workflow #39701
base: develop
Are you sure you want to change the base?
Use uv for linter workflow #39701
Conversation
this needs a bit of documentation. How was the lock file generated in the 1st place. How to update it manually. |
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.
few sentences in developer docs, or just as comments, please. It's too cryptic now.
Documentation preview for this PR (built with commit e563fe4; changes) is ready! 🎉 |
You can manually update all locked packages using The uv docs are very good, so I'm hesitant to put something in sage's dev docs, which then needs to be maintained and may get outdated relatively soon (given that uv is moving pretty fast at the moment). The auto-update is done via the github app https://github.com/apps/renovate (needs to be installed by an admin, but that's pretty straigtforward). It will then open PRs with the upgraded lock file on a regular interval. An example of such a PR would be JabRef/JabRefOnline#2598. |
Does uv support dealing with package hashes - assuming we want checking them for security purposes ? |
Yes, here is an excerpt from the lock file, which contains the hashes as you can see:
If you want to use this info in sage-the-distro, I can see two paths: a) parse the uv lock file as part of |
How about putting the following either in docs or in comments somewhere?
once the PR in question is open, it should be explicitly mentioned. |
What's the difference between uv and tox? (also aren't we already using something… (conda?) that support installing exact version of packages anyway? Is it worth introducing another dependency for something that seems like a relatively infrequent thing?) |
uv is 100 times faster, something like this. due to being written in rust. it's increasingly being used instead of pip (also slow), as it can do what it does (and more) |
I've now added a bit of docs around --
On very abstract terms, uv is a package manager and tox a task manager. But uv actually plans to become a universal tool that covers the whole dev process (eg tasks is a planned feature, so is conda support etc).
Sadly not all of these linters are available on conda, like relint. Also I'm planning to use uv for "meson + system dependency" config that doesn't use conda (since many sage devs are not the biggest fan of conda). |
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.
OK. Please make it Positive review.
Thanks! @sagemath/core please install the Renovate app, either by accepting the request I just send or by going to https://github.com/apps/renovate and clicking "Install". Thank you in advance! |
Currently, the linter workflow always uses the latest release of all dependencies. Thus, updates to these linters may result in broken CI (just happened yesterday see #39699).
Here, we use
uv
to lock the dependency of all tools used in the linter workflow. The lock file will be automatically updated using renovate.Also remove
pycodestyle
as by now it can be replaced by ruff.(The lock file also contains all sage dependencies and thus may be used to replace the manual updates of python deps in sage-the-distro @dimpase)
📝 Checklist
⌛ Dependencies