-
Notifications
You must be signed in to change notification settings - Fork 74
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
installation: Switch to UV for dependency management #3294
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3294 +/- ##
==========================================
- Coverage 90.48% 90.15% -0.33%
==========================================
Files 472 463 -9
Lines 59276 58720 -556
Branches 5637 5627 -10
==========================================
- Hits 53633 52937 -696
- Misses 4205 4345 +140
Partials 1438 1438 ☔ View full report in Codecov by Sentry. |
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.
Could you please also migrate the makefile? Maybe with a phony target that checks whether uv is installed, and directs developers to installation instructions. The goal would be for make tests to be runnable outside of an activated venv
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.
Thanks a lot for the PR!
A few quick questions/requests I have:
- Can we move the removed requirements.txt in the pyproject.toml? That way we can still track them with dependabot, and also this is the only change that's missing to still support virtualenv. I'd personally would like to still continue supporting venv if possible, as for now it is still way more popular than uv.
- Do you think we can automate the update of uv.lock with dependabot? Currently, we get daily automated updates of dependencies with dependabot, and it would quite annoying to have to update the
uv.lock
manually every time. - We will probably have to test pythonpublish after the PR gets merged. Just ping me and I'll try to run it to see if it works or not, but looking at it this should be fine I think.
@@ -1 +0,0 @@ | |||
-e .[gui,jax,riscv,wgpu,onnx,dev] |
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.
Are these dependencies moved to uv.lock
?
I feel that this should rather go to the .toml
file so that we can track them with dependabot, it was also bad before when they were here, but at least we had a list of them.
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.
No, these are in the pyproject.toml, and are installed via --all-extras
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.
We've been using uv
for our quantum stack recently and it seems to work nicely. I have a couple of comments:
- When to use
uv run
. It seems in the test ci you are activating the venv anyway so I don't see the reason to usuv run
everywhere. - If you did want to use
uv run
everywhere, you would need to make the filecheck tests use it (i.e. everyxdsl-opt
should beuv run xdsl-opt
). You can get most of these by modifyinglit.cfg
. I'm not sure if this is actually worth it? - I've always had problems with the
wgpu
package and had to manually remove it. Will there be an easy way to do that with the new set up? uv
should be added toflake.nix
(I can do this afterwards if necessary)
Have just resolved the merge conflicts, revealing two final issues:
|
If you have |
Almost there! The three things I see that are still not working are:
If you give me commit access I'm happy to do point 3. quicky |
b91b9be
to
2c18b11
Compare
This reverts commit b91b9be.
Thanks again @EdmundGoodman ! |
Summary
Adopt
uv
for dependency management, replacing the existingpip
approach.Motivation
uv
is developed by Astral, who also wroteruff
which is already in use in xDSL CI pipelines. It offers the benefits of much faster dependency resolution and installation, along with leveraging the more modernpyproject.toml
configuration format defined in PEPs 518 and 618.Requested by @superlopuh
Changes
This replacement requires the following changes:
venv
target of the Makefile to create the virtual environmentuv
as opposed topip
, including testingci-core.yaml
ci-mlir.yaml
ci-notebooks.yaml
ci-pyright-fails.yaml
code-formatting.yaml
jupyterlite.yaml
(cannot easily be spawned due to workflow triggers)pythonpublish.yaml
(cannot easily be spawned due to required secrets)release-notes.yaml
(requires no changes)Post-merge checklist
Once merged, we should check the following things:
uv
and instructions are clearupdate-bot
workflow creates helpful and correct PRs in a timely manner