-
Notifications
You must be signed in to change notification settings - Fork 924
Switch from venv/pip to uv #3148
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
Conversation
9c272ae to
02bd0a1
Compare
erikerlandson
left a comment
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.
LGTM
sgoggins
left a comment
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.
@JohnStrunk : Candidly I am outside my element for being able to provide a meaningful review here.
I do understand, though, that this will stabilize our dependencies and make them easier to maintain in one place. And there are other benefits you outline.
I am inclined to merge this into dev and test it vigorously.
@Ulincsys : Any thoughts?
- Replaces setup.py with pyproject.toml - Creates .python-version file that will control the python version that uv uses in the virtualenv Signed-off-by: John Strunk <[email protected]>
Signed-off-by: John Strunk <[email protected]>
Signed-off-by: John Strunk <[email protected]>
Update GitHub workflow to include a new job that checks the uv lockfile, ensuring it is up to date by installing uv and running the lock check command. Signed-off-by: John Strunk <[email protected]>
Added post_create_environment job to generate requirements.txt using uv, and updated python install method to use the generated requirements file. Signed-off-by: John Strunk <[email protected]>
Signed-off-by: John Strunk <[email protected]>
|
@sgoggins I've made the doc changes. This should be ready. |
sgoggins
left a comment
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.
LGTM@!
Summary
This switches from using venv and pip for managing the python dependencies to using uv
Benefits
uv.lock) that includes the exact versions of all dependencies for the project, not just direct ones. This ensures that the environment is reproducible.setup.pyscripts were called led to different package versions being installed)Changes
pyproject.toml, and allsetup.pyfiles have been removed. I did my best to migrate the metadata across where possible. setuptools is still used for the actual install..python-version. uv will install this version of python when it creates the environment, so it no longer matters what python version is installed on the user's machine.augur/tasks/data_analysishave been pulled into the main project. I suspect this may be controversial, and I can separate them back out if necessary.Assuming you all are good w/ this change, I'd like to update the docs prior to merge.
To try this out, the docker version should work as before, but if you're running outside of docker, you should:
uv:$ pip install --user uvuv run, e.g.,$ uv run augur backend start.It's no longer necessary to manage the virtual environment or use pip directly, though you probably want to delete your old venv prior to starting w/ uv.
To do