yezz123/setup-uv

Docs request: why use this over `pip install uv`

jamesbraza opened this issue · 2 comments

Can you add to the README.md why one would want to use this GitHub Action over just:

steps:
  - uses: actions/checkout@v4
  - uses: actions/setup-python@v5
    with:
      python-version: 3.12
  - run: pip install uv
  # Or
  - run: pip install uv==0.2.22

Like can you add what are the gains with this GHA vs a native pip install?

Hey @jamesbraza thanks for raising this, here is a simple answer:

Benefits of using setup-uv action vs. native pip install:

Faster installation: The setup-uv action installs uv, a fast Python package installer and resolver. It's significantly quicker than pip, especially for larger projects with complex dependencies.

Check: https://github.com/yezz123/authx/actions/runs/9894689417/job/27332811035

Improved caching: The setup-uv action includes built-in caching mechanisms, which can significantly speed up subsequent runs of your workflow.

Reduced disk space usage: uv is more efficient in managing disk space, which can benefit CI environments with limited storage.

Built-in virtual environment management: uv includes features for managing virtual environments, simplifying your workflow setup.

By using the setup-uv action instead of a native pip install, we gain these advantages, leading to faster, more reliable, and more efficient CI/CD pipelines.

Thanks for clarifying, though most of what you stated applies to uv vs pip, and is unrelated to this GitHub Action. Can you detail the benefits specific to setup-uv (and not uv in general)?

The setup-uv action includes built-in caching mechanisms, which can significantly speed up subsequent runs of your workflow.

I use cache aspect of setup-python (docs). How does setup-uv do caching?

What I mean is if one has this:

  - uses: actions/setup-python@v5
    with:
      cache: pip
  - run: pip install uv
  - run: uv pip install ...

And migrates to this:

  - uses: actions/setup-python@v5
  - uses: yezz123/setup-uv@v4
  - run: uv pip install ...

What are the gains there?