Skip to content
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

Replace pip with uv for test workflow #877

Merged
merged 32 commits into from
Feb 12, 2025
Merged

Replace pip with uv for test workflow #877

merged 32 commits into from
Feb 12, 2025

Conversation

LucaMarconato
Copy link
Member

Giving a try to using uv instead of pip for the test workflow. I did't edit the release and docker workflows since they are run rarely and trying to make them faster would not pay off.

I took inspiration from https://github.com/vitessce/vitessce-python/pull/390/files. Note that I removed the pip caching mechanism in this commit fac7848. It could be that having uv + caching leads to better results.

Copy link

codecov bot commented Feb 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.91%. Comparing base (4df1912) to head (ef7d357).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #877   +/-   ##
=======================================
  Coverage   91.91%   91.91%           
=======================================
  Files          48       48           
  Lines        7388     7388           
=======================================
  Hits         6791     6791           
  Misses        597      597           

@LucaMarconato
Copy link
Member Author

uv without caching is already faster!

I'll give a try to uv + caching now.

@LucaMarconato
Copy link
Member Author

I'm having problems with optional dependencies. It seems that they are not correctly cached.

@LucaMarconato
Copy link
Member Author

Ok I made it work. Caching doesn't help with pre-built wheels, re-downloading every time is as fast (also explained here https://github.com/astral-sh/setup-uv#disable-cache-pruning).

I will disable the cache. This PR will still bring a 4-fold decrease in the time required to setup the env.

@LucaMarconato
Copy link
Member Author

I tried using uv instead of pip in readthedocs using the approach described here: astral-sh/uv#10074, but it didn't seem to speed up things (strange tbh, but ok, 2 min is already fast compared to the time to run tests).

I therefore went back to pip for readthedocs.

@LucaMarconato LucaMarconato marked this pull request as ready for review February 12, 2025 19:59
@LucaMarconato LucaMarconato enabled auto-merge (squash) February 12, 2025 20:00
@LucaMarconato
Copy link
Member Author

CC @timtreis (worth moving to uv also in spatialdata-plot etc). It's very easy to move to uv (I did many experiments with caching here, but in the end what I recommend is what shown in the PR diff).

@LucaMarconato LucaMarconato merged commit f7082d9 into main Feb 12, 2025
7 checks passed
@LucaMarconato LucaMarconato deleted the uv branch February 12, 2025 20:07
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