mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 18:38:21 +00:00
docs(integration): show pinned version example on GH Actions (#6234)
## Summary Suggestion from https://github.com/astral-sh/uv/pull/6216#discussion_r1722204667. I did not think of a clean way to avoid repetition, so tried to use tabs for the platforms to only show the pin recommendation in one additional block.  ## Test Plan Local run of the documentation.
This commit is contained in:
parent
5b74754140
commit
a1f98e240a
2 changed files with 106 additions and 28 deletions
|
@ -2,47 +2,124 @@
|
|||
|
||||
## 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
|
||||
```
|
||||
|
||||
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:
|
||||
|
||||
```yaml title="example.yml"
|
||||
name: Example
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue