Skip to content

Conversation

@rzblue
Copy link
Member

@rzblue rzblue commented Nov 20, 2025

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 html will 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 includes fonttools and fonttools[woff] as well as their dependencies, while uv just resolves fonttools[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.

@sciencewhiz
Copy link
Collaborator

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.

@rzblue
Copy link
Member Author

rzblue commented Nov 26, 2025

In uv, it will install different versions of scipy based on which version of python you're using.

It should be using the version in the lockfile (1.15.3 currently). What versions of python were you using?

@sciencewhiz
Copy link
Collaborator

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 uv lock --upgrade to see how future use of uv will work. That's when it did the split. As this PR is, it does recreate poetry's dependencies.

It does look like there's some configuration that would limit the number of versions --fork-strategy fewest, but based on the documentation not eliminate it. I haven't played around with that option yet.

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.

2 participants