astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.07k stars 597 forks source link

Recommend pipe fail option on GitHub actions uv install? #6871

Open notatallshaw opened 2 weeks ago

notatallshaw commented 2 weeks ago

I'd be happy to open a PR to update the docs, but it wasn't clear to me just yet if this should be recommended.

I set up a github workflow in my company's local github enterprise install with the following step taken from the docs:

 - name: Set up uv
   # Install latest uv version using the installer
   run: curl -LsSf https://astral.sh/uv/install.sh | sh

However, what I found was if the curl command fails this step can still succeed, this can happen because of either curl not being available, some network issue, or something else. I ended up replacing this step with:

  - name: Set up uv
    shell: bash
    run: | # Install latest uv version using the installer
      set -o pipefail
      curl -LsSf https://astral.sh/uv/install.sh | sh

So if the curl command fails it produces an error.

Do you think the docs should be updated in general? Or do you think this is enough of an edge case not to make the instructions overly complicated?

pplmx commented 2 weeks ago

I also encountered this issue while building from the Dockerfile. When running the command RUN curl -LsSf https://astral.sh/uv/install.sh | sh, it failed. However, the next build skips this layer.

zanieb commented 1 week ago

Yeah we should set pipefail, PR welcome.

@pplmx I'd highly recommend copying from our Docker image instead of using curl to install (this is covered in the docs too)