Skip to content

Switch to using uv for Python dependencies#1642

Draft
robhudson wants to merge 3 commits intomainfrom
move-to-uv
Draft

Switch to using uv for Python dependencies#1642
robhudson wants to merge 3 commits intomainfrom
move-to-uv

Conversation

@robhudson
Copy link

@robhudson robhudson commented Apr 10, 2025

This is a draft PR to explore the idea and discuss.

The workflow then becomes...

  1. just check-requirements which calls uv pip list --outdated

    This is for previewing what the next command may update or not...

    (See note on pinning packages below.)

    • If a version bump is within a minor release (e.g. django 4.2.19 to django 4.2.20), we don't need to manually change anything, the next step will upgrade this.
    • If a version bump includes a minor or major version number, we update the pyproject.toml file if we want this.
  2. just compile-requirements which calls uv lock --upgrade

    This actually updates the uv.lock file with the latest updates. Diffing this is a little less scannable than requirements.txt files but okay.

Note on pinning packages

I'd also like to point out the pyproject.toml's format of dependencies, using ~=. For example django~=5.2 will allow any dot releases, but not anything above 5.2.x. This is nicer than django>=5.2 as django 6.0 would qualify once that got released. Most dependencies I've tried to use this. If we need to hard pin we can do that with == in the pyproject.toml still.

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.

1 participant