From c74a1404fe25f32d8291afa9e2ab3d0e645d136e Mon Sep 17 00:00:00 2001 From: Mathieu Kniewallner Date: Mon, 19 Aug 2024 23:50:59 +0200 Subject: [PATCH 1/3] docs(integration): use tabs for platforms --- docs/guides/integration/github.md | 76 +++++++++++++++++++------------ 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/docs/guides/integration/github.md b/docs/guides/integration/github.md index 37459298834d0..ff14f19322cfd 100644 --- a/docs/guides/integration/github.md +++ b/docs/guides/integration/github.md @@ -2,47 +2,67 @@ ## Installation -uv installation differs depending on the platform. +uv installation differs depending on the platform: -### Unix +=== "Unix" -```yaml title="example.yml" -name: Example on Unix + ```yaml title="example.yml" + name: Example on Unix -jobs: - uv-example-linux: - name: python-linux - runs-on: ubuntu-latest + jobs: + uv-example-linux: + name: python-linux + runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + steps: + - uses: actions/checkout@v4 - - name: Set up uv - # Install uv using the standalone installer - run: curl -LsSf https://astral.sh/uv/install.sh | sh -``` + - name: Set up uv + # Install latest uv version using the installer + run: curl -LsSf https://astral.sh/uv/install.sh | sh + ``` -### Windows +=== "macOS" -```yaml title="example.yml" -name: Example on Windows + ```yaml title="example.yml" + name: Example on macOS -jobs: - uv-example-windows: - name: python-windows - runs-on: windows-latest + jobs: + uv-example-macos: + name: python-macos + runs-on: macos-latest - steps: - - uses: actions/checkout@v4 + steps: + - uses: actions/checkout@v4 - - name: Set up uv - # Install uv using the standalone installer - run: irm https://astral.sh/uv/install.ps1 | iex - shell: powershell -``` + - name: Set up uv + # Install latest uv version using the installer + run: curl -LsSf https://astral.sh/uv/install.sh | sh + ``` + +=== "Windows" + + ```yaml title="example.yml" + name: Example on Windows + + jobs: + uv-example-windows: + name: python-windows + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up uv + # Install latest uv version using the installer + run: irm https://astral.sh/uv/install.ps1 | iex + shell: powershell + ``` ### Using a matrix +If you need to support multiple platforms, you can use a matrix: + ```yaml title="example.yml" name: Example From 9e33f6b07c20900ee525ac3f0c955cf7d82778cd Mon Sep 17 00:00:00 2001 From: Mathieu Kniewallner Date: Mon, 19 Aug 2024 23:51:34 +0200 Subject: [PATCH 2/3] docs(integration): mention pin best practices --- docs/guides/integration/github.md | 57 +++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/docs/guides/integration/github.md b/docs/guides/integration/github.md index ff14f19322cfd..6728a16bf2169 100644 --- a/docs/guides/integration/github.md +++ b/docs/guides/integration/github.md @@ -59,6 +59,63 @@ uv installation differs depending on the platform: shell: powershell ``` +It is considered best practice to pin to a specific uv version, e.g., with: + +=== "Unix" + + ```yaml title="example.yml" + name: Example on Unix + + jobs: + uv-example-linux: + name: python-linux + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up uv + # Install a specific uv version using the installer + run: curl -LsSf https://astral.sh/uv/0.2.37/install.sh | sh + ``` + +=== "macOS" + + ```yaml title="example.yml" + name: Example on macOS + + jobs: + uv-example-macos: + name: python-macos + runs-on: macos-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up uv + # Install a specific uv version using the installer + run: curl -LsSf https://astral.sh/uv/0.2.37/install.sh | sh + ``` + +=== "Windows" + + ```yaml title="example.yml" + name: Example on Windows + + jobs: + uv-example-windows: + name: python-windows + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up uv + # Install a specific uv version using the installer + run: irm https://astral.sh/uv/0.2.37/install.ps1 | iex + shell: powershell + ``` + ### Using a matrix If you need to support multiple platforms, you can use a matrix: From c039e645c007c2d4ff57892f05a3b68a54cda501 Mon Sep 17 00:00:00 2001 From: Mathieu Kniewallner Date: Tue, 20 Aug 2024 00:00:32 +0200 Subject: [PATCH 3/3] chore(rooster): add `github.md` --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 3b0d476ff0765..054720b5172c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -68,6 +68,7 @@ version_files = [ "crates/uv/Cargo.toml", "crates/uv-version/Cargo.toml", "docs/guides/integration/pre-commit.md", + "docs/guides/integration/github.md", ] [tool.uv]