Skip to content

Commit a938985

Browse files
committed
Add support for pep440 version identifiers
1 parent 2d49baf commit a938985

File tree

6 files changed

+860
-6
lines changed

6 files changed

+860
-6
lines changed

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,23 @@ jobs:
8282
env:
8383
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
8484

85+
test-pep440-version:
86+
runs-on: ubuntu-latest
87+
steps:
88+
- uses: actions/checkout@v4
89+
- name: Install version 0.4.30
90+
id: setup-uv
91+
uses: ./
92+
with:
93+
version: ">=0.4.25,<0.5"
94+
- name: Correct version gets installed
95+
run: |
96+
if [ "$UV_VERSION" != "0.4.30" ]; then
97+
exit 1
98+
fi
99+
env:
100+
UV_VERSION: ${{ steps.setup-uv.outputs.uv-version }}
101+
85102
test-pyproject-file-version:
86103
runs-on: ubuntu-latest
87104
steps:
@@ -475,6 +492,7 @@ jobs:
475492
- test-default-version
476493
- test-specific-version
477494
- test-semver-range
495+
- test-pep440-version
478496
- test-pyproject-file-version
479497
- test-malformed-pyproject-file-fallback
480498
- test-uv-file-version

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ For an example workflow, see
6666
### Install a version by supplying a semver range
6767

6868
You can specify a [semver range](https://github.com/npm/node-semver?tab=readme-ov-file#ranges)
69+
or [pep440 identifier](https://peps.python.org/pep-0440/#version-specifiers)
6970
to install the latest version that satisfies the range.
7071

7172
```yaml
@@ -82,6 +83,13 @@ to install the latest version that satisfies the range.
8283
version: "0.4.x"
8384
```
8485

86+
```yaml
87+
- name: Install a pep440-specifier-satisfying version of uv
88+
uses: astral-sh/setup-uv@v5
89+
with:
90+
version: ">=0.4.25,<0.5"
91+
```
92+
8593
### Install a required-version
8694

8795
You can specify a [required-version](https://docs.astral.sh/uv/reference/settings/#required-version)

0 commit comments

Comments
 (0)