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

✨ uv #73

Merged
merged 4 commits into from
Feb 22, 2024
Merged

✨ uv #73

merged 4 commits into from
Feb 22, 2024

Conversation

juftin
Copy link
Owner

@juftin juftin commented Feb 21, 2024

This PR includes new (non-default) support for uv as a dependency resolver and installer. Now we have a few options:

  • Choose between pip-compile and uv for dependency resolvers.
  • Choose between pip, pip-sync, and uv for dependency installers

Closes #72

uv is a drop in replacement for pip-compile with a much faster resolver written in rust. If you'd like to use uv instead of pip-compile / pip you can do so with these options:

  • pyproject.toml

    [tool.hatch.envs.<envName>]
    type = "pip-compile"
    pip-compile-resolver = "uv"
    pip-compile-installer = "uv"
  • hatch.toml

    [envs.<envName>]
    type = "pip-compile"
    pip-compile-resolver = "uv"
    pip-compile-installer = "uv"

@juftin juftin force-pushed the feat/uv branch 2 times, most recently from 25af09d to b2a8e4f Compare February 21, 2024 06:48
Copy link

codecov bot commented Feb 21, 2024

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (4badcf9) 95.56% compared to head (ce35c4c) 95.81%.
Report is 1 commits behind head on main.

Files Patch % Lines
hatch_pip_compile/resolver.py 90.47% 3 Missing and 1 partial ⚠️
tests/conftest.py 90.90% 1 Missing and 1 partial ⚠️
hatch_pip_compile/lock.py 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #73      +/-   ##
==========================================
+ Coverage   95.56%   95.81%   +0.24%     
==========================================
  Files          16       18       +2     
  Lines         857      956      +99     
  Branches      139      160      +21     
==========================================
+ Hits          819      916      +97     
- Misses         24       25       +1     
- Partials       14       15       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@juftin
Copy link
Owner Author

juftin commented Feb 21, 2024

With a warm cache on this project switching from pip-compile to uv goes from 26.3s to 5.8s for hatch-pip-compile --all. There are probably more savings to be had if I can use uv as an installer here and also use its --python option

@juftin juftin marked this pull request as ready for review February 21, 2024 16:17
@juftin juftin force-pushed the feat/uv branch 7 times, most recently from e8e3a7f to b75a26f Compare February 22, 2024 03:05
@juftin juftin merged commit 7ac1068 into main Feb 22, 2024
12 checks passed
@juftin juftin deleted the feat/uv branch February 22, 2024 04:32
@juftin
Copy link
Owner Author

juftin commented Feb 22, 2024

🎉 This PR is included in version 1.11.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use uv as locker / installer?
1 participant