mirror of
https://github.com/astral-sh/setup-uv.git
synced 2026-05-01 02:26:30 +00:00
Compare commits
1 Commits
main
...
dependabot
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d42b6b2cf7 |
4
.github/workflows/release-drafter.yml
vendored
4
.github/workflows/release-drafter.yml
vendored
@@ -19,8 +19,6 @@ jobs:
|
|||||||
pull-requests: read
|
pull-requests: read
|
||||||
steps:
|
steps:
|
||||||
- name: 🚀 Run Release Drafter
|
- name: 🚀 Run Release Drafter
|
||||||
uses: release-drafter/release-drafter@5de93583980a40bd78603b6dfdcda5b4df377b32 # v7.2.0
|
uses: release-drafter/release-drafter@139054aeaa9adc52ab36ddf67437541f039b88e2 # v7.1.1
|
||||||
with:
|
|
||||||
commitish: ${{ github.sha }}
|
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
77
.github/workflows/release.yml
vendored
77
.github/workflows/release.yml
vendored
@@ -11,86 +11,31 @@ on:
|
|||||||
permissions: {}
|
permissions: {}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
validate-release:
|
|
||||||
name: Validate release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- name: Validate version and draft release
|
|
||||||
env:
|
|
||||||
GH_REPO: ${{ github.repository }}
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
VERSION: ${{ inputs.version }}
|
|
||||||
TAG: v${{ inputs.version }}
|
|
||||||
run: |
|
|
||||||
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then
|
|
||||||
echo "::error::Version must match MAJOR.MINOR.PATCH (e.g., 8.1.0)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
RELEASE_JSON=$(gh release view "$TAG" --json isDraft,targetCommitish 2>&1) || {
|
|
||||||
echo "::error::No release found for $TAG"
|
|
||||||
exit 1
|
|
||||||
}
|
|
||||||
|
|
||||||
IS_DRAFT=$(echo "$RELEASE_JSON" | jq -r '.isDraft')
|
|
||||||
TARGET=$(echo "$RELEASE_JSON" | jq -r '.targetCommitish')
|
|
||||||
|
|
||||||
if [[ "$IS_DRAFT" != "true" ]]; then
|
|
||||||
echo "::error::Release $TAG already exists and is not a draft"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$TARGET" != "$GITHUB_SHA" ]]; then
|
|
||||||
echo "::error::Draft release target ($TARGET) does not match current commit ($GITHUB_SHA)"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
release-gate:
|
|
||||||
# N.B. This name should not change, it is used for downstream checks.
|
|
||||||
name: release-gate
|
|
||||||
needs:
|
|
||||||
- validate-release
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment:
|
|
||||||
name: release-gate
|
|
||||||
steps:
|
|
||||||
- run: echo "Release approved"
|
|
||||||
|
|
||||||
create-deployment:
|
|
||||||
name: create-deployment
|
|
||||||
needs:
|
|
||||||
- validate-release
|
|
||||||
- release-gate
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
environment:
|
|
||||||
name: release
|
|
||||||
steps:
|
|
||||||
- run: echo "Release deployment created"
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
name: Release
|
name: Release
|
||||||
needs:
|
|
||||||
- validate-release
|
|
||||||
- release-gate
|
|
||||||
- create-deployment
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
environment: release
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
- name: Publish release
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
|
with:
|
||||||
|
persist-credentials: false
|
||||||
|
|
||||||
|
- name: Validate version
|
||||||
env:
|
env:
|
||||||
GH_REPO: ${{ github.repository }}
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
VERSION: ${{ inputs.version }}
|
VERSION: ${{ inputs.version }}
|
||||||
TAG: v${{ inputs.version }}
|
|
||||||
run: |
|
run: |
|
||||||
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then
|
if [[ ! "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then
|
||||||
echo "::error::Version must match MAJOR.MINOR.PATCH (e.g., 8.1.0)"
|
echo "::error::Version must match MAJOR.MINOR.PATCH (e.g., 8.1.0)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Publish release
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
TAG: v${{ inputs.version }}
|
||||||
|
run: |
|
||||||
RELEASE_JSON=$(gh release view "$TAG" --json isDraft,targetCommitish 2>&1) || {
|
RELEASE_JSON=$(gh release view "$TAG" --json isDraft,targetCommitish 2>&1) || {
|
||||||
echo "::error::No release found for $TAG"
|
echo "::error::No release found for $TAG"
|
||||||
exit 1
|
exit 1
|
||||||
|
|||||||
48
.github/workflows/test.yml
vendored
48
.github/workflows/test.yml
vendored
@@ -27,8 +27,8 @@ jobs:
|
|||||||
- name: Actionlint
|
- name: Actionlint
|
||||||
uses: eifinger/actionlint-action@7802e0cc3ab3f81cbffb36fb0bf1a3621d994b89 # v1.10.1
|
uses: eifinger/actionlint-action@7802e0cc3ab3f81cbffb36fb0bf1a3621d994b89 # v1.10.1
|
||||||
- name: Run zizmor
|
- name: Run zizmor
|
||||||
uses: zizmorcore/zizmor-action@b1d7e1fb5de872772f31590499237e7cce841e8e # v0.5.3
|
uses: zizmorcore/zizmor-action@71321a20a9ded102f6e9ce5718a2fcec2c4f70d8 # v0.5.2
|
||||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||||
with:
|
with:
|
||||||
node-version-file: .nvmrc
|
node-version-file: .nvmrc
|
||||||
cache: npm
|
cache: npm
|
||||||
@@ -430,49 +430,6 @@ jobs:
|
|||||||
PY
|
PY
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
test-activate-environment-no-project:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
with:
|
|
||||||
persist-credentials: false
|
|
||||||
- name: Create incompatible pyproject.toml
|
|
||||||
run: |
|
|
||||||
cat > pyproject.toml <<'EOF'
|
|
||||||
[project]
|
|
||||||
name = "test-no-project"
|
|
||||||
version = "0.1.0"
|
|
||||||
|
|
||||||
[dependency-groups]
|
|
||||||
dev = [
|
|
||||||
"-e file:///${PROJECT_ROOT}/projects/pkg",
|
|
||||||
]
|
|
||||||
EOF
|
|
||||||
shell: bash
|
|
||||||
- name: Install latest version with no-project
|
|
||||||
id: setup-uv
|
|
||||||
uses: ./
|
|
||||||
with:
|
|
||||||
python-version: 3.13.1t
|
|
||||||
activate-environment: true
|
|
||||||
no-project: true
|
|
||||||
- name: Verify packages can be installed
|
|
||||||
run: uv pip install pip
|
|
||||||
shell: bash
|
|
||||||
- name: Verify output venv is set
|
|
||||||
run: |
|
|
||||||
if [ -z "$UV_VENV" ]; then
|
|
||||||
echo "output venv is not set"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
if [ ! -d "$UV_VENV" ]; then
|
|
||||||
echo "output venv not point to a directory: $UV_VENV"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
UV_VENV: ${{ steps.setup-uv.outputs.venv }}
|
|
||||||
|
|
||||||
test-debian-unstable:
|
test-debian-unstable:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: debian:unstable
|
container: debian:unstable
|
||||||
@@ -1100,7 +1057,6 @@ jobs:
|
|||||||
- test-python-version
|
- test-python-version
|
||||||
- test-activate-environment
|
- test-activate-environment
|
||||||
- test-activate-environment-custom-path
|
- test-activate-environment-custom-path
|
||||||
- test-activate-environment-no-project
|
|
||||||
- test-debian-unstable
|
- test-debian-unstable
|
||||||
- test-musl
|
- test-musl
|
||||||
- test-cache-key-os-version
|
- test-cache-key-os-version
|
||||||
|
|||||||
69
.github/workflows/update-docs.yml
vendored
69
.github/workflows/update-docs.yml
vendored
@@ -1,69 +0,0 @@
|
|||||||
name: "Update docs"
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
tags:
|
|
||||||
- "v*.*.*"
|
|
||||||
|
|
||||||
permissions: {}
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
update-docs:
|
|
||||||
runs-on: ubuntu-24.04-arm
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
pull-requests: write
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
||||||
with:
|
|
||||||
persist-credentials: true
|
|
||||||
- name: Get tag info
|
|
||||||
id: tag-info
|
|
||||||
run: |
|
|
||||||
TAG_NAME="${GITHUB_REF#refs/tags/}"
|
|
||||||
COMMIT_SHA=$(git rev-list -n 1 "$TAG_NAME")
|
|
||||||
echo "tag=$TAG_NAME" >> "$GITHUB_OUTPUT"
|
|
||||||
echo "sha=$COMMIT_SHA" >> "$GITHUB_OUTPUT"
|
|
||||||
- name: Update references in docs
|
|
||||||
run: |
|
|
||||||
OLD_REF=$(grep -oh 'astral-sh/setup-uv@[a-f0-9]\{40\} # v[0-9][^ ]*' README.md docs/*.md | head -1)
|
|
||||||
OLD_SHA=$(echo "$OLD_REF" | sed 's/astral-sh\/setup-uv@\([a-f0-9]*\) # .*/\1/')
|
|
||||||
OLD_VERSION=$(echo "$OLD_REF" | sed 's/astral-sh\/setup-uv@[a-f0-9]* # \(v[^ ]*\)/\1/')
|
|
||||||
echo "Replacing $OLD_SHA # $OLD_VERSION with $NEW_SHA # $NEW_VERSION"
|
|
||||||
find README.md docs/ -type f \( -name "*.md" \) -exec \
|
|
||||||
sed -i "s|$OLD_SHA # $OLD_VERSION|$NEW_SHA # $NEW_VERSION|g" {} +
|
|
||||||
env:
|
|
||||||
NEW_SHA: ${{ steps.tag-info.outputs.sha }}
|
|
||||||
NEW_VERSION: ${{ steps.tag-info.outputs.tag }}
|
|
||||||
- name: Check for changes
|
|
||||||
id: changes-exist
|
|
||||||
run: |
|
|
||||||
if [ -n "$(git status --porcelain)" ]; then
|
|
||||||
echo "changes-exist=true" >> "$GITHUB_OUTPUT"
|
|
||||||
else
|
|
||||||
echo "changes-exist=false" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
|
||||||
- name: Commit and push changes
|
|
||||||
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' }}
|
|
||||||
id: commit-and-push
|
|
||||||
continue-on-error: true
|
|
||||||
run: |
|
|
||||||
git config user.name "$GITHUB_ACTOR"
|
|
||||||
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
|
|
||||||
git add .
|
|
||||||
git commit -m "docs: update version references to $NEW_VERSION"
|
|
||||||
git push origin HEAD:refs/heads/main
|
|
||||||
env:
|
|
||||||
NEW_VERSION: ${{ steps.tag-info.outputs.tag }}
|
|
||||||
- name: Create Pull Request
|
|
||||||
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' && steps.commit-and-push.outcome != 'success' }}
|
|
||||||
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
|
||||||
with:
|
|
||||||
commit-message: "docs: update version references to ${{ steps.tag-info.outputs.tag }}"
|
|
||||||
title: "docs: update version references to ${{ steps.tag-info.outputs.tag }}"
|
|
||||||
body: |
|
|
||||||
Update `uses: astral-sh/setup-uv@...` references in documentation to
|
|
||||||
`${{ steps.tag-info.outputs.sha }} # ${{ steps.tag-info.outputs.tag }}`.
|
|
||||||
base: main
|
|
||||||
labels: "automated-pr,update-docs"
|
|
||||||
branch: update-docs-${{ steps.tag-info.outputs.tag }}
|
|
||||||
delete-branch: true
|
|
||||||
4
.github/workflows/update-known-checksums.yml
vendored
4
.github/workflows/update-known-checksums.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
||||||
with:
|
with:
|
||||||
persist-credentials: true
|
persist-credentials: true
|
||||||
- uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
|
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
|
||||||
with:
|
with:
|
||||||
node-version-file: .nvmrc
|
node-version-file: .nvmrc
|
||||||
cache: npm
|
cache: npm
|
||||||
@@ -54,7 +54,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Create Pull Request
|
- name: Create Pull Request
|
||||||
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' && steps.commit-and-push.outcome != 'success' }}
|
if: ${{ steps.changes-exist.outputs.changes-exist == 'true' && steps.commit-and-push.outcome != 'success' }}
|
||||||
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
|
uses: peter-evans/create-pull-request@c0f553fe549906ede9cf27b5156039d195d2ece0 # v8.1.0
|
||||||
with:
|
with:
|
||||||
commit-message: "chore: update known checksums"
|
commit-message: "chore: update known checksums"
|
||||||
title:
|
title:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ This repository is a TypeScript-based GitHub Action for installing `uv` in GitHu
|
|||||||
1. `npm ci --ignore-scripts`
|
1. `npm ci --ignore-scripts`
|
||||||
2. `npm run all`
|
2. `npm run all`
|
||||||
- `npm run check` uses Biome (not ESLint/Prettier) and rewrites files in place.
|
- `npm run check` uses Biome (not ESLint/Prettier) and rewrites files in place.
|
||||||
- User-facing changes are usually multi-file changes. If you add or change inputs, outputs, or behavior, update `action.yml`, `action-types.yml`, the implementation in `src/`, tests in `__tests__/`, relevant docs/README, and then re-package.
|
- User-facing changes are usually multi-file changes. If you add or change inputs, outputs, or behavior, update `action.yml`, the implementation in `src/`, tests in `__tests__/`, relevant docs/README, and then re-package.
|
||||||
- The easiest areas to regress are version resolution and caching. When touching them, add or update tests for precedence, cache invalidation, and cross-platform path behavior.
|
- The easiest areas to regress are version resolution and caching. When touching them, add or update tests for precedence, cache invalidation, and cross-platform path behavior.
|
||||||
- Workflow edits have extra CI-only checks (`actionlint` and `zizmor`); `npm run all` does not cover them.
|
- Workflow edits have extra CI-only checks (`actionlint` and `zizmor`); `npm run all` does not cover them.
|
||||||
- Source is authored with bundler-friendly TypeScript, but published action artifacts in `dist/` are bundled as CommonJS for maximum GitHub Actions runtime compatibility with `@actions/*` dependencies.
|
- Source is authored with bundler-friendly TypeScript, but published action artifacts in `dist/` are bundled as CommonJS for maximum GitHub Actions runtime compatibility with `@actions/*` dependencies.
|
||||||
|
|||||||
19
README.md
19
README.md
@@ -26,7 +26,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install the latest version of uv
|
- name: Install the latest version of uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
If you do not specify a version, this action will look for a [required-version](https://docs.astral.sh/uv/reference/settings/#required-version)
|
If you do not specify a version, this action will look for a [required-version](https://docs.astral.sh/uv/reference/settings/#required-version)
|
||||||
@@ -42,7 +42,7 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install uv with all available options
|
- name: Install uv with all available options
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
# The version of uv to install (default: searches for version in config files, then latest)
|
# The version of uv to install (default: searches for version in config files, then latest)
|
||||||
version: ""
|
version: ""
|
||||||
@@ -62,9 +62,6 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed
|
|||||||
# Custom path for the virtual environment when using activate-environment (default: .venv in the working directory)
|
# Custom path for the virtual environment when using activate-environment (default: .venv in the working directory)
|
||||||
venv-path: ""
|
venv-path: ""
|
||||||
|
|
||||||
# Pass --no-project when creating the venv with activate-environment.
|
|
||||||
no-project: "false"
|
|
||||||
|
|
||||||
# The directory to execute all commands in and look for files such as pyproject.toml
|
# The directory to execute all commands in and look for files such as pyproject.toml
|
||||||
working-directory: ""
|
working-directory: ""
|
||||||
|
|
||||||
@@ -142,7 +139,7 @@ This will override any python version specifications in `pyproject.toml` and `.p
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install the latest version of uv and set the python version to 3.13t
|
- name: Install the latest version of uv and set the python version to 3.13t
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
python-version: 3.13t
|
python-version: 3.13t
|
||||||
- run: uv pip install --python=3.13t pip
|
- run: uv pip install --python=3.13t pip
|
||||||
@@ -160,7 +157,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- name: Install the latest version of uv and set the python version
|
- name: Install the latest version of uv and set the python version
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
- name: Test with python ${{ matrix.python-version }}
|
- name: Test with python ${{ matrix.python-version }}
|
||||||
@@ -177,7 +174,7 @@ It also controls where [the venv gets created](#activate-environment), unless `v
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install uv based on the config files in the working-directory
|
- name: Install uv based on the config files in the working-directory
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
working-directory: my/subproject/dir
|
working-directory: my/subproject/dir
|
||||||
```
|
```
|
||||||
@@ -219,7 +216,7 @@ For example:
|
|||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@main
|
uses: actions/checkout@main
|
||||||
- name: Install the latest version of uv
|
- name: Install the latest version of uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
- name: Test
|
- name: Test
|
||||||
@@ -231,7 +228,7 @@ To install a specific version of Python, use
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install the latest version of uv
|
- name: Install the latest version of uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
- name: Install Python 3.12
|
- name: Install Python 3.12
|
||||||
@@ -250,7 +247,7 @@ output:
|
|||||||
uses: actions/checkout@main
|
uses: actions/checkout@main
|
||||||
- name: Install the default version of uv
|
- name: Install the default version of uv
|
||||||
id: setup-uv
|
id: setup-uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
- name: Print the installed version
|
- name: Print the installed version
|
||||||
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
|
run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}"
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -95,35 +95,6 @@ describe("download-version", () => {
|
|||||||
expect(mockGetAllVersions).toHaveBeenCalledWith(undefined);
|
expect(mockGetAllVersions).toHaveBeenCalledWith(undefined);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("treats == exact pins as explicit versions", async () => {
|
|
||||||
const version = await resolveVersion("==0.9.26", undefined);
|
|
||||||
|
|
||||||
expect(version).toBe("0.9.26");
|
|
||||||
expect(mockGetAllVersions).not.toHaveBeenCalled();
|
|
||||||
expect(mockGetLatestVersion).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("uses latest for minimum-only ranges when using the highest strategy", async () => {
|
|
||||||
mockGetLatestVersion.mockResolvedValue("0.9.26");
|
|
||||||
|
|
||||||
const version = await resolveVersion(">=0.9.0", undefined, "highest");
|
|
||||||
|
|
||||||
expect(version).toBe("0.9.26");
|
|
||||||
expect(mockGetLatestVersion).toHaveBeenCalledTimes(1);
|
|
||||||
expect(mockGetLatestVersion).toHaveBeenCalledWith(undefined);
|
|
||||||
expect(mockGetAllVersions).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it("uses the lowest compatible version when requested", async () => {
|
|
||||||
mockGetAllVersions.mockResolvedValue(["0.9.26", "0.9.25"]);
|
|
||||||
|
|
||||||
const version = await resolveVersion("^0.9.0", undefined, "lowest");
|
|
||||||
|
|
||||||
expect(version).toBe("0.9.25");
|
|
||||||
expect(mockGetAllVersions).toHaveBeenCalledTimes(1);
|
|
||||||
expect(mockGetAllVersions).toHaveBeenCalledWith(undefined);
|
|
||||||
});
|
|
||||||
|
|
||||||
it("uses manifest-file when provided", async () => {
|
it("uses manifest-file when provided", async () => {
|
||||||
mockGetAllVersions.mockResolvedValue(["0.9.26", "0.9.25"]);
|
mockGetAllVersions.mockResolvedValue(["0.9.26", "0.9.25"]);
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { expect, test } from "@jest/globals";
|
import { expect, test } from "@jest/globals";
|
||||||
import { getUvVersionFromFile } from "../../src/version/file-parser";
|
import { getUvVersionFromFile } from "../../src/version/resolve";
|
||||||
|
|
||||||
test("ignores dependencies starting with uv", async () => {
|
test("ignores dependencies starting with uv", async () => {
|
||||||
const parsedVersion = getUvVersionFromFile(
|
const parsedVersion = getUvVersionFromFile(
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { expect, test } from "@jest/globals";
|
import { expect, test } from "@jest/globals";
|
||||||
import { getUvVersionFromFile } from "../../src/version/file-parser";
|
import { getUvVersionFromFile } from "../../src/version/resolve";
|
||||||
|
|
||||||
test("ignores dependencies starting with uv", async () => {
|
test("ignores dependencies starting with uv", async () => {
|
||||||
const parsedVersion = getUvVersionFromFile(
|
const parsedVersion = getUvVersionFromFile(
|
||||||
|
|||||||
@@ -1,125 +0,0 @@
|
|||||||
import fs from "node:fs";
|
|
||||||
import os from "node:os";
|
|
||||||
import path from "node:path";
|
|
||||||
import { afterEach, describe, expect, it } from "@jest/globals";
|
|
||||||
import { resolveVersionRequest } from "../../src/version/version-request-resolver";
|
|
||||||
|
|
||||||
const tempDirs: string[] = [];
|
|
||||||
|
|
||||||
function createTempProject(files: Record<string, string> = {}): string {
|
|
||||||
const dir = fs.mkdtempSync(path.join(os.tmpdir(), "setup-uv-version-test-"));
|
|
||||||
tempDirs.push(dir);
|
|
||||||
|
|
||||||
for (const [relativePath, content] of Object.entries(files)) {
|
|
||||||
const filePath = path.join(dir, relativePath);
|
|
||||||
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
||||||
fs.writeFileSync(filePath, content);
|
|
||||||
}
|
|
||||||
|
|
||||||
return dir;
|
|
||||||
}
|
|
||||||
|
|
||||||
afterEach(() => {
|
|
||||||
for (const dir of tempDirs.splice(0)) {
|
|
||||||
fs.rmSync(dir, { force: true, recursive: true });
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
describe("resolveVersionRequest", () => {
|
|
||||||
it("prefers explicit input over version-file and workspace config", () => {
|
|
||||||
const workingDirectory = createTempProject({
|
|
||||||
".tool-versions": "uv 0.4.0\n",
|
|
||||||
"pyproject.toml": `[tool.uv]\nrequired-version = "==0.5.14"\n`,
|
|
||||||
"uv.toml": `required-version = "==0.5.15"\n`,
|
|
||||||
});
|
|
||||||
|
|
||||||
const request = resolveVersionRequest({
|
|
||||||
version: "==0.6.0",
|
|
||||||
versionFile: path.join(workingDirectory, ".tool-versions"),
|
|
||||||
workingDirectory,
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(request).toEqual({
|
|
||||||
source: "input",
|
|
||||||
specifier: "0.6.0",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("uses .tool-versions when it is passed via version-file", () => {
|
|
||||||
const workingDirectory = createTempProject({
|
|
||||||
".tool-versions": "uv 0.5.15\n",
|
|
||||||
});
|
|
||||||
|
|
||||||
const request = resolveVersionRequest({
|
|
||||||
versionFile: path.join(workingDirectory, ".tool-versions"),
|
|
||||||
workingDirectory,
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(request).toEqual({
|
|
||||||
format: ".tool-versions",
|
|
||||||
source: "version-file",
|
|
||||||
sourcePath: path.join(workingDirectory, ".tool-versions"),
|
|
||||||
specifier: "0.5.15",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("uses requirements.txt when it is passed via version-file", () => {
|
|
||||||
const workingDirectory = createTempProject({
|
|
||||||
"requirements.txt": "uv==0.6.17\nuvicorn==0.35.0\n",
|
|
||||||
});
|
|
||||||
|
|
||||||
const request = resolveVersionRequest({
|
|
||||||
versionFile: path.join(workingDirectory, "requirements.txt"),
|
|
||||||
workingDirectory,
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(request).toEqual({
|
|
||||||
format: "requirements",
|
|
||||||
source: "version-file",
|
|
||||||
sourcePath: path.join(workingDirectory, "requirements.txt"),
|
|
||||||
specifier: "0.6.17",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("prefers uv.toml over pyproject.toml during workspace discovery", () => {
|
|
||||||
const workingDirectory = createTempProject({
|
|
||||||
"pyproject.toml": `[tool.uv]\nrequired-version = "==0.5.14"\n`,
|
|
||||||
"uv.toml": `required-version = "==0.5.15"\n`,
|
|
||||||
});
|
|
||||||
|
|
||||||
const request = resolveVersionRequest({ workingDirectory });
|
|
||||||
|
|
||||||
expect(request).toEqual({
|
|
||||||
format: "uv.toml",
|
|
||||||
source: "uv.toml",
|
|
||||||
sourcePath: path.join(workingDirectory, "uv.toml"),
|
|
||||||
specifier: "0.5.15",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("falls back to latest when no version source is found", () => {
|
|
||||||
const workingDirectory = createTempProject({});
|
|
||||||
|
|
||||||
const request = resolveVersionRequest({ workingDirectory });
|
|
||||||
|
|
||||||
expect(request).toEqual({
|
|
||||||
source: "default",
|
|
||||||
specifier: "latest",
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it("throws when version-file does not resolve a version", () => {
|
|
||||||
const workingDirectory = createTempProject({
|
|
||||||
"requirements.txt": "uvicorn==0.35.0\n",
|
|
||||||
});
|
|
||||||
|
|
||||||
expect(() =>
|
|
||||||
resolveVersionRequest({
|
|
||||||
versionFile: path.join(workingDirectory, "requirements.txt"),
|
|
||||||
workingDirectory,
|
|
||||||
}),
|
|
||||||
).toThrow(
|
|
||||||
`Could not determine uv version from file: ${path.join(workingDirectory, "requirements.txt")}`,
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -11,8 +11,6 @@ inputs:
|
|||||||
type: boolean
|
type: boolean
|
||||||
venv-path:
|
venv-path:
|
||||||
type: string
|
type: string
|
||||||
no-project:
|
|
||||||
type: boolean
|
|
||||||
working-directory:
|
working-directory:
|
||||||
type: string
|
type: string
|
||||||
checksum:
|
checksum:
|
||||||
|
|||||||
@@ -18,9 +18,6 @@ inputs:
|
|||||||
venv-path:
|
venv-path:
|
||||||
description: "Custom path for the virtual environment when using activate-environment. Defaults to '.venv' in the working directory."
|
description: "Custom path for the virtual environment when using activate-environment. Defaults to '.venv' in the working directory."
|
||||||
default: ""
|
default: ""
|
||||||
no-project:
|
|
||||||
description: "Pass --no-project when creating the venv with activate-environment."
|
|
||||||
default: "false"
|
|
||||||
working-directory:
|
working-directory:
|
||||||
description: "The directory to execute all commands in and look for files such as pyproject.toml"
|
description: "The directory to execute all commands in and look for files such as pyproject.toml"
|
||||||
default: ${{ github.workspace }}
|
default: ${{ github.workspace }}
|
||||||
|
|||||||
8
dist/save-cache/index.cjs
generated
vendored
8
dist/save-cache/index.cjs
generated
vendored
@@ -62947,12 +62947,6 @@ function getConfigValueFromTomlFile(filePath, key) {
|
|||||||
return void 0;
|
return void 0;
|
||||||
}
|
}
|
||||||
const fileContent = import_node_fs2.default.readFileSync(filePath, "utf-8");
|
const fileContent = import_node_fs2.default.readFileSync(filePath, "utf-8");
|
||||||
return getConfigValueFromTomlContent(filePath, fileContent, key);
|
|
||||||
}
|
|
||||||
function getConfigValueFromTomlContent(filePath, fileContent, key) {
|
|
||||||
if (!filePath.endsWith(".toml")) {
|
|
||||||
return void 0;
|
|
||||||
}
|
|
||||||
if (filePath.endsWith("pyproject.toml")) {
|
if (filePath.endsWith("pyproject.toml")) {
|
||||||
const tomlContent2 = parse2(fileContent);
|
const tomlContent2 = parse2(fileContent);
|
||||||
return tomlContent2?.tool?.uv?.[key];
|
return tomlContent2?.tool?.uv?.[key];
|
||||||
@@ -62968,7 +62962,6 @@ function loadInputs() {
|
|||||||
const versionFile = getVersionFile(workingDirectory);
|
const versionFile = getVersionFile(workingDirectory);
|
||||||
const pythonVersion = getInput("python-version");
|
const pythonVersion = getInput("python-version");
|
||||||
const activateEnvironment = getBooleanInput("activate-environment");
|
const activateEnvironment = getBooleanInput("activate-environment");
|
||||||
const noProject = getBooleanInput("no-project");
|
|
||||||
const venvPath = getVenvPath(workingDirectory, activateEnvironment);
|
const venvPath = getVenvPath(workingDirectory, activateEnvironment);
|
||||||
const checksum = getInput("checksum");
|
const checksum = getInput("checksum");
|
||||||
const enableCache = getEnableCache();
|
const enableCache = getEnableCache();
|
||||||
@@ -63005,7 +62998,6 @@ function loadInputs() {
|
|||||||
ignoreEmptyWorkdir,
|
ignoreEmptyWorkdir,
|
||||||
ignoreNothingToCache,
|
ignoreNothingToCache,
|
||||||
manifestFile,
|
manifestFile,
|
||||||
noProject,
|
|
||||||
pruneCache: pruneCache2,
|
pruneCache: pruneCache2,
|
||||||
pythonDir,
|
pythonDir,
|
||||||
pythonVersion,
|
pythonVersion,
|
||||||
|
|||||||
4758
dist/setup/index.cjs
generated
vendored
4758
dist/setup/index.cjs
generated
vendored
File diff suppressed because it is too large
Load Diff
54
dist/update-known-checksums/index.cjs
generated
vendored
54
dist/update-known-checksums/index.cjs
generated
vendored
@@ -44949,60 +44949,6 @@ var semver = __toESM(require_semver(), 1);
|
|||||||
|
|
||||||
// src/download/checksum/known-checksums.ts
|
// src/download/checksum/known-checksums.ts
|
||||||
var KNOWN_CHECKSUMS = {
|
var KNOWN_CHECKSUMS = {
|
||||||
"aarch64-apple-darwin-0.11.8": "c729adb365114e844dd7f9316313a7ed6443b89bb5681d409eebac78b0bd06c8",
|
|
||||||
"aarch64-pc-windows-msvc-0.11.8": "bb48716e74e4998993f15bc57a55e4d0d73ccbd27a66d7cbed37605f7c67d747",
|
|
||||||
"aarch64-unknown-linux-gnu-0.11.8": "eee8dd658d20e5ac85fec9c2326b6cbc9d83a1eef09ef07433e58698ac849591",
|
|
||||||
"aarch64-unknown-linux-musl-0.11.8": "29418befb64f926a2dba3473e8e69acd00b36fb845d85344ef11321a993ad8f5",
|
|
||||||
"arm-unknown-linux-musleabihf-0.11.8": "858f50a1164e9d2e3d1641a5f9d81a8b098025bd4f40011882df4f6b7d6ee393",
|
|
||||||
"armv7-unknown-linux-gnueabihf-0.11.8": "b0674ede45b797362f34af0a75d6391e844992ae92a9c181a353e3892af4c325",
|
|
||||||
"armv7-unknown-linux-musleabihf-0.11.8": "eda6e549a1d3bea67de6550e84b05d75e5538350bf50ba229840ec92063f153e",
|
|
||||||
"i686-pc-windows-msvc-0.11.8": "59520c34c3c29a901bb490d4bec55a8e1d46c75d2fbad238871e18de733b4201",
|
|
||||||
"i686-unknown-linux-gnu-0.11.8": "4a82441b70adc3886a4f9c29a1070f104ed73c7e68d14cfa6d6343a8ce0c4ccc",
|
|
||||||
"i686-unknown-linux-musl-0.11.8": "56b8e8874ba09194c580583697c09cbe6c31626e5bb4cfb1f8bfbf4998a8d6c6",
|
|
||||||
"powerpc64le-unknown-linux-gnu-0.11.8": "7b66bcc99237d19fb25d8b1bcbc1f973f735027d49e7cb9ffa22cd539fefccbc",
|
|
||||||
"riscv64gc-unknown-linux-gnu-0.11.8": "dd43289c567fda3ca59ec714ffca09125f1149289448667f36a4bb7c29c859be",
|
|
||||||
"riscv64gc-unknown-linux-musl-0.11.8": "c06b5bbbfecb258f869b18168abb46ef974a76c786fa9350923b1cf38d1661a0",
|
|
||||||
"s390x-unknown-linux-gnu-0.11.8": "068eb3f47d0760d50cd2e0fc59cc2c09eb12a4ec8bb12c269f3aef706bf4dc1a",
|
|
||||||
"x86_64-apple-darwin-0.11.8": "c59d73bf34b58bc8e33a11629f7a255c11789fd00f03cd3e68ab2d1603645de9",
|
|
||||||
"x86_64-pc-windows-msvc-0.11.8": "c84629a56e0706b69a47ea35862208af827cb6fbfa1d0ca763c52c67594637e8",
|
|
||||||
"x86_64-unknown-linux-gnu-0.11.8": "56dd1b66701ecb62fe896abb919444e4b83c5e8645cca953e6ddd496ff8a0feb",
|
|
||||||
"x86_64-unknown-linux-musl-0.11.8": "de82507d12e31cfc86c1c776238f7c248e48e40d996dedc812d64fdd31c6ed12",
|
|
||||||
"aarch64-apple-darwin-0.11.7": "66e37d91f839e12481d7b932a1eccbfe732560f42c1cfb89faddfa2454534ba8",
|
|
||||||
"aarch64-pc-windows-msvc-0.11.7": "1387e1c94e15196351196b79fce4c1e6f4b30f19cdaaf9ff85fbd6b046018aa2",
|
|
||||||
"aarch64-unknown-linux-gnu-0.11.7": "f2ee1cde9aabb4c6e43bd3f341dadaf42189a54e001e521346dc31547310e284",
|
|
||||||
"aarch64-unknown-linux-musl-0.11.7": "46647dc16cbb7d6700f762fdd7a67d220abe18570914732bc310adc91308d272",
|
|
||||||
"arm-unknown-linux-musleabihf-0.11.7": "238974610607541ccdb3b8f4ad161d4f2a4b018d749dc9d358b0965d9a1ddd0f",
|
|
||||||
"armv7-unknown-linux-gnueabihf-0.11.7": "7aa9ddc128f58c0e667227feb84e0aac3bb65301604c5f6f2ab0f442aaaafd99",
|
|
||||||
"armv7-unknown-linux-musleabihf-0.11.7": "77a237761579125b822d604973a2d4afb62b10a8f066db4f793906deec66b017",
|
|
||||||
"i686-pc-windows-msvc-0.11.7": "04652b46b1be90a753e686b839e109a79af3d032ba96d3616c162dffdbe89e5c",
|
|
||||||
"i686-unknown-linux-gnu-0.11.7": "9c77e5b5f2ad4151c6dc29db5511af549e205dbd6e836e544c80ebfadd7a07ec",
|
|
||||||
"i686-unknown-linux-musl-0.11.7": "b067ce3e92d04425bc11b84dc350f97447d3e8dffafccb7ebebde54a56bfc619",
|
|
||||||
"powerpc64le-unknown-linux-gnu-0.11.7": "6ac23c519d1b06297e1e8753c96911fadee5abab4ca35b8c17da30e3e927d8ac",
|
|
||||||
"riscv64gc-unknown-linux-gnu-0.11.7": "2052356c7388d26dc4dfcf2d44e28b3f800785371f37c5f37d179181fe377659",
|
|
||||||
"riscv64gc-unknown-linux-musl-0.11.7": "219a25e413efb62c8ef3efb3593f1f01d9a3c22d1facf3b9c0d80b7caf3a5e56",
|
|
||||||
"s390x-unknown-linux-gnu-0.11.7": "760152aa9e769712d52b6c65a8d7b86ed3aac25a24892cf5998a522d84942f9e",
|
|
||||||
"x86_64-apple-darwin-0.11.7": "0a4bc8fcde4974ea3560be21772aeecab600a6f43fa6e58169f9fa7b3b71d302",
|
|
||||||
"x86_64-pc-windows-msvc-0.11.7": "fe0c7815acf4fc45f8a5eff58ed3cf7ae2e15c3cf1dceadbd10c816ec1690cc1",
|
|
||||||
"x86_64-unknown-linux-gnu-0.11.7": "6681d691eb7f9c00ac6a3af54252f7ab29ae72f0c8f95bdc7f9d1401c23ea868",
|
|
||||||
"x86_64-unknown-linux-musl-0.11.7": "64ddb5f1087649e3f75aa50d139aa4f36ddde728a5295a141e0fa9697bfb7b0f",
|
|
||||||
"aarch64-apple-darwin-0.11.6": "4b69a4e366ec38cd5f305707de95e12951181c448679a00dce2a78868dfc9f5b",
|
|
||||||
"aarch64-pc-windows-msvc-0.11.6": "bee7b25a7a999f17291810242b47565c3ef2b9205651a0fd02a086f261a7e167",
|
|
||||||
"aarch64-unknown-linux-gnu-0.11.6": "d5be4bf7015ea000378cb3c3aba53ba81a8673458ace9c7fa25a0be005b74802",
|
|
||||||
"aarch64-unknown-linux-musl-0.11.6": "d14ebd6f200047264152daaf97b8bd36c7885a5033e9e8bba8366cb0049c0d00",
|
|
||||||
"arm-unknown-linux-musleabihf-0.11.6": "4410a9489e0a29ce8f86fc8604b75a3dd821e9e52734282cbb413b4e19c5c70a",
|
|
||||||
"armv7-unknown-linux-gnueabihf-0.11.6": "9758d49c200c211ccb2c9cbf43877102031c3457e80b6c3cb9da1e4c00119d2a",
|
|
||||||
"armv7-unknown-linux-musleabihf-0.11.6": "0677423d98cea5011d346d7d4a33a53360b99a51a04df4b45f67d43a8308c831",
|
|
||||||
"i686-pc-windows-msvc-0.11.6": "c5569da150166363389a719553d87f99e0c29e542b2c31bc8bd4aeeb8eb83d99",
|
|
||||||
"i686-unknown-linux-gnu-0.11.6": "b4bf8d78478b573c1816b17ec86da7ade14242cd68ac092c1701c5b4a75dc228",
|
|
||||||
"i686-unknown-linux-musl-0.11.6": "ca31705d93f48313d5ffdc23da165e680c6c5389d9a2cc62b85a1ed495e0331f",
|
|
||||||
"powerpc64le-unknown-linux-gnu-0.11.6": "153397d3d82e45e68fb1f4a40ee9898245ec8ed86fd03fcaacaf6e793316acf7",
|
|
||||||
"riscv64gc-unknown-linux-gnu-0.11.6": "0e3ead8667b51b07b5fb9d114bcd1914a5fe3159e6959a584dc2f89c6724e123",
|
|
||||||
"riscv64gc-unknown-linux-musl-0.11.6": "87d5932bffef3b7b9cba4a2a042f95edf75cd34555fc80cfa98cc5a4426635f9",
|
|
||||||
"s390x-unknown-linux-gnu-0.11.6": "6e3d4338da2db2c63326721f1eb3b4f32d9bde24aeff11208d397e1aeba8678e",
|
|
||||||
"x86_64-apple-darwin-0.11.6": "8e0ed5035eaa28c7c8cd2a46b5b9a05bfff1ef01dbdc090a010eb8fdf193a457",
|
|
||||||
"x86_64-pc-windows-msvc-0.11.6": "99aa60edd017a256dbf378f372d1cff3292dbc6696e0ea01716d9158d773ab77",
|
|
||||||
"x86_64-unknown-linux-gnu-0.11.6": "0c6bab77a67a445dc849ed5e8ee8d3cb333b6e2eba863643ce1e228075f27943",
|
|
||||||
"x86_64-unknown-linux-musl-0.11.6": "aa342a53abe42364093506d7704214d2cdca30b916843e520bc67759a5d20132",
|
|
||||||
"aarch64-apple-darwin-0.11.5": "470993e87503874c7c48861daa308b48a7c367e117235bbecf19368b9fdd35b2",
|
"aarch64-apple-darwin-0.11.5": "470993e87503874c7c48861daa308b48a7c367e117235bbecf19368b9fdd35b2",
|
||||||
"aarch64-pc-windows-msvc-0.11.5": "9b9b99a985cccf249225aaad76412823e9d9736d605dc2252151172a7f6ab3db",
|
"aarch64-pc-windows-msvc-0.11.5": "9b9b99a985cccf249225aaad76412823e9d9736d605dc2252151172a7f6ab3db",
|
||||||
"aarch64-unknown-linux-gnu-0.11.5": "3e9b525d686ae4f3682412bce21536366a5c79616a41055530319c501c883169",
|
"aarch64-unknown-linux-gnu-0.11.5": "3e9b525d686ae4f3682412bce21536366a5c79616a41055530319c501c883169",
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ This document covers advanced options for configuring which version of uv to ins
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install the latest version of uv
|
- name: Install the latest version of uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
version: "latest"
|
version: "latest"
|
||||||
```
|
```
|
||||||
@@ -15,7 +15,7 @@ This document covers advanced options for configuring which version of uv to ins
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install a specific version of uv
|
- name: Install a specific version of uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
version: "0.4.4"
|
version: "0.4.4"
|
||||||
```
|
```
|
||||||
@@ -28,21 +28,21 @@ to install the latest version that satisfies the range.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install a semver range of uv
|
- name: Install a semver range of uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
version: ">=0.4.0"
|
version: ">=0.4.0"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Pinning a minor version of uv
|
- name: Pinning a minor version of uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
version: "0.4.x"
|
version: "0.4.x"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install a pep440-specifier-satisfying version of uv
|
- name: Install a pep440-specifier-satisfying version of uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
version: ">=0.4.25,<0.5"
|
version: ">=0.4.25,<0.5"
|
||||||
```
|
```
|
||||||
@@ -54,7 +54,7 @@ You can change this behavior using the `resolution-strategy` input:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install the lowest compatible version of uv
|
- name: Install the lowest compatible version of uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
version: ">=0.4.0"
|
version: ">=0.4.0"
|
||||||
resolution-strategy: "lowest"
|
resolution-strategy: "lowest"
|
||||||
@@ -76,7 +76,7 @@ uv defined as a dependency in `pyproject.toml` or `requirements.txt`.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install uv based on the version defined in pyproject.toml
|
- name: Install uv based on the version defined in pyproject.toml
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
version-file: "pyproject.toml"
|
version-file: "pyproject.toml"
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ The computed cache key is available as the `cache-key` output:
|
|||||||
```yaml
|
```yaml
|
||||||
- name: Setup uv
|
- name: Setup uv
|
||||||
id: setup-uv
|
id: setup-uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
- name: Print cache key
|
- name: Print cache key
|
||||||
@@ -50,7 +50,7 @@ You can optionally define a custom cache key suffix.
|
|||||||
```yaml
|
```yaml
|
||||||
- name: Enable caching and define a custom cache key suffix
|
- name: Enable caching and define a custom cache key suffix
|
||||||
id: setup-uv
|
id: setup-uv
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
cache-suffix: "optional-suffix"
|
cache-suffix: "optional-suffix"
|
||||||
@@ -89,7 +89,7 @@ changes. If you use relative paths, they are relative to the working directory.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Define a cache dependency glob
|
- name: Define a cache dependency glob
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
cache-dependency-glob: "**/pyproject.toml"
|
cache-dependency-glob: "**/pyproject.toml"
|
||||||
@@ -97,7 +97,7 @@ changes. If you use relative paths, they are relative to the working directory.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Define a list of cache dependency globs
|
- name: Define a list of cache dependency globs
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
cache-dependency-glob: |
|
cache-dependency-glob: |
|
||||||
@@ -107,7 +107,7 @@ changes. If you use relative paths, they are relative to the working directory.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Define an absolute cache dependency glob
|
- name: Define an absolute cache dependency glob
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
cache-dependency-glob: "/tmp/my-folder/requirements*.txt"
|
cache-dependency-glob: "/tmp/my-folder/requirements*.txt"
|
||||||
@@ -115,7 +115,7 @@ changes. If you use relative paths, they are relative to the working directory.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Never invalidate the cache
|
- name: Never invalidate the cache
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
cache-dependency-glob: ""
|
cache-dependency-glob: ""
|
||||||
@@ -128,7 +128,7 @@ By default, the cache will be restored.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Don't restore an existing cache
|
- name: Don't restore an existing cache
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
restore-cache: false
|
restore-cache: false
|
||||||
@@ -142,7 +142,7 @@ By default, the cache will be saved.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Don't save the cache after the run
|
- name: Don't save the cache after the run
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
save-cache: false
|
save-cache: false
|
||||||
@@ -168,7 +168,7 @@ It defaults to `setup-uv-cache` in the `TMP` dir, `D:\a\_temp\setup-uv-cache` on
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Define a custom uv cache path
|
- name: Define a custom uv cache path
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
cache-local-path: "/path/to/cache"
|
cache-local-path: "/path/to/cache"
|
||||||
```
|
```
|
||||||
@@ -187,7 +187,7 @@ input.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Don't prune the cache before saving it
|
- name: Don't prune the cache before saving it
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
prune-cache: false
|
prune-cache: false
|
||||||
@@ -205,7 +205,7 @@ To force managed Python installs, set `UV_PYTHON_PREFERENCE=only-managed`.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Cache Python installs
|
- name: Cache Python installs
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
cache-python: true
|
cache-python: true
|
||||||
@@ -223,7 +223,7 @@ If you want to ignore this, set the `ignore-nothing-to-cache` input to `true`.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Ignore nothing to cache
|
- name: Ignore nothing to cache
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
enable-cache: true
|
enable-cache: true
|
||||||
ignore-nothing-to-cache: true
|
ignore-nothing-to-cache: true
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ are automatically verified by this action. The sha256 hashes can be found on the
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install a specific version and validate the checksum
|
- name: Install a specific version and validate the checksum
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
version: "0.3.1"
|
version: "0.3.1"
|
||||||
checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"
|
checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8"
|
||||||
@@ -39,7 +39,7 @@ The `archive_format` field is currently ignored.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Use a custom manifest file
|
- name: Use a custom manifest file
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
manifest-file: "https://example.com/my-custom-manifest.ndjson"
|
manifest-file: "https://example.com/my-custom-manifest.ndjson"
|
||||||
```
|
```
|
||||||
@@ -58,7 +58,7 @@ You can disable this by setting the `add-problem-matchers` input to `false`.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install the latest version of uv without problem matchers
|
- name: Install the latest version of uv without problem matchers
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
add-problem-matchers: false
|
add-problem-matchers: false
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ This allows directly using it in later steps:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install the latest version of uv and activate the environment
|
- name: Install the latest version of uv and activate the environment
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
activate-environment: true
|
activate-environment: true
|
||||||
- run: uv pip install pip
|
- run: uv pip install pip
|
||||||
@@ -20,7 +20,7 @@ By default, the venv is created at `.venv` inside the `working-directory`.
|
|||||||
You can customize the venv location with `venv-path`, for example to place it in the runner temp directory:
|
You can customize the venv location with `venv-path`, for example to place it in the runner temp directory:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
activate-environment: true
|
activate-environment: true
|
||||||
venv-path: ${{ runner.temp }}/custom-venv
|
venv-path: ${{ runner.temp }}/custom-venv
|
||||||
@@ -51,7 +51,7 @@ are not sufficient, you can provide a custom GitHub token with the necessary per
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install the latest version of uv with a custom GitHub token
|
- name: Install the latest version of uv with a custom GitHub token
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}
|
||||||
```
|
```
|
||||||
@@ -69,7 +69,7 @@ input:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install the latest version of uv with a custom tool dir
|
- name: Install the latest version of uv with a custom tool dir
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
tool-dir: "/path/to/tool/dir"
|
tool-dir: "/path/to/tool/dir"
|
||||||
```
|
```
|
||||||
@@ -88,7 +88,7 @@ If you want to change this behaviour (especially on self-hosted runners) you can
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Install the latest version of uv with a custom tool bin dir
|
- name: Install the latest version of uv with a custom tool bin dir
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
tool-bin-dir: "/path/to/tool-bin/dir"
|
tool-bin-dir: "/path/to/tool-bin/dir"
|
||||||
```
|
```
|
||||||
@@ -105,7 +105,7 @@ This action supports expanding the `~` character to the user's home directory fo
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Expand the tilde character
|
- name: Expand the tilde character
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
cache-local-path: "~/path/to/cache"
|
cache-local-path: "~/path/to/cache"
|
||||||
tool-dir: "~/path/to/tool/dir"
|
tool-dir: "~/path/to/tool/dir"
|
||||||
@@ -122,7 +122,7 @@ If you want to ignore this, set the `ignore-empty-workdir` input to `true`.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Ignore empty workdir
|
- name: Ignore empty workdir
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
ignore-empty-workdir: true
|
ignore-empty-workdir: true
|
||||||
```
|
```
|
||||||
@@ -145,7 +145,7 @@ This action sets several environment variables that influence uv's behavior and
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- name: Example using environment variables
|
- name: Example using environment variables
|
||||||
uses: astral-sh/setup-uv@08807647e7069bb48b6ef5acd8ec9567f424441b # v8.1.0
|
uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.12"
|
||||||
tool-dir: "/custom/tool/dir"
|
tool-dir: "/custom/tool/dir"
|
||||||
|
|||||||
59
package-lock.json
generated
59
package-lock.json
generated
@@ -28,7 +28,7 @@
|
|||||||
"esbuild": "^0.27.4",
|
"esbuild": "^0.27.4",
|
||||||
"jest": "^30.3.0",
|
"jest": "^30.3.0",
|
||||||
"js-yaml": "^4.1.1",
|
"js-yaml": "^4.1.1",
|
||||||
"ts-jest": "^29.4.6",
|
"ts-jest": "^29.4.9",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -3406,11 +3406,10 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/handlebars": {
|
"node_modules/handlebars": {
|
||||||
"version": "4.7.8",
|
"version": "4.7.9",
|
||||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
|
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.9.tgz",
|
||||||
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
|
"integrity": "sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.5",
|
"minimist": "^1.2.5",
|
||||||
"neo-async": "^2.6.2",
|
"neo-async": "^2.6.2",
|
||||||
@@ -4479,7 +4478,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
"resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz",
|
||||||
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
"integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"funding": {
|
"funding": {
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
@@ -4526,8 +4524,7 @@
|
|||||||
"version": "2.6.2",
|
"version": "2.6.2",
|
||||||
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz",
|
||||||
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
|
"integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"license": "MIT"
|
|
||||||
},
|
},
|
||||||
"node_modules/node-int64": {
|
"node_modules/node-int64": {
|
||||||
"version": "0.4.0",
|
"version": "0.4.0",
|
||||||
@@ -5232,19 +5229,18 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/ts-jest": {
|
"node_modules/ts-jest": {
|
||||||
"version": "29.4.6",
|
"version": "29.4.9",
|
||||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.6.tgz",
|
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.9.tgz",
|
||||||
"integrity": "sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==",
|
"integrity": "sha512-LTb9496gYPMCqjeDLdPrKuXtncudeV1yRZnF4Wo5l3SFi0RYEnYRNgMrFIdg+FHvfzjCyQk1cLncWVqiSX+EvQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"bs-logger": "^0.2.6",
|
"bs-logger": "^0.2.6",
|
||||||
"fast-json-stable-stringify": "^2.1.0",
|
"fast-json-stable-stringify": "^2.1.0",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.9",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"lodash.memoize": "^4.1.2",
|
"lodash.memoize": "^4.1.2",
|
||||||
"make-error": "^1.3.6",
|
"make-error": "^1.3.6",
|
||||||
"semver": "^7.7.3",
|
"semver": "^7.7.4",
|
||||||
"type-fest": "^4.41.0",
|
"type-fest": "^4.41.0",
|
||||||
"yargs-parser": "^21.1.1"
|
"yargs-parser": "^21.1.1"
|
||||||
},
|
},
|
||||||
@@ -5261,7 +5257,7 @@
|
|||||||
"babel-jest": "^29.0.0 || ^30.0.0",
|
"babel-jest": "^29.0.0 || ^30.0.0",
|
||||||
"jest": "^29.0.0 || ^30.0.0",
|
"jest": "^29.0.0 || ^30.0.0",
|
||||||
"jest-util": "^29.0.0 || ^30.0.0",
|
"jest-util": "^29.0.0 || ^30.0.0",
|
||||||
"typescript": ">=4.3 <6"
|
"typescript": ">=4.3 <7"
|
||||||
},
|
},
|
||||||
"peerDependenciesMeta": {
|
"peerDependenciesMeta": {
|
||||||
"@babel/core": {
|
"@babel/core": {
|
||||||
@@ -5285,11 +5281,10 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/ts-jest/node_modules/semver": {
|
"node_modules/ts-jest/node_modules/semver": {
|
||||||
"version": "7.7.3",
|
"version": "7.7.4",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
|
||||||
"integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
|
"integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "ISC",
|
|
||||||
"bin": {
|
"bin": {
|
||||||
"semver": "bin/semver.js"
|
"semver": "bin/semver.js"
|
||||||
},
|
},
|
||||||
@@ -5354,7 +5349,6 @@
|
|||||||
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
|
"resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz",
|
||||||
"integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==",
|
"integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "BSD-2-Clause",
|
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"uglifyjs": "bin/uglifyjs"
|
"uglifyjs": "bin/uglifyjs"
|
||||||
@@ -5489,8 +5483,7 @@
|
|||||||
"version": "1.0.0",
|
"version": "1.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
|
||||||
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
|
"integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
|
||||||
"dev": true,
|
"dev": true
|
||||||
"license": "MIT"
|
|
||||||
},
|
},
|
||||||
"node_modules/wrap-ansi": {
|
"node_modules/wrap-ansi": {
|
||||||
"version": "8.1.0",
|
"version": "8.1.0",
|
||||||
@@ -7889,9 +7882,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"handlebars": {
|
"handlebars": {
|
||||||
"version": "4.7.8",
|
"version": "4.7.9",
|
||||||
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz",
|
"resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.9.tgz",
|
||||||
"integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==",
|
"integrity": "sha512-4E71E0rpOaQuJR2A3xDZ+GM1HyWYv1clR58tC8emQNeQe3RH7MAzSbat+V0wG78LQBo6m6bzSG/L4pBuCsgnUQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "^1.2.5",
|
"minimist": "^1.2.5",
|
||||||
@@ -9138,26 +9131,26 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"ts-jest": {
|
"ts-jest": {
|
||||||
"version": "29.4.6",
|
"version": "29.4.9",
|
||||||
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.6.tgz",
|
"resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-29.4.9.tgz",
|
||||||
"integrity": "sha512-fSpWtOO/1AjSNQguk43hb/JCo16oJDnMJf3CdEGNkqsEX3t0KX96xvyX1D7PfLCpVoKu4MfVrqUkFyblYoY4lA==",
|
"integrity": "sha512-LTb9496gYPMCqjeDLdPrKuXtncudeV1yRZnF4Wo5l3SFi0RYEnYRNgMrFIdg+FHvfzjCyQk1cLncWVqiSX+EvQ==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"bs-logger": "^0.2.6",
|
"bs-logger": "^0.2.6",
|
||||||
"fast-json-stable-stringify": "^2.1.0",
|
"fast-json-stable-stringify": "^2.1.0",
|
||||||
"handlebars": "^4.7.8",
|
"handlebars": "^4.7.9",
|
||||||
"json5": "^2.2.3",
|
"json5": "^2.2.3",
|
||||||
"lodash.memoize": "^4.1.2",
|
"lodash.memoize": "^4.1.2",
|
||||||
"make-error": "^1.3.6",
|
"make-error": "^1.3.6",
|
||||||
"semver": "^7.7.3",
|
"semver": "^7.7.4",
|
||||||
"type-fest": "^4.41.0",
|
"type-fest": "^4.41.0",
|
||||||
"yargs-parser": "^21.1.1"
|
"yargs-parser": "^21.1.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "7.7.3",
|
"version": "7.7.4",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.4.tgz",
|
||||||
"integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==",
|
"integrity": "sha512-vFKC2IEtQnVhpT78h1Yp8wzwrf8CM+MzKMHGJZfBtzhZNycRFnXsHk6E5TxIkkMsgNS7mdX3AGB7x2QM2di4lA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
"esbuild": "^0.27.4",
|
"esbuild": "^0.27.4",
|
||||||
"jest": "^30.3.0",
|
"jest": "^30.3.0",
|
||||||
"js-yaml": "^4.1.1",
|
"js-yaml": "^4.1.1",
|
||||||
"ts-jest": "^29.4.6",
|
"ts-jest": "^29.4.9",
|
||||||
"typescript": "^5.9.3"
|
"typescript": "^5.9.3"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,113 +1,5 @@
|
|||||||
// AUTOGENERATED_DO_NOT_EDIT
|
// AUTOGENERATED_DO_NOT_EDIT
|
||||||
export const KNOWN_CHECKSUMS: { [key: string]: string } = {
|
export const KNOWN_CHECKSUMS: { [key: string]: string } = {
|
||||||
"aarch64-apple-darwin-0.11.8":
|
|
||||||
"c729adb365114e844dd7f9316313a7ed6443b89bb5681d409eebac78b0bd06c8",
|
|
||||||
"aarch64-pc-windows-msvc-0.11.8":
|
|
||||||
"bb48716e74e4998993f15bc57a55e4d0d73ccbd27a66d7cbed37605f7c67d747",
|
|
||||||
"aarch64-unknown-linux-gnu-0.11.8":
|
|
||||||
"eee8dd658d20e5ac85fec9c2326b6cbc9d83a1eef09ef07433e58698ac849591",
|
|
||||||
"aarch64-unknown-linux-musl-0.11.8":
|
|
||||||
"29418befb64f926a2dba3473e8e69acd00b36fb845d85344ef11321a993ad8f5",
|
|
||||||
"arm-unknown-linux-musleabihf-0.11.8":
|
|
||||||
"858f50a1164e9d2e3d1641a5f9d81a8b098025bd4f40011882df4f6b7d6ee393",
|
|
||||||
"armv7-unknown-linux-gnueabihf-0.11.8":
|
|
||||||
"b0674ede45b797362f34af0a75d6391e844992ae92a9c181a353e3892af4c325",
|
|
||||||
"armv7-unknown-linux-musleabihf-0.11.8":
|
|
||||||
"eda6e549a1d3bea67de6550e84b05d75e5538350bf50ba229840ec92063f153e",
|
|
||||||
"i686-pc-windows-msvc-0.11.8":
|
|
||||||
"59520c34c3c29a901bb490d4bec55a8e1d46c75d2fbad238871e18de733b4201",
|
|
||||||
"i686-unknown-linux-gnu-0.11.8":
|
|
||||||
"4a82441b70adc3886a4f9c29a1070f104ed73c7e68d14cfa6d6343a8ce0c4ccc",
|
|
||||||
"i686-unknown-linux-musl-0.11.8":
|
|
||||||
"56b8e8874ba09194c580583697c09cbe6c31626e5bb4cfb1f8bfbf4998a8d6c6",
|
|
||||||
"powerpc64le-unknown-linux-gnu-0.11.8":
|
|
||||||
"7b66bcc99237d19fb25d8b1bcbc1f973f735027d49e7cb9ffa22cd539fefccbc",
|
|
||||||
"riscv64gc-unknown-linux-gnu-0.11.8":
|
|
||||||
"dd43289c567fda3ca59ec714ffca09125f1149289448667f36a4bb7c29c859be",
|
|
||||||
"riscv64gc-unknown-linux-musl-0.11.8":
|
|
||||||
"c06b5bbbfecb258f869b18168abb46ef974a76c786fa9350923b1cf38d1661a0",
|
|
||||||
"s390x-unknown-linux-gnu-0.11.8":
|
|
||||||
"068eb3f47d0760d50cd2e0fc59cc2c09eb12a4ec8bb12c269f3aef706bf4dc1a",
|
|
||||||
"x86_64-apple-darwin-0.11.8":
|
|
||||||
"c59d73bf34b58bc8e33a11629f7a255c11789fd00f03cd3e68ab2d1603645de9",
|
|
||||||
"x86_64-pc-windows-msvc-0.11.8":
|
|
||||||
"c84629a56e0706b69a47ea35862208af827cb6fbfa1d0ca763c52c67594637e8",
|
|
||||||
"x86_64-unknown-linux-gnu-0.11.8":
|
|
||||||
"56dd1b66701ecb62fe896abb919444e4b83c5e8645cca953e6ddd496ff8a0feb",
|
|
||||||
"x86_64-unknown-linux-musl-0.11.8":
|
|
||||||
"de82507d12e31cfc86c1c776238f7c248e48e40d996dedc812d64fdd31c6ed12",
|
|
||||||
"aarch64-apple-darwin-0.11.7":
|
|
||||||
"66e37d91f839e12481d7b932a1eccbfe732560f42c1cfb89faddfa2454534ba8",
|
|
||||||
"aarch64-pc-windows-msvc-0.11.7":
|
|
||||||
"1387e1c94e15196351196b79fce4c1e6f4b30f19cdaaf9ff85fbd6b046018aa2",
|
|
||||||
"aarch64-unknown-linux-gnu-0.11.7":
|
|
||||||
"f2ee1cde9aabb4c6e43bd3f341dadaf42189a54e001e521346dc31547310e284",
|
|
||||||
"aarch64-unknown-linux-musl-0.11.7":
|
|
||||||
"46647dc16cbb7d6700f762fdd7a67d220abe18570914732bc310adc91308d272",
|
|
||||||
"arm-unknown-linux-musleabihf-0.11.7":
|
|
||||||
"238974610607541ccdb3b8f4ad161d4f2a4b018d749dc9d358b0965d9a1ddd0f",
|
|
||||||
"armv7-unknown-linux-gnueabihf-0.11.7":
|
|
||||||
"7aa9ddc128f58c0e667227feb84e0aac3bb65301604c5f6f2ab0f442aaaafd99",
|
|
||||||
"armv7-unknown-linux-musleabihf-0.11.7":
|
|
||||||
"77a237761579125b822d604973a2d4afb62b10a8f066db4f793906deec66b017",
|
|
||||||
"i686-pc-windows-msvc-0.11.7":
|
|
||||||
"04652b46b1be90a753e686b839e109a79af3d032ba96d3616c162dffdbe89e5c",
|
|
||||||
"i686-unknown-linux-gnu-0.11.7":
|
|
||||||
"9c77e5b5f2ad4151c6dc29db5511af549e205dbd6e836e544c80ebfadd7a07ec",
|
|
||||||
"i686-unknown-linux-musl-0.11.7":
|
|
||||||
"b067ce3e92d04425bc11b84dc350f97447d3e8dffafccb7ebebde54a56bfc619",
|
|
||||||
"powerpc64le-unknown-linux-gnu-0.11.7":
|
|
||||||
"6ac23c519d1b06297e1e8753c96911fadee5abab4ca35b8c17da30e3e927d8ac",
|
|
||||||
"riscv64gc-unknown-linux-gnu-0.11.7":
|
|
||||||
"2052356c7388d26dc4dfcf2d44e28b3f800785371f37c5f37d179181fe377659",
|
|
||||||
"riscv64gc-unknown-linux-musl-0.11.7":
|
|
||||||
"219a25e413efb62c8ef3efb3593f1f01d9a3c22d1facf3b9c0d80b7caf3a5e56",
|
|
||||||
"s390x-unknown-linux-gnu-0.11.7":
|
|
||||||
"760152aa9e769712d52b6c65a8d7b86ed3aac25a24892cf5998a522d84942f9e",
|
|
||||||
"x86_64-apple-darwin-0.11.7":
|
|
||||||
"0a4bc8fcde4974ea3560be21772aeecab600a6f43fa6e58169f9fa7b3b71d302",
|
|
||||||
"x86_64-pc-windows-msvc-0.11.7":
|
|
||||||
"fe0c7815acf4fc45f8a5eff58ed3cf7ae2e15c3cf1dceadbd10c816ec1690cc1",
|
|
||||||
"x86_64-unknown-linux-gnu-0.11.7":
|
|
||||||
"6681d691eb7f9c00ac6a3af54252f7ab29ae72f0c8f95bdc7f9d1401c23ea868",
|
|
||||||
"x86_64-unknown-linux-musl-0.11.7":
|
|
||||||
"64ddb5f1087649e3f75aa50d139aa4f36ddde728a5295a141e0fa9697bfb7b0f",
|
|
||||||
"aarch64-apple-darwin-0.11.6":
|
|
||||||
"4b69a4e366ec38cd5f305707de95e12951181c448679a00dce2a78868dfc9f5b",
|
|
||||||
"aarch64-pc-windows-msvc-0.11.6":
|
|
||||||
"bee7b25a7a999f17291810242b47565c3ef2b9205651a0fd02a086f261a7e167",
|
|
||||||
"aarch64-unknown-linux-gnu-0.11.6":
|
|
||||||
"d5be4bf7015ea000378cb3c3aba53ba81a8673458ace9c7fa25a0be005b74802",
|
|
||||||
"aarch64-unknown-linux-musl-0.11.6":
|
|
||||||
"d14ebd6f200047264152daaf97b8bd36c7885a5033e9e8bba8366cb0049c0d00",
|
|
||||||
"arm-unknown-linux-musleabihf-0.11.6":
|
|
||||||
"4410a9489e0a29ce8f86fc8604b75a3dd821e9e52734282cbb413b4e19c5c70a",
|
|
||||||
"armv7-unknown-linux-gnueabihf-0.11.6":
|
|
||||||
"9758d49c200c211ccb2c9cbf43877102031c3457e80b6c3cb9da1e4c00119d2a",
|
|
||||||
"armv7-unknown-linux-musleabihf-0.11.6":
|
|
||||||
"0677423d98cea5011d346d7d4a33a53360b99a51a04df4b45f67d43a8308c831",
|
|
||||||
"i686-pc-windows-msvc-0.11.6":
|
|
||||||
"c5569da150166363389a719553d87f99e0c29e542b2c31bc8bd4aeeb8eb83d99",
|
|
||||||
"i686-unknown-linux-gnu-0.11.6":
|
|
||||||
"b4bf8d78478b573c1816b17ec86da7ade14242cd68ac092c1701c5b4a75dc228",
|
|
||||||
"i686-unknown-linux-musl-0.11.6":
|
|
||||||
"ca31705d93f48313d5ffdc23da165e680c6c5389d9a2cc62b85a1ed495e0331f",
|
|
||||||
"powerpc64le-unknown-linux-gnu-0.11.6":
|
|
||||||
"153397d3d82e45e68fb1f4a40ee9898245ec8ed86fd03fcaacaf6e793316acf7",
|
|
||||||
"riscv64gc-unknown-linux-gnu-0.11.6":
|
|
||||||
"0e3ead8667b51b07b5fb9d114bcd1914a5fe3159e6959a584dc2f89c6724e123",
|
|
||||||
"riscv64gc-unknown-linux-musl-0.11.6":
|
|
||||||
"87d5932bffef3b7b9cba4a2a042f95edf75cd34555fc80cfa98cc5a4426635f9",
|
|
||||||
"s390x-unknown-linux-gnu-0.11.6":
|
|
||||||
"6e3d4338da2db2c63326721f1eb3b4f32d9bde24aeff11208d397e1aeba8678e",
|
|
||||||
"x86_64-apple-darwin-0.11.6":
|
|
||||||
"8e0ed5035eaa28c7c8cd2a46b5b9a05bfff1ef01dbdc090a010eb8fdf193a457",
|
|
||||||
"x86_64-pc-windows-msvc-0.11.6":
|
|
||||||
"99aa60edd017a256dbf378f372d1cff3292dbc6696e0ea01716d9158d773ab77",
|
|
||||||
"x86_64-unknown-linux-gnu-0.11.6":
|
|
||||||
"0c6bab77a67a445dc849ed5e8ee8d3cb333b6e2eba863643ce1e228075f27943",
|
|
||||||
"x86_64-unknown-linux-musl-0.11.6":
|
|
||||||
"aa342a53abe42364093506d7704214d2cdca30b916843e520bc67759a5d20132",
|
|
||||||
"aarch64-apple-darwin-0.11.5":
|
"aarch64-apple-darwin-0.11.5":
|
||||||
"470993e87503874c7c48861daa308b48a7c367e117235bbecf19368b9fdd35b2",
|
"470993e87503874c7c48861daa308b48a7c367e117235bbecf19368b9fdd35b2",
|
||||||
"aarch64-pc-windows-msvc-0.11.5":
|
"aarch64-pc-windows-msvc-0.11.5":
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import { promises as fs } from "node:fs";
|
|||||||
import * as path from "node:path";
|
import * as path from "node:path";
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import * as tc from "@actions/tool-cache";
|
import * as tc from "@actions/tool-cache";
|
||||||
|
import * as pep440 from "@renovatebot/pep440";
|
||||||
|
import * as semver from "semver";
|
||||||
import {
|
import {
|
||||||
ASTRAL_MIRROR_PREFIX,
|
ASTRAL_MIRROR_PREFIX,
|
||||||
GITHUB_RELEASES_PREFIX,
|
GITHUB_RELEASES_PREFIX,
|
||||||
@@ -10,9 +12,7 @@ import {
|
|||||||
} from "../utils/constants";
|
} from "../utils/constants";
|
||||||
import type { Architecture, Platform } from "../utils/platforms";
|
import type { Architecture, Platform } from "../utils/platforms";
|
||||||
import { validateChecksum } from "./checksum/checksum";
|
import { validateChecksum } from "./checksum/checksum";
|
||||||
import { getArtifact } from "./manifest";
|
import { getAllVersions, getArtifact, getLatestVersion } from "./manifest";
|
||||||
|
|
||||||
export { resolveVersion } from "../version/resolve";
|
|
||||||
|
|
||||||
export function tryGetFromToolCache(
|
export function tryGetFromToolCache(
|
||||||
arch: Architecture,
|
arch: Architecture,
|
||||||
@@ -172,3 +172,102 @@ function resolveChecksum(
|
|||||||
function getExtension(platform: Platform): string {
|
function getExtension(platform: Platform): string {
|
||||||
return platform === "pc-windows-msvc" ? ".zip" : ".tar.gz";
|
return platform === "pc-windows-msvc" ? ".zip" : ".tar.gz";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function resolveVersion(
|
||||||
|
versionInput: string,
|
||||||
|
manifestUrl: string | undefined,
|
||||||
|
resolutionStrategy: "highest" | "lowest" = "highest",
|
||||||
|
): Promise<string> {
|
||||||
|
core.debug(`Resolving version: ${versionInput}`);
|
||||||
|
const isSimpleMinimumVersionSpecifier =
|
||||||
|
versionInput.includes(">") && !versionInput.includes(",");
|
||||||
|
const resolveVersionSpecifierToLatest =
|
||||||
|
isSimpleMinimumVersionSpecifier && resolutionStrategy === "highest";
|
||||||
|
|
||||||
|
if (resolveVersionSpecifierToLatest) {
|
||||||
|
core.info("Found minimum version specifier, using latest version");
|
||||||
|
}
|
||||||
|
|
||||||
|
const version =
|
||||||
|
versionInput === "latest" || resolveVersionSpecifierToLatest
|
||||||
|
? await getLatestVersion(manifestUrl)
|
||||||
|
: versionInput;
|
||||||
|
|
||||||
|
if (tc.isExplicitVersion(version)) {
|
||||||
|
core.debug(`Version ${version} is an explicit version.`);
|
||||||
|
if (
|
||||||
|
resolveVersionSpecifierToLatest &&
|
||||||
|
!pep440.satisfies(version, versionInput)
|
||||||
|
) {
|
||||||
|
throw new Error(`No version found for ${versionInput}`);
|
||||||
|
}
|
||||||
|
return version;
|
||||||
|
}
|
||||||
|
|
||||||
|
const availableVersions = await getAvailableVersions(manifestUrl);
|
||||||
|
core.debug(`Available versions: ${availableVersions}`);
|
||||||
|
const resolvedVersion =
|
||||||
|
resolutionStrategy === "lowest"
|
||||||
|
? minSatisfying(availableVersions, version)
|
||||||
|
: maxSatisfying(availableVersions, version);
|
||||||
|
|
||||||
|
if (resolvedVersion === undefined) {
|
||||||
|
throw new Error(`No version found for ${version}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return resolvedVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getAvailableVersions(
|
||||||
|
manifestUrl: string | undefined,
|
||||||
|
): Promise<string[]> {
|
||||||
|
if (manifestUrl !== undefined) {
|
||||||
|
core.info(
|
||||||
|
`Getting available versions from manifest-file ${manifestUrl} ...`,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
core.info(`Getting available versions from ${VERSIONS_MANIFEST_URL} ...`);
|
||||||
|
}
|
||||||
|
|
||||||
|
return await getAllVersions(manifestUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
function maxSatisfying(
|
||||||
|
versions: string[],
|
||||||
|
version: string,
|
||||||
|
): string | undefined {
|
||||||
|
const maxSemver = tc.evaluateVersions(versions, version);
|
||||||
|
if (maxSemver !== "") {
|
||||||
|
core.debug(`Found a version that satisfies the semver range: ${maxSemver}`);
|
||||||
|
return maxSemver;
|
||||||
|
}
|
||||||
|
const maxPep440 = pep440.maxSatisfying(versions, version);
|
||||||
|
if (maxPep440 !== null) {
|
||||||
|
core.debug(
|
||||||
|
`Found a version that satisfies the pep440 specifier: ${maxPep440}`,
|
||||||
|
);
|
||||||
|
return maxPep440;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
function minSatisfying(
|
||||||
|
versions: string[],
|
||||||
|
version: string,
|
||||||
|
): string | undefined {
|
||||||
|
// For semver, we need to use a different approach since tc.evaluateVersions only returns max
|
||||||
|
// Let's use semver directly for min satisfying
|
||||||
|
const minSemver = semver.minSatisfying(versions, version);
|
||||||
|
if (minSemver !== null) {
|
||||||
|
core.debug(`Found a version that satisfies the semver range: ${minSemver}`);
|
||||||
|
return minSemver;
|
||||||
|
}
|
||||||
|
const minPep440 = pep440.minSatisfying(versions, version);
|
||||||
|
if (minPep440 !== null) {
|
||||||
|
core.debug(
|
||||||
|
`Found a version that satisfies the pep440 specifier: ${minPep440}`,
|
||||||
|
);
|
||||||
|
return minPep440;
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|||||||
@@ -111,9 +111,6 @@ export async function getLatestVersion(
|
|||||||
export async function getAllVersions(
|
export async function getAllVersions(
|
||||||
manifestUrl: string = VERSIONS_MANIFEST_URL,
|
manifestUrl: string = VERSIONS_MANIFEST_URL,
|
||||||
): Promise<string[]> {
|
): Promise<string[]> {
|
||||||
core.info(
|
|
||||||
`Getting available versions from ${manifestSource(manifestUrl)} ...`,
|
|
||||||
);
|
|
||||||
const versions = await fetchManifest(manifestUrl);
|
const versions = await fetchManifest(manifestUrl);
|
||||||
return versions.map((versionData) => versionData.version);
|
return versions.map((versionData) => versionData.version);
|
||||||
}
|
}
|
||||||
@@ -168,14 +165,6 @@ export function clearManifestCache(manifestUrl?: string): void {
|
|||||||
cachedManifestData.delete(manifestUrl);
|
cachedManifestData.delete(manifestUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
function manifestSource(manifestUrl: string): string {
|
|
||||||
if (manifestUrl === VERSIONS_MANIFEST_URL) {
|
|
||||||
return VERSIONS_MANIFEST_URL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return `manifest-file ${manifestUrl}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isManifestVersion(value: unknown): value is ManifestVersion {
|
function isManifestVersion(value: unknown): value is ManifestVersion {
|
||||||
if (!isRecord(value)) {
|
if (!isRecord(value)) {
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import * as exec from "@actions/exec";
|
|||||||
import { restoreCache } from "./cache/restore-cache";
|
import { restoreCache } from "./cache/restore-cache";
|
||||||
import {
|
import {
|
||||||
downloadVersion,
|
downloadVersion,
|
||||||
|
resolveVersion,
|
||||||
tryGetFromToolCache,
|
tryGetFromToolCache,
|
||||||
} from "./download/download-version";
|
} from "./download/download-version";
|
||||||
import { STATE_UV_PATH, STATE_UV_VERSION } from "./utils/constants";
|
import { STATE_UV_PATH, STATE_UV_VERSION } from "./utils/constants";
|
||||||
@@ -15,7 +16,7 @@ import {
|
|||||||
getPlatform,
|
getPlatform,
|
||||||
type Platform,
|
type Platform,
|
||||||
} from "./utils/platforms";
|
} from "./utils/platforms";
|
||||||
import { resolveUvVersion } from "./version/resolve";
|
import { getUvVersionFromFile } from "./version/resolve";
|
||||||
|
|
||||||
const sourceDir = __dirname;
|
const sourceDir = __dirname;
|
||||||
|
|
||||||
@@ -111,13 +112,7 @@ async function setupUv(
|
|||||||
platform: Platform,
|
platform: Platform,
|
||||||
arch: Architecture,
|
arch: Architecture,
|
||||||
): Promise<{ uvDir: string; version: string }> {
|
): Promise<{ uvDir: string; version: string }> {
|
||||||
const resolvedVersion = await resolveUvVersion({
|
const resolvedVersion = await determineVersion(inputs);
|
||||||
manifestFile: inputs.manifestFile,
|
|
||||||
resolutionStrategy: inputs.resolutionStrategy,
|
|
||||||
version: inputs.version,
|
|
||||||
versionFile: inputs.versionFile,
|
|
||||||
workingDirectory: inputs.workingDirectory,
|
|
||||||
});
|
|
||||||
const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion);
|
const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion);
|
||||||
if (toolCacheResult.installedPath) {
|
if (toolCacheResult.installedPath) {
|
||||||
core.info(`Found uv in tool-cache for ${toolCacheResult.version}`);
|
core.info(`Found uv in tool-cache for ${toolCacheResult.version}`);
|
||||||
@@ -142,6 +137,45 @@ async function setupUv(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function determineVersion(inputs: SetupInputs): Promise<string> {
|
||||||
|
return await resolveVersion(
|
||||||
|
getRequestedVersion(inputs),
|
||||||
|
inputs.manifestFile,
|
||||||
|
inputs.resolutionStrategy,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function getRequestedVersion(inputs: SetupInputs): string {
|
||||||
|
if (inputs.version !== "") {
|
||||||
|
return inputs.version;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inputs.versionFile !== "") {
|
||||||
|
const versionFromFile = getUvVersionFromFile(inputs.versionFile);
|
||||||
|
if (versionFromFile === undefined) {
|
||||||
|
throw new Error(
|
||||||
|
`Could not determine uv version from file: ${inputs.versionFile}`,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return versionFromFile;
|
||||||
|
}
|
||||||
|
|
||||||
|
const versionFromUvToml = getUvVersionFromFile(
|
||||||
|
`${inputs.workingDirectory}${path.sep}uv.toml`,
|
||||||
|
);
|
||||||
|
const versionFromPyproject = getUvVersionFromFile(
|
||||||
|
`${inputs.workingDirectory}${path.sep}pyproject.toml`,
|
||||||
|
);
|
||||||
|
|
||||||
|
if (versionFromUvToml === undefined && versionFromPyproject === undefined) {
|
||||||
|
core.info(
|
||||||
|
"Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest.",
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return versionFromUvToml || versionFromPyproject || "latest";
|
||||||
|
}
|
||||||
|
|
||||||
function addUvToPathAndOutput(cachedPath: string): void {
|
function addUvToPathAndOutput(cachedPath: string): void {
|
||||||
core.setOutput("uv-path", `${cachedPath}${path.sep}uv`);
|
core.setOutput("uv-path", `${cachedPath}${path.sep}uv`);
|
||||||
core.saveState(STATE_UV_PATH, `${cachedPath}${path.sep}uv`);
|
core.saveState(STATE_UV_PATH, `${cachedPath}${path.sep}uv`);
|
||||||
@@ -218,17 +252,13 @@ async function activateEnvironment(inputs: SetupInputs): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
core.info(`Creating and activating python venv at ${inputs.venvPath}...`);
|
core.info(`Creating and activating python venv at ${inputs.venvPath}...`);
|
||||||
const venvArgs = [
|
await exec.exec("uv", [
|
||||||
"venv",
|
"venv",
|
||||||
inputs.venvPath,
|
inputs.venvPath,
|
||||||
"--directory",
|
"--directory",
|
||||||
inputs.workingDirectory,
|
inputs.workingDirectory,
|
||||||
"--clear",
|
"--clear",
|
||||||
];
|
]);
|
||||||
if (inputs.noProject) {
|
|
||||||
venvArgs.push("--no-project");
|
|
||||||
}
|
|
||||||
await exec.exec("uv", venvArgs);
|
|
||||||
|
|
||||||
let venvBinPath = `${inputs.venvPath}${path.sep}bin`;
|
let venvBinPath = `${inputs.venvPath}${path.sep}bin`;
|
||||||
if (process.platform === "win32") {
|
if (process.platform === "win32") {
|
||||||
|
|||||||
@@ -8,19 +8,7 @@ export function getConfigValueFromTomlFile(
|
|||||||
if (!fs.existsSync(filePath) || !filePath.endsWith(".toml")) {
|
if (!fs.existsSync(filePath) || !filePath.endsWith(".toml")) {
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fileContent = fs.readFileSync(filePath, "utf-8");
|
const fileContent = fs.readFileSync(filePath, "utf-8");
|
||||||
return getConfigValueFromTomlContent(filePath, fileContent, key);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getConfigValueFromTomlContent(
|
|
||||||
filePath: string,
|
|
||||||
fileContent: string,
|
|
||||||
key: string,
|
|
||||||
): string | undefined {
|
|
||||||
if (!filePath.endsWith(".toml")) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (filePath.endsWith("pyproject.toml")) {
|
if (filePath.endsWith("pyproject.toml")) {
|
||||||
const tomlContent = toml.parse(fileContent) as {
|
const tomlContent = toml.parse(fileContent) as {
|
||||||
@@ -28,7 +16,6 @@ export function getConfigValueFromTomlContent(
|
|||||||
};
|
};
|
||||||
return tomlContent?.tool?.uv?.[key];
|
return tomlContent?.tool?.uv?.[key];
|
||||||
}
|
}
|
||||||
|
|
||||||
const tomlContent = toml.parse(fileContent) as Record<
|
const tomlContent = toml.parse(fileContent) as Record<
|
||||||
string,
|
string,
|
||||||
string | undefined
|
string | undefined
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ export interface SetupInputs {
|
|||||||
versionFile: string;
|
versionFile: string;
|
||||||
pythonVersion: string;
|
pythonVersion: string;
|
||||||
activateEnvironment: boolean;
|
activateEnvironment: boolean;
|
||||||
noProject: boolean;
|
|
||||||
venvPath: string;
|
venvPath: string;
|
||||||
checksum: string;
|
checksum: string;
|
||||||
enableCache: boolean;
|
enableCache: boolean;
|
||||||
@@ -50,7 +49,6 @@ export function loadInputs(): SetupInputs {
|
|||||||
const versionFile = getVersionFile(workingDirectory);
|
const versionFile = getVersionFile(workingDirectory);
|
||||||
const pythonVersion = core.getInput("python-version");
|
const pythonVersion = core.getInput("python-version");
|
||||||
const activateEnvironment = core.getBooleanInput("activate-environment");
|
const activateEnvironment = core.getBooleanInput("activate-environment");
|
||||||
const noProject = core.getBooleanInput("no-project");
|
|
||||||
const venvPath = getVenvPath(workingDirectory, activateEnvironment);
|
const venvPath = getVenvPath(workingDirectory, activateEnvironment);
|
||||||
const checksum = core.getInput("checksum");
|
const checksum = core.getInput("checksum");
|
||||||
const enableCache = getEnableCache();
|
const enableCache = getEnableCache();
|
||||||
@@ -89,7 +87,6 @@ export function loadInputs(): SetupInputs {
|
|||||||
ignoreEmptyWorkdir,
|
ignoreEmptyWorkdir,
|
||||||
ignoreNothingToCache,
|
ignoreNothingToCache,
|
||||||
manifestFile,
|
manifestFile,
|
||||||
noProject,
|
|
||||||
pruneCache,
|
pruneCache,
|
||||||
pythonDir,
|
pythonDir,
|
||||||
pythonVersion,
|
pythonVersion,
|
||||||
|
|||||||
@@ -1,103 +0,0 @@
|
|||||||
import fs from "node:fs";
|
|
||||||
import * as core from "@actions/core";
|
|
||||||
import { getConfigValueFromTomlContent } from "../utils/config-file";
|
|
||||||
import {
|
|
||||||
getUvVersionFromParsedPyproject,
|
|
||||||
getUvVersionFromRequirementsText,
|
|
||||||
parsePyprojectContent,
|
|
||||||
} from "./requirements-file";
|
|
||||||
import { normalizeVersionSpecifier } from "./specifier";
|
|
||||||
import { getUvVersionFromToolVersions } from "./tool-versions-file";
|
|
||||||
import type { ParsedVersionFile, VersionFileFormat } from "./types";
|
|
||||||
|
|
||||||
interface VersionFileParser {
|
|
||||||
format: VersionFileFormat;
|
|
||||||
parse(filePath: string): string | undefined;
|
|
||||||
supports(filePath: string): boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
const VERSION_FILE_PARSERS: VersionFileParser[] = [
|
|
||||||
{
|
|
||||||
format: ".tool-versions",
|
|
||||||
parse: (filePath) => getUvVersionFromToolVersions(filePath),
|
|
||||||
supports: (filePath) => filePath.endsWith(".tool-versions"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
format: "uv.toml",
|
|
||||||
parse: (filePath) => {
|
|
||||||
const fileContent = fs.readFileSync(filePath, "utf-8");
|
|
||||||
return getConfigValueFromTomlContent(
|
|
||||||
filePath,
|
|
||||||
fileContent,
|
|
||||||
"required-version",
|
|
||||||
);
|
|
||||||
},
|
|
||||||
supports: (filePath) => filePath.endsWith("uv.toml"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
format: "pyproject.toml",
|
|
||||||
parse: (filePath) => {
|
|
||||||
const fileContent = fs.readFileSync(filePath, "utf-8");
|
|
||||||
const pyproject = parsePyprojectContent(fileContent);
|
|
||||||
const requiredVersion = pyproject.tool?.uv?.["required-version"];
|
|
||||||
|
|
||||||
if (requiredVersion !== undefined) {
|
|
||||||
return requiredVersion;
|
|
||||||
}
|
|
||||||
|
|
||||||
return getUvVersionFromParsedPyproject(pyproject);
|
|
||||||
},
|
|
||||||
supports: (filePath) => filePath.endsWith("pyproject.toml"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
format: "requirements",
|
|
||||||
parse: (filePath) => {
|
|
||||||
const fileContent = fs.readFileSync(filePath, "utf-8");
|
|
||||||
return getUvVersionFromRequirementsText(fileContent);
|
|
||||||
},
|
|
||||||
supports: (filePath) => filePath.endsWith(".txt"),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
export function getParsedVersionFile(
|
|
||||||
filePath: string,
|
|
||||||
): ParsedVersionFile | undefined {
|
|
||||||
core.info(`Trying to find version for uv in: ${filePath}`);
|
|
||||||
|
|
||||||
if (!fs.existsSync(filePath)) {
|
|
||||||
core.info(`Could not find file: ${filePath}`);
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const parser = getVersionFileParser(filePath);
|
|
||||||
if (parser === undefined) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
const specifier = parser.parse(filePath);
|
|
||||||
if (specifier === undefined) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const normalizedSpecifier = normalizeVersionSpecifier(specifier);
|
|
||||||
core.info(`Found version for uv in ${filePath}: ${normalizedSpecifier}`);
|
|
||||||
return {
|
|
||||||
format: parser.format,
|
|
||||||
specifier: normalizedSpecifier,
|
|
||||||
};
|
|
||||||
} catch (error) {
|
|
||||||
core.warning(
|
|
||||||
`Error while parsing ${filePath}: ${(error as Error).message}`,
|
|
||||||
);
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getUvVersionFromFile(filePath: string): string | undefined {
|
|
||||||
return getParsedVersionFile(filePath)?.specifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getVersionFileParser(filePath: string): VersionFileParser | undefined {
|
|
||||||
return VERSION_FILE_PARSERS.find((parser) => parser.supports(filePath));
|
|
||||||
}
|
|
||||||
@@ -5,23 +5,31 @@ export function getUvVersionFromRequirementsFile(
|
|||||||
filePath: string,
|
filePath: string,
|
||||||
): string | undefined {
|
): string | undefined {
|
||||||
const fileContent = fs.readFileSync(filePath, "utf-8");
|
const fileContent = fs.readFileSync(filePath, "utf-8");
|
||||||
|
|
||||||
if (filePath.endsWith(".txt")) {
|
if (filePath.endsWith(".txt")) {
|
||||||
return getUvVersionFromRequirementsText(fileContent);
|
|
||||||
}
|
|
||||||
|
|
||||||
return getUvVersionFromPyprojectContent(fileContent);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getUvVersionFromRequirementsText(
|
|
||||||
fileContent: string,
|
|
||||||
): string | undefined {
|
|
||||||
return getUvVersionFromAllDependencies(fileContent.split("\n"));
|
return getUvVersionFromAllDependencies(fileContent.split("\n"));
|
||||||
|
}
|
||||||
|
const dependencies = parsePyprojectDependencies(fileContent);
|
||||||
|
return getUvVersionFromAllDependencies(dependencies);
|
||||||
|
}
|
||||||
|
function getUvVersionFromAllDependencies(
|
||||||
|
allDependencies: string[],
|
||||||
|
): string | undefined {
|
||||||
|
return allDependencies
|
||||||
|
.find((dep: string) => dep.match(/^uv[=<>~!]/))
|
||||||
|
?.match(/^uv([=<>~!]+\S*)/)?.[1]
|
||||||
|
.trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getUvVersionFromParsedPyproject(
|
interface Pyproject {
|
||||||
pyproject: Pyproject,
|
project?: {
|
||||||
): string | undefined {
|
dependencies?: string[];
|
||||||
|
"optional-dependencies"?: Record<string, string[]>;
|
||||||
|
};
|
||||||
|
"dependency-groups"?: Record<string, Array<string | object>>;
|
||||||
|
}
|
||||||
|
|
||||||
|
function parsePyprojectDependencies(pyprojectContent: string): string[] {
|
||||||
|
const pyproject: Pyproject = toml.parse(pyprojectContent);
|
||||||
const dependencies: string[] = pyproject?.project?.dependencies || [];
|
const dependencies: string[] = pyproject?.project?.dependencies || [];
|
||||||
const optionalDependencies: string[] = Object.values(
|
const optionalDependencies: string[] = Object.values(
|
||||||
pyproject?.project?.["optional-dependencies"] || {},
|
pyproject?.project?.["optional-dependencies"] || {},
|
||||||
@@ -31,39 +39,5 @@ export function getUvVersionFromParsedPyproject(
|
|||||||
)
|
)
|
||||||
.flat()
|
.flat()
|
||||||
.filter((item: string | object) => typeof item === "string");
|
.filter((item: string | object) => typeof item === "string");
|
||||||
|
return dependencies.concat(optionalDependencies, devDependencies);
|
||||||
return getUvVersionFromAllDependencies(
|
|
||||||
dependencies.concat(optionalDependencies, devDependencies),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function getUvVersionFromPyprojectContent(
|
|
||||||
pyprojectContent: string,
|
|
||||||
): string | undefined {
|
|
||||||
const pyproject = parsePyprojectContent(pyprojectContent);
|
|
||||||
return getUvVersionFromParsedPyproject(pyproject);
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface Pyproject {
|
|
||||||
project?: {
|
|
||||||
dependencies?: string[];
|
|
||||||
"optional-dependencies"?: Record<string, string[]>;
|
|
||||||
};
|
|
||||||
"dependency-groups"?: Record<string, Array<string | object>>;
|
|
||||||
tool?: {
|
|
||||||
uv?: Record<string, string | undefined>;
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
export function parsePyprojectContent(pyprojectContent: string): Pyproject {
|
|
||||||
return toml.parse(pyprojectContent) as Pyproject;
|
|
||||||
}
|
|
||||||
|
|
||||||
function getUvVersionFromAllDependencies(
|
|
||||||
allDependencies: string[],
|
|
||||||
): string | undefined {
|
|
||||||
return allDependencies
|
|
||||||
.find((dep: string) => dep.match(/^uv[=<>~!]/))
|
|
||||||
?.match(/^uv([=<>~!]+\S*)/)?.[1]
|
|
||||||
.trim();
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,183 +1,34 @@
|
|||||||
|
import fs from "node:fs";
|
||||||
import * as core from "@actions/core";
|
import * as core from "@actions/core";
|
||||||
import * as tc from "@actions/tool-cache";
|
import { getConfigValueFromTomlFile } from "../utils/config-file";
|
||||||
import * as pep440 from "@renovatebot/pep440";
|
import { getUvVersionFromRequirementsFile } from "./requirements-file";
|
||||||
import * as semver from "semver";
|
import { getUvVersionFromToolVersions } from "./tool-versions-file";
|
||||||
import { getAllVersions, getLatestVersion } from "../download/manifest";
|
|
||||||
import type { ResolutionStrategy } from "../utils/inputs";
|
|
||||||
import {
|
|
||||||
type ParsedVersionSpecifier,
|
|
||||||
parseVersionSpecifier,
|
|
||||||
} from "./specifier";
|
|
||||||
import type { ResolveUvVersionOptions } from "./types";
|
|
||||||
import { resolveVersionRequest } from "./version-request-resolver";
|
|
||||||
|
|
||||||
interface ConcreteVersionResolutionContext {
|
export function getUvVersionFromFile(filePath: string): string | undefined {
|
||||||
manifestUrl?: string;
|
core.info(`Trying to find version for uv in: ${filePath}`);
|
||||||
parsedSpecifier: ParsedVersionSpecifier;
|
if (!fs.existsSync(filePath)) {
|
||||||
resolutionStrategy: ResolutionStrategy;
|
core.info(`Could not find file: ${filePath}`);
|
||||||
}
|
|
||||||
|
|
||||||
interface ConcreteVersionResolver {
|
|
||||||
resolve(
|
|
||||||
context: ConcreteVersionResolutionContext,
|
|
||||||
): Promise<string | undefined>;
|
|
||||||
}
|
|
||||||
|
|
||||||
class ExactVersionResolver implements ConcreteVersionResolver {
|
|
||||||
async resolve(
|
|
||||||
context: ConcreteVersionResolutionContext,
|
|
||||||
): Promise<string | undefined> {
|
|
||||||
if (context.parsedSpecifier.kind !== "exact") {
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
let uvVersion: string | undefined;
|
||||||
core.debug(
|
try {
|
||||||
`Version ${context.parsedSpecifier.normalized} is an explicit version.`,
|
uvVersion = getUvVersionFromToolVersions(filePath);
|
||||||
);
|
if (uvVersion === undefined) {
|
||||||
return context.parsedSpecifier.normalized;
|
uvVersion = getConfigValueFromTomlFile(filePath, "required-version");
|
||||||
}
|
}
|
||||||
}
|
if (uvVersion === undefined) {
|
||||||
|
uvVersion = getUvVersionFromRequirementsFile(filePath);
|
||||||
class LatestVersionResolver implements ConcreteVersionResolver {
|
}
|
||||||
async resolve(
|
} catch (err) {
|
||||||
context: ConcreteVersionResolutionContext,
|
const message = (err as Error).message;
|
||||||
): Promise<string | undefined> {
|
core.warning(`Error while parsing ${filePath}: ${message}`);
|
||||||
const shouldUseLatestVersion =
|
|
||||||
context.parsedSpecifier.kind === "latest" ||
|
|
||||||
(context.parsedSpecifier.kind === "range" &&
|
|
||||||
context.parsedSpecifier.isSimpleMinimumVersionSpecifier &&
|
|
||||||
context.resolutionStrategy === "highest");
|
|
||||||
|
|
||||||
if (!shouldUseLatestVersion) {
|
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
if (uvVersion?.startsWith("==")) {
|
||||||
if (
|
uvVersion = uvVersion.slice(2);
|
||||||
context.parsedSpecifier.kind === "range" &&
|
|
||||||
context.parsedSpecifier.isSimpleMinimumVersionSpecifier
|
|
||||||
) {
|
|
||||||
core.info("Found minimum version specifier, using latest version");
|
|
||||||
}
|
}
|
||||||
|
if (uvVersion !== undefined) {
|
||||||
const latestVersion = await getLatestVersion(context.manifestUrl);
|
core.info(`Found version for uv in ${filePath}: ${uvVersion}`);
|
||||||
|
|
||||||
if (
|
|
||||||
context.parsedSpecifier.kind === "range" &&
|
|
||||||
context.parsedSpecifier.isSimpleMinimumVersionSpecifier &&
|
|
||||||
!pep440.satisfies(latestVersion, context.parsedSpecifier.raw)
|
|
||||||
) {
|
|
||||||
throw new Error(`No version found for ${context.parsedSpecifier.raw}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return latestVersion;
|
|
||||||
}
|
}
|
||||||
}
|
return uvVersion;
|
||||||
|
|
||||||
class RangeVersionResolver implements ConcreteVersionResolver {
|
|
||||||
async resolve(
|
|
||||||
context: ConcreteVersionResolutionContext,
|
|
||||||
): Promise<string | undefined> {
|
|
||||||
if (context.parsedSpecifier.kind !== "range") {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const availableVersions = await getAllVersions(context.manifestUrl);
|
|
||||||
core.debug(`Available versions: ${availableVersions}`);
|
|
||||||
|
|
||||||
const resolvedVersion =
|
|
||||||
context.resolutionStrategy === "lowest"
|
|
||||||
? minSatisfying(availableVersions, context.parsedSpecifier.normalized)
|
|
||||||
: maxSatisfying(availableVersions, context.parsedSpecifier.normalized);
|
|
||||||
|
|
||||||
if (resolvedVersion === undefined) {
|
|
||||||
throw new Error(`No version found for ${context.parsedSpecifier.raw}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
return resolvedVersion;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const CONCRETE_VERSION_RESOLVERS: ConcreteVersionResolver[] = [
|
|
||||||
new ExactVersionResolver(),
|
|
||||||
new LatestVersionResolver(),
|
|
||||||
new RangeVersionResolver(),
|
|
||||||
];
|
|
||||||
|
|
||||||
export async function resolveUvVersion(
|
|
||||||
options: ResolveUvVersionOptions,
|
|
||||||
): Promise<string> {
|
|
||||||
const request = resolveVersionRequest(options);
|
|
||||||
const resolutionStrategy = options.resolutionStrategy ?? "highest";
|
|
||||||
const version = await resolveVersion(
|
|
||||||
request.specifier,
|
|
||||||
options.manifestFile,
|
|
||||||
resolutionStrategy,
|
|
||||||
);
|
|
||||||
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function resolveVersion(
|
|
||||||
versionInput: string,
|
|
||||||
manifestUrl: string | undefined,
|
|
||||||
resolutionStrategy: ResolutionStrategy = "highest",
|
|
||||||
): Promise<string> {
|
|
||||||
core.debug(`Resolving version: ${versionInput}`);
|
|
||||||
|
|
||||||
const context: ConcreteVersionResolutionContext = {
|
|
||||||
manifestUrl,
|
|
||||||
parsedSpecifier: parseVersionSpecifier(versionInput),
|
|
||||||
resolutionStrategy,
|
|
||||||
};
|
|
||||||
|
|
||||||
for (const resolver of CONCRETE_VERSION_RESOLVERS) {
|
|
||||||
const version = await resolver.resolve(context);
|
|
||||||
if (version !== undefined) {
|
|
||||||
return version;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error(`No version found for ${versionInput}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
function maxSatisfying(
|
|
||||||
versions: string[],
|
|
||||||
version: string,
|
|
||||||
): string | undefined {
|
|
||||||
const maxSemver = tc.evaluateVersions(versions, version);
|
|
||||||
if (maxSemver !== "") {
|
|
||||||
core.debug(`Found a version that satisfies the semver range: ${maxSemver}`);
|
|
||||||
return maxSemver;
|
|
||||||
}
|
|
||||||
|
|
||||||
const maxPep440 = pep440.maxSatisfying(versions, version);
|
|
||||||
if (maxPep440 !== null) {
|
|
||||||
core.debug(
|
|
||||||
`Found a version that satisfies the pep440 specifier: ${maxPep440}`,
|
|
||||||
);
|
|
||||||
return maxPep440;
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
function minSatisfying(
|
|
||||||
versions: string[],
|
|
||||||
version: string,
|
|
||||||
): string | undefined {
|
|
||||||
const minSemver = semver.minSatisfying(versions, version);
|
|
||||||
if (minSemver !== null) {
|
|
||||||
core.debug(`Found a version that satisfies the semver range: ${minSemver}`);
|
|
||||||
return minSemver;
|
|
||||||
}
|
|
||||||
|
|
||||||
const minPep440 = pep440.minSatisfying(versions, version);
|
|
||||||
if (minPep440 !== null) {
|
|
||||||
core.debug(
|
|
||||||
`Found a version that satisfies the pep440 specifier: ${minPep440}`,
|
|
||||||
);
|
|
||||||
return minPep440;
|
|
||||||
}
|
|
||||||
|
|
||||||
return undefined;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,59 +0,0 @@
|
|||||||
import * as tc from "@actions/tool-cache";
|
|
||||||
|
|
||||||
export type ParsedVersionSpecifier =
|
|
||||||
| {
|
|
||||||
kind: "exact";
|
|
||||||
normalized: string;
|
|
||||||
raw: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
kind: "latest";
|
|
||||||
normalized: "latest";
|
|
||||||
raw: string;
|
|
||||||
}
|
|
||||||
| {
|
|
||||||
isSimpleMinimumVersionSpecifier: boolean;
|
|
||||||
kind: "range";
|
|
||||||
normalized: string;
|
|
||||||
raw: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function normalizeVersionSpecifier(specifier: string): string {
|
|
||||||
const trimmedSpecifier = specifier.trim();
|
|
||||||
|
|
||||||
if (trimmedSpecifier.startsWith("==")) {
|
|
||||||
return trimmedSpecifier.slice(2);
|
|
||||||
}
|
|
||||||
|
|
||||||
return trimmedSpecifier;
|
|
||||||
}
|
|
||||||
|
|
||||||
export function parseVersionSpecifier(
|
|
||||||
specifier: string,
|
|
||||||
): ParsedVersionSpecifier {
|
|
||||||
const raw = specifier.trim();
|
|
||||||
const normalized = normalizeVersionSpecifier(raw);
|
|
||||||
|
|
||||||
if (normalized === "latest") {
|
|
||||||
return {
|
|
||||||
kind: "latest",
|
|
||||||
normalized: "latest",
|
|
||||||
raw,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tc.isExplicitVersion(normalized)) {
|
|
||||||
return {
|
|
||||||
kind: "exact",
|
|
||||||
normalized,
|
|
||||||
raw,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
isSimpleMinimumVersionSpecifier: raw.includes(">") && !raw.includes(","),
|
|
||||||
kind: "range",
|
|
||||||
normalized,
|
|
||||||
raw,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
import type { ResolutionStrategy } from "../utils/inputs";
|
|
||||||
|
|
||||||
export type VersionSource =
|
|
||||||
| "input"
|
|
||||||
| "version-file"
|
|
||||||
| "uv.toml"
|
|
||||||
| "pyproject.toml"
|
|
||||||
| "default";
|
|
||||||
|
|
||||||
export type VersionFileFormat =
|
|
||||||
| ".tool-versions"
|
|
||||||
| "pyproject.toml"
|
|
||||||
| "requirements"
|
|
||||||
| "uv.toml";
|
|
||||||
|
|
||||||
export interface ParsedVersionFile {
|
|
||||||
format: VersionFileFormat;
|
|
||||||
specifier: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ResolveUvVersionOptions {
|
|
||||||
manifestFile?: string;
|
|
||||||
resolutionStrategy?: ResolutionStrategy;
|
|
||||||
version?: string;
|
|
||||||
versionFile?: string;
|
|
||||||
workingDirectory: string;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface VersionRequest {
|
|
||||||
format?: VersionFileFormat;
|
|
||||||
source: VersionSource;
|
|
||||||
sourcePath?: string;
|
|
||||||
specifier: string;
|
|
||||||
}
|
|
||||||
@@ -1,158 +0,0 @@
|
|||||||
import * as path from "node:path";
|
|
||||||
import * as core from "@actions/core";
|
|
||||||
import { getParsedVersionFile } from "./file-parser";
|
|
||||||
import { normalizeVersionSpecifier } from "./specifier";
|
|
||||||
import type {
|
|
||||||
ParsedVersionFile,
|
|
||||||
ResolveUvVersionOptions,
|
|
||||||
VersionRequest,
|
|
||||||
} from "./types";
|
|
||||||
|
|
||||||
export interface VersionRequestResolver {
|
|
||||||
resolve(context: VersionRequestContext): VersionRequest | undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
export class VersionRequestContext {
|
|
||||||
readonly version: string | undefined;
|
|
||||||
readonly versionFile: string | undefined;
|
|
||||||
readonly workingDirectory: string;
|
|
||||||
|
|
||||||
private readonly parsedFiles = new Map<
|
|
||||||
string,
|
|
||||||
ParsedVersionFile | undefined
|
|
||||||
>();
|
|
||||||
|
|
||||||
constructor(
|
|
||||||
version: string | undefined,
|
|
||||||
versionFile: string | undefined,
|
|
||||||
workingDirectory: string,
|
|
||||||
) {
|
|
||||||
this.version = version;
|
|
||||||
this.versionFile = versionFile;
|
|
||||||
this.workingDirectory = workingDirectory;
|
|
||||||
}
|
|
||||||
|
|
||||||
getVersionFile(filePath: string): ParsedVersionFile | undefined {
|
|
||||||
const cachedResult = this.parsedFiles.get(filePath);
|
|
||||||
if (cachedResult !== undefined || this.parsedFiles.has(filePath)) {
|
|
||||||
return cachedResult;
|
|
||||||
}
|
|
||||||
|
|
||||||
const result = getParsedVersionFile(filePath);
|
|
||||||
this.parsedFiles.set(filePath, result);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
getWorkspaceCandidates(): Array<{
|
|
||||||
source: "pyproject.toml" | "uv.toml";
|
|
||||||
sourcePath: string;
|
|
||||||
}> {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
source: "uv.toml",
|
|
||||||
sourcePath: path.join(this.workingDirectory, "uv.toml"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
source: "pyproject.toml",
|
|
||||||
sourcePath: path.join(this.workingDirectory, "pyproject.toml"),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class ExplicitInputVersionResolver implements VersionRequestResolver {
|
|
||||||
resolve(context: VersionRequestContext): VersionRequest | undefined {
|
|
||||||
if (context.version === undefined) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
source: "input",
|
|
||||||
specifier: normalizeVersionSpecifier(context.version),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class VersionFileVersionResolver implements VersionRequestResolver {
|
|
||||||
resolve(context: VersionRequestContext): VersionRequest | undefined {
|
|
||||||
if (context.versionFile === undefined) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
|
|
||||||
const versionFile = context.getVersionFile(context.versionFile);
|
|
||||||
if (versionFile === undefined) {
|
|
||||||
throw new Error(
|
|
||||||
`Could not determine uv version from file: ${context.versionFile}`,
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
format: versionFile.format,
|
|
||||||
source: "version-file",
|
|
||||||
sourcePath: context.versionFile,
|
|
||||||
specifier: versionFile.specifier,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class WorkspaceVersionResolver implements VersionRequestResolver {
|
|
||||||
resolve(context: VersionRequestContext): VersionRequest | undefined {
|
|
||||||
for (const candidate of context.getWorkspaceCandidates()) {
|
|
||||||
const versionFile = context.getVersionFile(candidate.sourcePath);
|
|
||||||
if (versionFile === undefined) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
format: versionFile.format,
|
|
||||||
source: candidate.source,
|
|
||||||
sourcePath: candidate.sourcePath,
|
|
||||||
specifier: versionFile.specifier,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
core.info(
|
|
||||||
"Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest.",
|
|
||||||
);
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class LatestVersionResolver implements VersionRequestResolver {
|
|
||||||
resolve(): VersionRequest {
|
|
||||||
return {
|
|
||||||
source: "default",
|
|
||||||
specifier: "latest",
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
const VERSION_REQUEST_RESOLVERS: VersionRequestResolver[] = [
|
|
||||||
new ExplicitInputVersionResolver(),
|
|
||||||
new VersionFileVersionResolver(),
|
|
||||||
new WorkspaceVersionResolver(),
|
|
||||||
new LatestVersionResolver(),
|
|
||||||
];
|
|
||||||
|
|
||||||
export function resolveVersionRequest(
|
|
||||||
options: ResolveUvVersionOptions,
|
|
||||||
): VersionRequest {
|
|
||||||
const context = new VersionRequestContext(
|
|
||||||
emptyToUndefined(options.version),
|
|
||||||
emptyToUndefined(options.versionFile),
|
|
||||||
options.workingDirectory,
|
|
||||||
);
|
|
||||||
|
|
||||||
for (const resolver of VERSION_REQUEST_RESOLVERS) {
|
|
||||||
const request = resolver.resolve(context);
|
|
||||||
if (request !== undefined) {
|
|
||||||
return request;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error("Could not resolve a requested uv version.");
|
|
||||||
}
|
|
||||||
|
|
||||||
function emptyToUndefined(value: string | undefined): string | undefined {
|
|
||||||
return value === undefined || value === "" ? undefined : value;
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user