drivendataorg / zamba

A Python package for identifying 42 kinds of animals, training custom models, and estimating distance from camera trap videos
https://zamba.drivendata.org/docs/stable/
MIT License
107 stars 25 forks source link

Use uv for CI #311

Closed ejm714 closed 6 months ago

ejm714 commented 6 months ago

Swaps in drivendataorg/setup-python-uv-action and installs our dependencies with uv (without caching).

Closes #312

netlify[bot] commented 6 months ago

Deploy Preview for silly-keller-664934 ready!

Name Link
Latest commit be58fb63b41b9baccf041a4fe89c38a89fc335f7
Latest deploy log https://app.netlify.com/sites/silly-keller-664934/deploys/65ef68f61764c10008799982
Deploy Preview https://deploy-preview-311--silly-keller-664934.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

github-actions[bot] commented 6 months ago

🚀 Deployed on https://deploy-preview-311--silly-keller-664934.netlify.app

jayqi commented 6 months ago

I think densepose fails to install because they do a build-time check of whether torch is installed, which doesn't work with modern standard of isolated builds. It looks like uv doesn't currently support installing without build isolation: https://github.com/astral-sh/uv/issues/1715

(The discussion in the thread is also a good summary explaining the history and the why of packages behaving like densepose.)

jayqi commented 6 months ago

@ejm714 I just thought of a possible gotcha in how uv and setup-python-uv-action is set up. It's possible that the virtual environment created by setup-python-uv-action doesn't have pip installed in it, and so when you run pip install densepose, it's using the system pip. You might want to print out which pip and/or run uv pip install pip before trying to install densepose.

jayqi commented 6 months ago

uv 0.1.16, released yesterday, now supports --no-build-isolation so I think you should be able to use it to install densepose.

https://github.com/astral-sh/uv/releases/tag/0.1.16

codecov[bot] commented 6 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.6%. Comparing base (dc87a8a) to head (be58fb6).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #311 +/- ## ====================================== Coverage 87.6% 87.6% ====================================== Files 26 26 Lines 2178 2178 ====================================== Hits 1908 1908 Misses 270 270 ```
ejm714 commented 6 months ago

In the end, looks like a 5-10 min speed up which is small in a relative sense. Tests are still the slowest part of this and we stick to pip for the installation tests (due to transitive dependencies) so overall run is still at least 30 min.

Ready for a final look @pjbull or @jayqi