template-fastapi-react
template-fastapi-react copied to clipboard
chore: use UV as package manager
Why is this pull request needed?
This pull request is mainly for testing out UV as an alternative for poetry
What does this pull request change?
Replace poetry with UV
Makes the CI slightly faster, and setting up a new python environment much faster.
without uv and cache:
uv with cache:
Issues related to this change:
Let's try it! How is Snyk support? 😛
Heh! Good question. I have lost access to the Snyk team. UV follows the standard specification for dependencies in pyproject.toml (https://packaging.python.org/en/latest/specifications/pyproject-toml/), but Poetry has its own syntax. Knowing snyk I am betting they don't support it..
@soofstad @mariuswinger I guess you two are best equipped to see if this is something we'd like to do.
Main issue was with UV changing values in lock file on release every release, which screwed with our CI/release flow (it think this was it). But a lot has happen with UV since this PR was created. Could have another look.
Main issue was with UV changing values in lock file on release every release, which screwed with our CI/release flow (it think this was it). But a lot has happen with UV since this PR was created. Could have another look.
Correct, another issue is the lack of support for UV by dependabot. https://docs.astral.sh/uv/guides/integration/dependency-bots/#dependabot
Too many conflicts, and since dependabot still hasn't caught up, we'll close this for now.
Was looking into this for another project. The solution was to add dynamic = ["version"] in pyproject.toml.
This indicates that version is not defined by pyproject.toml. But "by something else", in our case, a tag in git. And will also not be included in uv.lock
This kind of makes sense. There is not really a good cause for having the version in the pyproject.toml file, unless you are publishing a python package. And if you are, you will not need a lock file, as the package should be compatible with any dependency version meeting the pyrpoject.toml defined range.