-
Notifications
You must be signed in to change notification settings - Fork 44
Use uv for managing dependencies #923
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
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #923 +/- ##
=======================================
Coverage 99.63% 99.63%
=======================================
Files 103 103
Lines 8238 8238
=======================================
Hits 8208 8208
Misses 30 30 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
There's a potential problem when using This has been reported as astral-sh/uv#12481 but it was closed by This has also been discussed in explosion/spaCy#13747 where it was suggested to call e.g. OTOH, this only affects development installs (and currently Docker images that also use |
|
Note to self: The |



This PR switches to uv for dependency management instead of Poetry.
Included changes:
pyproject.tomlto work withuv; for example, declare the dev dependencies using standard[dependency-groups]sectionuvcommands for development installsuvinstead of Poetryuvinstead of Poetryflake8to skip e.g..venvdirectory (uvwill create the virtual environment there by default)Some notes:
uvdoesn't have a command for permanently activating the venv like the oldpoetry shellor the newer equivalenteval $(poetry env activate). It is recommended to useuv runevery time, but I think that's cumbersome. However, the venv can simply be activated usingsource .venv/bin/activateso I recommended that in the README. (There is an open issue about this, but it seems that implementing this properly to handle all edge cases is a bit difficult, so the developers hesitate to do it.)ghcr.io/astral-sh/uv:python3.12-bookworm-slim. An alternative would have been to keep the vanilla base imagepython:3.12-slim-bookwormand just installuvwithin that.astral-sh/setup-uvis handling all caching of dependencies, but I haven't verified that it works in a sane way...Overall,
uvseems a bit faster than Poetry. For example, the GitHub Actions run completes in less than 3 minutes, when it used to take a bit more than 3 minutes (though with a lot of variation).In the future, using
uvshould enable better management of PyTorch variants when we add it as a dependency (for example for the EBM backend - see #914 ).Closes #919