-
Notifications
You must be signed in to change notification settings - Fork 559
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
Use uv in CI to speed-up requirements install #2072
Conversation
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2072 +/- ##
==========================================
+ Coverage 82.64% 82.95% +0.30%
==========================================
Files 102 102
Lines 9475 9475
==========================================
+ Hits 7831 7860 +29
+ Misses 1644 1615 -29 ☔ 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.
Awesome, love uv
!
uv venv | ||
|
||
- name: Install dependencies | ||
run: uv pip install "huggingface_hub[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.
You should be able to do uv pip install --system "huggingface_hub[dev] @ ."
on the latest release, if you want to remove the virtualenv (per the PR summary), but using a virtualenv is also good.
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 @charliermarsh! I just saw the issue has been merged on uv's repo 🎉. Thanks for the direct ping here ❤️
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.
Of course! It's pretty new so of course ping if you see issues with it.
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.
Nice! We'll also do something similar in transformers! Speeds up a lot the resolution as well Related PR: huggingface/transformers#29202
Quick benchmarks show it saves around 30s-40s per workflow (both for code quality and CI tests)
Note: running
uv
instead ofpip
in Github CI is not yet a first-class citizen but should be the case once astral-sh/uv#1526 is addressed. This is why we need to source env in each step.