-
Notifications
You must be signed in to change notification settings - Fork 601
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
Introducing tox-uv #2667
base: main
Are you sure you want to change the base?
Introducing tox-uv #2667
Conversation
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.
The result is quite interesting, the uv indeed quicker than pip. I run 6 times for asgi and wsgi, and got these results. Maybe the times I try not enough, but we could roughly say this is a good optimization.
WSGI Results
Tool | Run | Setup Time | Command Time | Total Time |
---|---|---|---|---|
pip | 1 | 0.19s | 25.32s | 25.65s |
pip | 3 | 0.34s | 23.51s | 23.99s |
pip | 4 | 0.05s | 24.17s | 24.35s |
uv | 2 | 4.50s | 1.68s | 6.31s |
uv | 5 | 0.71s | 0.97s | 1.81s |
uv | 6 | 0.04s | 1.03s | 1.19s |
WSGI Average Times:
- pip: 24.66s
- uv: 3.10s (excluding first run: 1.50s)
ASGI Results
Tool | Run | Setup Time | Command Time | Total Time |
---|---|---|---|---|
pip | 2 | 0.05s | 25.21s | 25.39s |
pip | 3 | 0.05s | 22.62s | 22.80s |
pip | 4 | 0.05s | 20.53s | 20.71s |
uv | 1 | 1.12s | 14.28s | 15.53s |
uv | 5 | 0.05s | 8.48s | 8.67s |
uv | 6 | 0.05s | 8.04s | 8.22s |
ASGI Average Times:
- pip: 22.97s
- uv: 10.81s (excluding first run: 8.45s)
Yeah got similar results here. Thanks for that @zhihali. Greatly appreciated. The ASGI is slower because I left the test requirements install using pure pip purposely to see the difference |
a8f33db
to
cfa4e62
Compare
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.
I like this, is there a reason you stopped converting halfway tox.ini?
No big reason. Just wanted to get some opinions before moving forward with all the changes |
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.
There are also docs
and docker-tests
environments that can be converted
uv makes pip install faster. It works like this:
uv pip install
and we can have tests running faster locally and in CI. The tool is from the creators ofruff
.The main improvement I see here is the Dependency caching and fast resolution of packages during pip install. We can benefit from this for local development to avoid slow tests, mainly the git clones in contrib tests.
This PR also introduces the usage of tox-uv which is a tox plugin that supports venv runner with uv.
At this first moment, I'm proposing an opt-in usage, so you need to pass an environment variable to make use of the UV feature.