Switch to uv
for package management
#1720
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Warning
This PR is not yet ready to be merged. I mainly created this as an experiment,
a lot of the reviewing the updates of dependencies hasn't happened yet.
Proposed changes
uv
over hand-lockedrequirements.txt
This PR does NOT attempt to do a python upgrade or django upgrade, but rather bump the minor/patch versions of most packages used.
TODO
Brief description of rationale
Let me just prefix this by saying I did this because bumping dependencies for
Django
and it's related packages is annoying to do by hand.The Problem
Hand-locking a
requirements.txt
is painful, and annoying when trying to upgrade dependencies due to resolving dependency version conflicts between packages. Just using version specifiers (>=
,<
, etc.) fixes this problem, but introduces the possibility of using difference packages during development vs during deployment. This is what build frontends (such asuv
,pipenv
, and/orpoetry
(not to be confused with the poetry build backend)) aim to fix. They allow using version specifiers, and create a lock file with pinned versions of each dependency (including transitive ones)!Why uv?
The problem with tools like
poetry
andpipenv
is that creating this lock file, or installing from the lock file is annoyingly slow.uv
is written in rust, and is much more snappy at resolving dependency matches, installs packages/wheels faster, and gives better error messages when a dependency conflict arises.Another huge benefit of
uv
is that production scripts don't need to upgraded (much).uv
can convert auv.lock
into arequirements.txt
automatically (including pinned transitive dependencies, which are dependencies of dependencies):Note
The produced
requirements.txt
is platform dependent, and as such is not checked into git