-
Notifications
You must be signed in to change notification settings - Fork 287
Migrate to uv #3181
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
base: main
Are you sure you want to change the base?
Migrate to uv #3181
Conversation
|
I've not used uv before. I was playing with a little bit and noticed one things thats different between it and poetry, and I can't decide if it's an advantage or disadvantage. scipy supports only 3 Python versions, so with Poetry, we could only support 3 Python versions, since poetry guarantees only one version of dependencies. In uv, it will install different versions of scipy based on which version of python you're using. That has the advantage of supporting more versions of python, but the disadvantage of changing dependencies based on environment. We could get the same behavior with uv by pinning the version of scipy, though. |
It should be using the version in the lockfile (1.15.3 currently). What versions of python were you using? |
I should have noted that I ran It does look like there's some configuration that would limit the number of versions |
|
|
||
| ```console | ||
| $ sudo apt update | ||
| $ sudo apt install python3 python3-pip |
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.
python3-pip can removed, right?
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.
yeah. I was also wondering about python- uv will download use it's own if there's none installed locally, so it technically isn't required? Just not sure if there's some hidden downside or something that we need a global python for
This migrates CI, readthedocs, and eventually the build documentation to use uv.
uv should have a better experience for both experienced devs and newcomers. The current documented build process has users installing packages globally, which is prone to package conflicts. It also uses poetry only for dependency resolution and a separate step to generate the requirements.txt for readthedocs. Using uv for everything makes building easy - after installing uv,
uv run make htmlwill install dependencies into a local venv and build like normal, and dependencies can be managed directly through pyproject.toml. uv will also automatically download and use a compatible python version if the local install is not compatible with the project. I've kept my system python at 3.12 because frc-docs needed it to build; with this that isn't necessary.This isn't 100% done, I wanted to open this and see if this was something we'd be willing to do.
Readthedocs documents using uv to install build dependencies. I've also tested it and it looks to be working fine: https://app.readthedocs.org/projects/rzblue-frc-docs/builds/
I've migrated the lockfile using
migrate-to-uv, and generated a new requirements.txt. once hashes and comments are removed and contents sorted, the old and new files are line-for-line identical save for a one-line difference that doesn't change behavior (poetry includesfonttoolsandfonttools[woff]as well as their dependencies, while uv just resolvesfonttools[woff]'s extra dependencies). I've also added a CI job to generate and make sure it's up to date.I'd also like to make corresponding updates to frc-docs-translations for consistency and to eventually remove the requirements.txt. In order to do that without needing to merge PRs in lockstep, I've left the requirements.txt in this repo for the time being. Once this is merged, a PR can be made to -translations, and after that is merged, requirements.txt can be removed.
This also updates everything to ubuntu 24.04.