From c20049fc2623b92458fdef3cdba4e917c082257e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Mar 2026 07:48:09 +0100 Subject: [PATCH 01/20] chore: update known checksums for 0.10.11/0.10.12 (#811) --- dist/setup/index.cjs | 34 ++++++++++++ dist/update-known-checksums/index.cjs | 34 ++++++++++++ src/download/checksum/known-checksums.ts | 68 ++++++++++++++++++++++++ 3 files changed, 136 insertions(+) diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index 4fc9565..0b999c8 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -91896,6 +91896,40 @@ var fs11 = __toESM(require("node:fs"), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.10.12": "ae738b5661a900579ec621d3918c0ef17bdec0da2a8a6d8b161137cd15f25414", + "aarch64-pc-windows-msvc-0.10.12": "e79881e2c4f98a0f3a37b8770bf224e8fee70f6dcf8fc17055d8291bb1b0b867", + "aarch64-unknown-linux-gnu-0.10.12": "0ed7d20f49f6b9b60d45fdfcac28f3ac01a671a6ef08672401ed2833423fea2a", + "aarch64-unknown-linux-musl-0.10.12": "55bd1c1c10ec8b95a8c184f5e18b566703c6ab105f0fc118aaa4d748aabf28e4", + "arm-unknown-linux-musleabihf-0.10.12": "9714e5059b05110a1c7ddbc18c971c13e0260e10551b7b77d82cbf907a4ebd9b", + "armv7-unknown-linux-gnueabihf-0.10.12": "eaa02f36d5112029601b18ac3d1a0c03a83bb20cb4154c2f5345f777fa6c4101", + "armv7-unknown-linux-musleabihf-0.10.12": "bd735652298c6e62cdd2ac939babe176a3356613e6803baa33d0bc10e8d9e4ed", + "i686-pc-windows-msvc-0.10.12": "2312e75b9c77befdc1bff30da18f16df03083452852952553bee91da362c1a1d", + "i686-unknown-linux-gnu-0.10.12": "8501844b34e3a28cfbba5a4b857eebd696d952e0bb4160357451ad80f3f49db8", + "i686-unknown-linux-musl-0.10.12": "56cad78abcf5b710d2f7b9f774fcfd6bbed340d2aa9d9fc9e3b515542ec5e953", + "powerpc64le-unknown-linux-gnu-0.10.12": "3c8017d9112221c83f43e8a15a58099663c0b2bdeabc8b43bb800413dfa21218", + "riscv64gc-unknown-linux-gnu-0.10.12": "b1ca482b6b5dd7bf6ab733a3695cb0ab5b8e992ca96527efae93aa78fcc52a9b", + "s390x-unknown-linux-gnu-0.10.12": "e1a0345eefe6fd3300948cd6f18aab092f9b88a243782113e645ce96530a6693", + "x86_64-apple-darwin-0.10.12": "17443e293f2ae407bb2d8d34b875ebfe0ae01cf1296de5647e69e7b2e2b428f0", + "x86_64-pc-windows-msvc-0.10.12": "4c1d55501869b3330d4aabf45ad6024ce2367e0f3af83344395702d272c22e88", + "x86_64-unknown-linux-gnu-0.10.12": "ec72570c9d1f33021aa80b176d7baba390de2cfeb1abcbefca346d563bf17484", + "x86_64-unknown-linux-musl-0.10.12": "adccf40b5d1939a5e0093081ec2307ea24235adf7c2d96b122c561fa37711c46", + "aarch64-apple-darwin-0.10.11": "437a7d498dd6564d5bf986074249ba1fc600e73da55ae04d7bd4c24d5f149b95", + "aarch64-pc-windows-msvc-0.10.11": "6a3eec4105c775dd87c11ef8ec41564648273751ff807c8955c24ddbcc636d03", + "aarch64-unknown-linux-gnu-0.10.11": "23003df007937dd607409c8ddf010baa82bad2673e60e254632ca5b04edcce13", + "aarch64-unknown-linux-musl-0.10.11": "5d80a7f6343d2676dfde1e5126582070a2bbc62df6f60d5527a169be3788532a", + "arm-unknown-linux-musleabihf-0.10.11": "d3c248497c450d22a39c1d43a4a358c0c852e6056f5f49be96495eea41afb96c", + "armv7-unknown-linux-gnueabihf-0.10.11": "7895a6470dfba051af4e74253599482fc0b37141b5d229956b383365e1a22902", + "armv7-unknown-linux-musleabihf-0.10.11": "d2880c08acfdaef0985488972c8b14969f7139c27545046e2f6202f0e0f4d9d8", + "i686-pc-windows-msvc-0.10.11": "c17f3dc3b2c47490057f17a1f0c37270f11a7b7cedf9bf2c0f841ce02bc7001b", + "i686-unknown-linux-gnu-0.10.11": "1ab69ff7dd104a902731758ee05b782dfd9bdb263384e61650de638f33f586df", + "i686-unknown-linux-musl-0.10.11": "cffb80d303fc1655e259d0b769c489f452e97425a6b6d3393d766413783a1d8c", + "powerpc64le-unknown-linux-gnu-0.10.11": "ddc6a20670e60219e947b1b04813be80d7e9f4c4a0234231c8ed9298eec04aa6", + "riscv64gc-unknown-linux-gnu-0.10.11": "c0719473cf5f8b475e917b8dfef6ae5d876b86a00a82ef91e47a02f561399f4f", + "s390x-unknown-linux-gnu-0.10.11": "305ee734c585918515a22fe43b7cf253c38d468771373a0c02364d67498e07b2", + "x86_64-apple-darwin-0.10.11": "ff90020b554cf02ef8008535c9aab6ef27bb7be6b075359300dec79c361df897", + "x86_64-pc-windows-msvc-0.10.11": "9ee74df98582f37fdd6069e1caac80d2616f9a489f5dbb2b1c152f30be69c58e", + "x86_64-unknown-linux-gnu-0.10.11": "5a360b0de092ddf4131f5313d0411b48c4e95e8107e40c3f8f2e9fcb636b3583", + "x86_64-unknown-linux-musl-0.10.11": "d78246139dc6cf3ed6d03c84da762686bced7ad1de67977ee372a45b95a1f6d0", "aarch64-apple-darwin-0.10.10": "8a09f0ef51ee7f7170731b4cb8bde5bf9ba6da5304f49a7df6cdab42a1f37b5d", "aarch64-pc-windows-msvc-0.10.10": "2c6fe113f14574bc27f085751c68d3485589fcc3c3c64ed85dd1eecc2f87cffc", "aarch64-unknown-linux-gnu-0.10.10": "2b80457b950deda12e8d5dc3b9b7494ac143eae47f1fb11b1c6e5a8495a6421e", diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index 2468493..b10872f 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -44949,6 +44949,40 @@ var semver = __toESM(require_semver(), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.10.12": "ae738b5661a900579ec621d3918c0ef17bdec0da2a8a6d8b161137cd15f25414", + "aarch64-pc-windows-msvc-0.10.12": "e79881e2c4f98a0f3a37b8770bf224e8fee70f6dcf8fc17055d8291bb1b0b867", + "aarch64-unknown-linux-gnu-0.10.12": "0ed7d20f49f6b9b60d45fdfcac28f3ac01a671a6ef08672401ed2833423fea2a", + "aarch64-unknown-linux-musl-0.10.12": "55bd1c1c10ec8b95a8c184f5e18b566703c6ab105f0fc118aaa4d748aabf28e4", + "arm-unknown-linux-musleabihf-0.10.12": "9714e5059b05110a1c7ddbc18c971c13e0260e10551b7b77d82cbf907a4ebd9b", + "armv7-unknown-linux-gnueabihf-0.10.12": "eaa02f36d5112029601b18ac3d1a0c03a83bb20cb4154c2f5345f777fa6c4101", + "armv7-unknown-linux-musleabihf-0.10.12": "bd735652298c6e62cdd2ac939babe176a3356613e6803baa33d0bc10e8d9e4ed", + "i686-pc-windows-msvc-0.10.12": "2312e75b9c77befdc1bff30da18f16df03083452852952553bee91da362c1a1d", + "i686-unknown-linux-gnu-0.10.12": "8501844b34e3a28cfbba5a4b857eebd696d952e0bb4160357451ad80f3f49db8", + "i686-unknown-linux-musl-0.10.12": "56cad78abcf5b710d2f7b9f774fcfd6bbed340d2aa9d9fc9e3b515542ec5e953", + "powerpc64le-unknown-linux-gnu-0.10.12": "3c8017d9112221c83f43e8a15a58099663c0b2bdeabc8b43bb800413dfa21218", + "riscv64gc-unknown-linux-gnu-0.10.12": "b1ca482b6b5dd7bf6ab733a3695cb0ab5b8e992ca96527efae93aa78fcc52a9b", + "s390x-unknown-linux-gnu-0.10.12": "e1a0345eefe6fd3300948cd6f18aab092f9b88a243782113e645ce96530a6693", + "x86_64-apple-darwin-0.10.12": "17443e293f2ae407bb2d8d34b875ebfe0ae01cf1296de5647e69e7b2e2b428f0", + "x86_64-pc-windows-msvc-0.10.12": "4c1d55501869b3330d4aabf45ad6024ce2367e0f3af83344395702d272c22e88", + "x86_64-unknown-linux-gnu-0.10.12": "ec72570c9d1f33021aa80b176d7baba390de2cfeb1abcbefca346d563bf17484", + "x86_64-unknown-linux-musl-0.10.12": "adccf40b5d1939a5e0093081ec2307ea24235adf7c2d96b122c561fa37711c46", + "aarch64-apple-darwin-0.10.11": "437a7d498dd6564d5bf986074249ba1fc600e73da55ae04d7bd4c24d5f149b95", + "aarch64-pc-windows-msvc-0.10.11": "6a3eec4105c775dd87c11ef8ec41564648273751ff807c8955c24ddbcc636d03", + "aarch64-unknown-linux-gnu-0.10.11": "23003df007937dd607409c8ddf010baa82bad2673e60e254632ca5b04edcce13", + "aarch64-unknown-linux-musl-0.10.11": "5d80a7f6343d2676dfde1e5126582070a2bbc62df6f60d5527a169be3788532a", + "arm-unknown-linux-musleabihf-0.10.11": "d3c248497c450d22a39c1d43a4a358c0c852e6056f5f49be96495eea41afb96c", + "armv7-unknown-linux-gnueabihf-0.10.11": "7895a6470dfba051af4e74253599482fc0b37141b5d229956b383365e1a22902", + "armv7-unknown-linux-musleabihf-0.10.11": "d2880c08acfdaef0985488972c8b14969f7139c27545046e2f6202f0e0f4d9d8", + "i686-pc-windows-msvc-0.10.11": "c17f3dc3b2c47490057f17a1f0c37270f11a7b7cedf9bf2c0f841ce02bc7001b", + "i686-unknown-linux-gnu-0.10.11": "1ab69ff7dd104a902731758ee05b782dfd9bdb263384e61650de638f33f586df", + "i686-unknown-linux-musl-0.10.11": "cffb80d303fc1655e259d0b769c489f452e97425a6b6d3393d766413783a1d8c", + "powerpc64le-unknown-linux-gnu-0.10.11": "ddc6a20670e60219e947b1b04813be80d7e9f4c4a0234231c8ed9298eec04aa6", + "riscv64gc-unknown-linux-gnu-0.10.11": "c0719473cf5f8b475e917b8dfef6ae5d876b86a00a82ef91e47a02f561399f4f", + "s390x-unknown-linux-gnu-0.10.11": "305ee734c585918515a22fe43b7cf253c38d468771373a0c02364d67498e07b2", + "x86_64-apple-darwin-0.10.11": "ff90020b554cf02ef8008535c9aab6ef27bb7be6b075359300dec79c361df897", + "x86_64-pc-windows-msvc-0.10.11": "9ee74df98582f37fdd6069e1caac80d2616f9a489f5dbb2b1c152f30be69c58e", + "x86_64-unknown-linux-gnu-0.10.11": "5a360b0de092ddf4131f5313d0411b48c4e95e8107e40c3f8f2e9fcb636b3583", + "x86_64-unknown-linux-musl-0.10.11": "d78246139dc6cf3ed6d03c84da762686bced7ad1de67977ee372a45b95a1f6d0", "aarch64-apple-darwin-0.10.10": "8a09f0ef51ee7f7170731b4cb8bde5bf9ba6da5304f49a7df6cdab42a1f37b5d", "aarch64-pc-windows-msvc-0.10.10": "2c6fe113f14574bc27f085751c68d3485589fcc3c3c64ed85dd1eecc2f87cffc", "aarch64-unknown-linux-gnu-0.10.10": "2b80457b950deda12e8d5dc3b9b7494ac143eae47f1fb11b1c6e5a8495a6421e", diff --git a/src/download/checksum/known-checksums.ts b/src/download/checksum/known-checksums.ts index 8f32d6a..af636eb 100644 --- a/src/download/checksum/known-checksums.ts +++ b/src/download/checksum/known-checksums.ts @@ -1,5 +1,73 @@ // AUTOGENERATED_DO_NOT_EDIT export const KNOWN_CHECKSUMS: { [key: string]: string } = { + "aarch64-apple-darwin-0.10.12": + "ae738b5661a900579ec621d3918c0ef17bdec0da2a8a6d8b161137cd15f25414", + "aarch64-pc-windows-msvc-0.10.12": + "e79881e2c4f98a0f3a37b8770bf224e8fee70f6dcf8fc17055d8291bb1b0b867", + "aarch64-unknown-linux-gnu-0.10.12": + "0ed7d20f49f6b9b60d45fdfcac28f3ac01a671a6ef08672401ed2833423fea2a", + "aarch64-unknown-linux-musl-0.10.12": + "55bd1c1c10ec8b95a8c184f5e18b566703c6ab105f0fc118aaa4d748aabf28e4", + "arm-unknown-linux-musleabihf-0.10.12": + "9714e5059b05110a1c7ddbc18c971c13e0260e10551b7b77d82cbf907a4ebd9b", + "armv7-unknown-linux-gnueabihf-0.10.12": + "eaa02f36d5112029601b18ac3d1a0c03a83bb20cb4154c2f5345f777fa6c4101", + "armv7-unknown-linux-musleabihf-0.10.12": + "bd735652298c6e62cdd2ac939babe176a3356613e6803baa33d0bc10e8d9e4ed", + "i686-pc-windows-msvc-0.10.12": + "2312e75b9c77befdc1bff30da18f16df03083452852952553bee91da362c1a1d", + "i686-unknown-linux-gnu-0.10.12": + "8501844b34e3a28cfbba5a4b857eebd696d952e0bb4160357451ad80f3f49db8", + "i686-unknown-linux-musl-0.10.12": + "56cad78abcf5b710d2f7b9f774fcfd6bbed340d2aa9d9fc9e3b515542ec5e953", + "powerpc64le-unknown-linux-gnu-0.10.12": + "3c8017d9112221c83f43e8a15a58099663c0b2bdeabc8b43bb800413dfa21218", + "riscv64gc-unknown-linux-gnu-0.10.12": + "b1ca482b6b5dd7bf6ab733a3695cb0ab5b8e992ca96527efae93aa78fcc52a9b", + "s390x-unknown-linux-gnu-0.10.12": + "e1a0345eefe6fd3300948cd6f18aab092f9b88a243782113e645ce96530a6693", + "x86_64-apple-darwin-0.10.12": + "17443e293f2ae407bb2d8d34b875ebfe0ae01cf1296de5647e69e7b2e2b428f0", + "x86_64-pc-windows-msvc-0.10.12": + "4c1d55501869b3330d4aabf45ad6024ce2367e0f3af83344395702d272c22e88", + "x86_64-unknown-linux-gnu-0.10.12": + "ec72570c9d1f33021aa80b176d7baba390de2cfeb1abcbefca346d563bf17484", + "x86_64-unknown-linux-musl-0.10.12": + "adccf40b5d1939a5e0093081ec2307ea24235adf7c2d96b122c561fa37711c46", + "aarch64-apple-darwin-0.10.11": + "437a7d498dd6564d5bf986074249ba1fc600e73da55ae04d7bd4c24d5f149b95", + "aarch64-pc-windows-msvc-0.10.11": + "6a3eec4105c775dd87c11ef8ec41564648273751ff807c8955c24ddbcc636d03", + "aarch64-unknown-linux-gnu-0.10.11": + "23003df007937dd607409c8ddf010baa82bad2673e60e254632ca5b04edcce13", + "aarch64-unknown-linux-musl-0.10.11": + "5d80a7f6343d2676dfde1e5126582070a2bbc62df6f60d5527a169be3788532a", + "arm-unknown-linux-musleabihf-0.10.11": + "d3c248497c450d22a39c1d43a4a358c0c852e6056f5f49be96495eea41afb96c", + "armv7-unknown-linux-gnueabihf-0.10.11": + "7895a6470dfba051af4e74253599482fc0b37141b5d229956b383365e1a22902", + "armv7-unknown-linux-musleabihf-0.10.11": + "d2880c08acfdaef0985488972c8b14969f7139c27545046e2f6202f0e0f4d9d8", + "i686-pc-windows-msvc-0.10.11": + "c17f3dc3b2c47490057f17a1f0c37270f11a7b7cedf9bf2c0f841ce02bc7001b", + "i686-unknown-linux-gnu-0.10.11": + "1ab69ff7dd104a902731758ee05b782dfd9bdb263384e61650de638f33f586df", + "i686-unknown-linux-musl-0.10.11": + "cffb80d303fc1655e259d0b769c489f452e97425a6b6d3393d766413783a1d8c", + "powerpc64le-unknown-linux-gnu-0.10.11": + "ddc6a20670e60219e947b1b04813be80d7e9f4c4a0234231c8ed9298eec04aa6", + "riscv64gc-unknown-linux-gnu-0.10.11": + "c0719473cf5f8b475e917b8dfef6ae5d876b86a00a82ef91e47a02f561399f4f", + "s390x-unknown-linux-gnu-0.10.11": + "305ee734c585918515a22fe43b7cf253c38d468771373a0c02364d67498e07b2", + "x86_64-apple-darwin-0.10.11": + "ff90020b554cf02ef8008535c9aab6ef27bb7be6b075359300dec79c361df897", + "x86_64-pc-windows-msvc-0.10.11": + "9ee74df98582f37fdd6069e1caac80d2616f9a489f5dbb2b1c152f30be69c58e", + "x86_64-unknown-linux-gnu-0.10.11": + "5a360b0de092ddf4131f5313d0411b48c4e95e8107e40c3f8f2e9fcb636b3583", + "x86_64-unknown-linux-musl-0.10.11": + "d78246139dc6cf3ed6d03c84da762686bced7ad1de67977ee372a45b95a1f6d0", "aarch64-apple-darwin-0.10.10": "8a09f0ef51ee7f7170731b4cb8bde5bf9ba6da5304f49a7df6cdab42a1f37b5d", "aarch64-pc-windows-msvc-0.10.10": From 8cc8d1cbfc1957afca841a8e017611a0c8a1233f Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Fri, 20 Mar 2026 10:51:55 +0100 Subject: [PATCH 02/20] Fix latest-version workflow check (#812) ## Summary - make the latest-version workflow test use the action output for the exact installed version - allow `uv --version` to include additional platform/build metadata - keep validating that the reported version matches the latest GitHub release ## Testing - npm ci --ignore-scripts - npm run all - actionlint .github/workflows/test.yml Fixes the failure in https://github.com/astral-sh/setup-uv/actions/runs/23332230171/job/67866051063 --- .github/workflows/test.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec00663..97431bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -164,10 +164,22 @@ jobs: - name: Latest version gets installed run: | LATEST_VERSION=$(gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/astral-sh/uv/releases/latest | jq -r '.tag_name') + UV_VERSION_OUTPUT=$(uv --version) + + if [[ ! "$UV_VERSION_OUTPUT" =~ ^uv[[:space:]]+([^[:space:]]+) ]]; then + echo "Could not parse uv version from: $UV_VERSION_OUTPUT" + exit 1 + fi + + UV_VERSION="${BASH_REMATCH[1]}" + echo "Latest version is $LATEST_VERSION" - if [ "$(uv --version)" != "uv $LATEST_VERSION" ]; then - echo "Wrong uv version: $(uv --version)" - exit 1 + echo "uv --version output is $UV_VERSION_OUTPUT" + echo "Parsed uv version is $UV_VERSION" + + if [ "$UV_VERSION" != "$LATEST_VERSION" ]; then + echo "Wrong uv version: $UV_VERSION_OUTPUT" + exit 1 fi env: GH_TOKEN: ${{ github.token }} From 89709315bb3bd4bf0f4b1db4b710e99009087ab5 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Mon, 23 Mar 2026 09:15:51 +0100 Subject: [PATCH 03/20] Remove deprecrated custom manifest (#813) --- .github/workflows/test.yml | 4 +- README.md | 6 +- __tests__/download/custom-manifest.json | 9 - __tests__/download/custom-manifest.ndjson | 1 + __tests__/download/download-version.test.ts | 239 ++++++------- __tests__/download/manifest.test.ts | 168 +++++++++ __tests__/download/version-manifest.test.ts | 136 -------- __tests__/download/versions-client.test.ts | 170 --------- action.yml | 2 +- dist/setup/index.cjs | 360 ++++++-------------- dist/update-known-checksums/index.cjs | 98 +++--- docs/customization.md | 21 +- src/download/download-version.ts | 130 +++---- src/download/legacy-version-manifest.ts | 80 ----- src/download/manifest.ts | 208 +++++++++++ src/download/version-manifest.ts | 169 --------- src/download/versions-client.ts | 191 ----------- src/setup-uv.ts | 64 ++-- src/update-known-checksums.ts | 14 +- src/utils/constants.ts | 2 +- 20 files changed, 736 insertions(+), 1336 deletions(-) delete mode 100644 __tests__/download/custom-manifest.json create mode 100644 __tests__/download/custom-manifest.ndjson create mode 100644 __tests__/download/manifest.test.ts delete mode 100644 __tests__/download/version-manifest.test.ts delete mode 100644 __tests__/download/versions-client.test.ts delete mode 100644 src/download/legacy-version-manifest.ts create mode 100644 src/download/manifest.ts delete mode 100644 src/download/version-manifest.ts delete mode 100644 src/download/versions-client.ts diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 97431bb..04669ee 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -808,12 +808,12 @@ jobs: - name: Install from custom manifest file uses: ./ with: - manifest-file: "https://raw.githubusercontent.com/astral-sh/setup-uv/${{ github.ref }}/__tests__/download/custom-manifest.json" + manifest-file: "https://raw.githubusercontent.com/astral-sh/setup-uv/${{ github.ref }}/__tests__/download/custom-manifest.ndjson" - run: uv sync working-directory: __tests__/fixtures/uv-project - name: Correct version gets installed run: | - if [ "$(uv --version)" != "uv 0.7.12-alpha.1" ]; then + if [ "$(uv --version)" != "uv 0.9.26" ]; then echo "Wrong uv version: $(uv --version)" exit 1 fi diff --git a/README.md b/README.md index 0c307b5..30736be 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,7 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed # Custom path to set UV_TOOL_BIN_DIR to tool-bin-dir: "" - # URL to a custom manifest file (NDJSON preferred, legacy JSON array is deprecated) + # URL to a custom manifest file in the astral-sh/versions format manifest-file: "" # Add problem matchers @@ -190,8 +190,8 @@ For more advanced configuration options, see our detailed documentation: ## How it works -By default, this action resolves uv versions from -[`astral-sh/versions`](https://github.com/astral-sh/versions) (NDJSON) and downloads uv from the +By default, this action resolves uv versions from the +[`astral-sh/versions`](https://github.com/astral-sh/versions) manifest and downloads uv from the official [GitHub Releases](https://github.com/astral-sh/uv). It then uses the [GitHub Actions Toolkit](https://github.com/actions/toolkit) to cache uv as a diff --git a/__tests__/download/custom-manifest.json b/__tests__/download/custom-manifest.json deleted file mode 100644 index 1c131e4..0000000 --- a/__tests__/download/custom-manifest.json +++ /dev/null @@ -1,9 +0,0 @@ -[ - { - "arch": "x86_64", - "artifactName": "uv-x86_64-unknown-linux-gnu.tar.gz", - "downloadUrl": "https://release.pyx.dev/0.7.12-alpha.1/uv-x86_64-unknown-linux-gnu.tar.gz", - "platform": "unknown-linux-gnu", - "version": "0.7.12-alpha.1" - } -] diff --git a/__tests__/download/custom-manifest.ndjson b/__tests__/download/custom-manifest.ndjson new file mode 100644 index 0000000..df6b36c --- /dev/null +++ b/__tests__/download/custom-manifest.ndjson @@ -0,0 +1 @@ +{"version":"0.9.26","artifacts":[{"platform":"x86_64-unknown-linux-gnu","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz","archive_format":"tar.gz","sha256":"30ccbf0a66dc8727a02b0e245c583ee970bdafecf3a443c1686e1b30ec4939e8"}]} diff --git a/__tests__/download/download-version.test.ts b/__tests__/download/download-version.test.ts index d796aea..a638636 100644 --- a/__tests__/download/download-version.test.ts +++ b/__tests__/download/download-version.test.ts @@ -32,29 +32,16 @@ jest.unstable_mockModule("@actions/tool-cache", () => ({ })); // biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. -const mockGetLatestVersionFromNdjson = jest.fn(); +const mockGetLatestVersion = jest.fn(); // biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. -const mockGetAllVersionsFromNdjson = jest.fn(); +const mockGetAllVersions = jest.fn(); // biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. -const mockGetArtifactFromNdjson = jest.fn(); +const mockGetArtifact = jest.fn(); -jest.unstable_mockModule("../../src/download/versions-client", () => ({ - getAllVersions: mockGetAllVersionsFromNdjson, - getArtifact: mockGetArtifactFromNdjson, - getLatestVersion: mockGetLatestVersionFromNdjson, -})); - -// biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. -const mockGetAllManifestVersions = jest.fn(); -// biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. -const mockGetLatestVersionInManifest = jest.fn(); -// biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. -const mockGetManifestArtifact = jest.fn(); - -jest.unstable_mockModule("../../src/download/version-manifest", () => ({ - getAllVersions: mockGetAllManifestVersions, - getLatestKnownVersion: mockGetLatestVersionInManifest, - getManifestArtifact: mockGetManifestArtifact, +jest.unstable_mockModule("../../src/download/manifest", () => ({ + getAllVersions: mockGetAllVersions, + getArtifact: mockGetArtifact, + getLatestVersion: mockGetLatestVersion, })); // biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. @@ -64,12 +51,9 @@ jest.unstable_mockModule("../../src/download/checksum/checksum", () => ({ validateChecksum: mockValidateChecksum, })); -const { - downloadVersionFromManifest, - downloadVersionFromNdjson, - resolveVersion, - rewriteToMirror, -} = await import("../../src/download/download-version"); +const { downloadVersion, resolveVersion, rewriteToMirror } = await import( + "../../src/download/download-version" +); describe("download-version", () => { beforeEach(() => { @@ -79,12 +63,9 @@ describe("download-version", () => { mockExtractTar.mockReset(); mockExtractZip.mockReset(); mockCacheDir.mockReset(); - mockGetLatestVersionFromNdjson.mockReset(); - mockGetAllVersionsFromNdjson.mockReset(); - mockGetArtifactFromNdjson.mockReset(); - mockGetAllManifestVersions.mockReset(); - mockGetLatestVersionInManifest.mockReset(); - mockGetManifestArtifact.mockReset(); + mockGetLatestVersion.mockReset(); + mockGetAllVersions.mockReset(); + mockGetArtifact.mockReset(); mockValidateChecksum.mockReset(); mockDownloadTool.mockResolvedValue("/tmp/downloaded"); @@ -94,36 +75,28 @@ describe("download-version", () => { }); describe("resolveVersion", () => { - it("uses astral-sh/versions to resolve latest", async () => { - mockGetLatestVersionFromNdjson.mockResolvedValue("0.9.26"); + it("uses the default manifest to resolve latest", async () => { + mockGetLatestVersion.mockResolvedValue("0.9.26"); const version = await resolveVersion("latest", undefined); expect(version).toBe("0.9.26"); - expect(mockGetLatestVersionFromNdjson).toHaveBeenCalledTimes(1); + expect(mockGetLatestVersion).toHaveBeenCalledTimes(1); + expect(mockGetLatestVersion).toHaveBeenCalledWith(undefined); }); - it("uses astral-sh/versions to resolve available versions", async () => { - mockGetAllVersionsFromNdjson.mockResolvedValue(["0.9.26", "0.9.25"]); + it("uses the default manifest to resolve available versions", async () => { + mockGetAllVersions.mockResolvedValue(["0.9.26", "0.9.25"]); const version = await resolveVersion("^0.9.0", undefined); expect(version).toBe("0.9.26"); - expect(mockGetAllVersionsFromNdjson).toHaveBeenCalledTimes(1); - }); - - it("does not fall back when astral-sh/versions fails", async () => { - mockGetLatestVersionFromNdjson.mockRejectedValue( - new Error("NDJSON unavailable"), - ); - - await expect(resolveVersion("latest", undefined)).rejects.toThrow( - "NDJSON unavailable", - ); + expect(mockGetAllVersions).toHaveBeenCalledTimes(1); + expect(mockGetAllVersions).toHaveBeenCalledWith(undefined); }); it("uses manifest-file when provided", async () => { - mockGetAllManifestVersions.mockResolvedValue(["0.9.26", "0.9.25"]); + mockGetAllVersions.mockResolvedValue(["0.9.26", "0.9.25"]); const version = await resolveVersion( "^0.9.0", @@ -131,37 +104,35 @@ describe("download-version", () => { ); expect(version).toBe("0.9.26"); - expect(mockGetAllManifestVersions).toHaveBeenCalledWith( + expect(mockGetAllVersions).toHaveBeenCalledWith( "https://example.com/custom.ndjson", ); }); }); - describe("downloadVersionFromNdjson", () => { - it("fails when NDJSON metadata lookup fails", async () => { - mockGetArtifactFromNdjson.mockRejectedValue( - new Error("NDJSON unavailable"), - ); + describe("downloadVersion", () => { + it("fails when manifest lookup fails", async () => { + mockGetArtifact.mockRejectedValue(new Error("manifest unavailable")); await expect( - downloadVersionFromNdjson( + downloadVersion( "unknown-linux-gnu", "x86_64", "0.9.26", undefined, "token", ), - ).rejects.toThrow("NDJSON unavailable"); + ).rejects.toThrow("manifest unavailable"); expect(mockDownloadTool).not.toHaveBeenCalled(); expect(mockValidateChecksum).not.toHaveBeenCalled(); }); - it("fails when no matching artifact exists in NDJSON metadata", async () => { - mockGetArtifactFromNdjson.mockResolvedValue(undefined); + it("fails when no matching artifact exists in the default manifest", async () => { + mockGetArtifact.mockResolvedValue(undefined); await expect( - downloadVersionFromNdjson( + downloadVersion( "unknown-linux-gnu", "x86_64", "0.9.26", @@ -176,14 +147,14 @@ describe("download-version", () => { expect(mockValidateChecksum).not.toHaveBeenCalled(); }); - it("uses built-in checksums for default NDJSON downloads", async () => { - mockGetArtifactFromNdjson.mockResolvedValue({ + it("uses built-in checksums for default manifest downloads", async () => { + mockGetArtifact.mockResolvedValue({ archiveFormat: "tar.gz", - sha256: "ndjson-checksum-that-should-be-ignored", - url: "https://example.com/uv.tar.gz", + checksum: "manifest-checksum-that-should-be-ignored", + downloadUrl: "https://example.com/uv.tar.gz", }); - await downloadVersionFromNdjson( + await downloadVersion( "unknown-linux-gnu", "x86_64", "0.9.26", @@ -201,13 +172,14 @@ describe("download-version", () => { }); it("rewrites GitHub Releases URLs to the Astral mirror", async () => { - mockGetArtifactFromNdjson.mockResolvedValue({ + mockGetArtifact.mockResolvedValue({ archiveFormat: "tar.gz", - sha256: "abc123", - url: "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", + checksum: "abc123", + downloadUrl: + "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", }); - await downloadVersionFromNdjson( + await downloadVersion( "unknown-linux-gnu", "x86_64", "0.9.26", @@ -223,13 +195,13 @@ describe("download-version", () => { }); it("does not rewrite non-GitHub URLs", async () => { - mockGetArtifactFromNdjson.mockResolvedValue({ + mockGetArtifact.mockResolvedValue({ archiveFormat: "tar.gz", - sha256: "abc123", - url: "https://example.com/uv.tar.gz", + checksum: "abc123", + downloadUrl: "https://example.com/uv.tar.gz", }); - await downloadVersionFromNdjson( + await downloadVersion( "unknown-linux-gnu", "x86_64", "0.9.26", @@ -245,17 +217,18 @@ describe("download-version", () => { }); it("falls back to GitHub Releases when the mirror fails", async () => { - mockGetArtifactFromNdjson.mockResolvedValue({ + mockGetArtifact.mockResolvedValue({ archiveFormat: "tar.gz", - sha256: "abc123", - url: "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", + checksum: "abc123", + downloadUrl: + "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", }); mockDownloadTool .mockRejectedValueOnce(new Error("mirror unavailable")) .mockResolvedValueOnce("/tmp/downloaded"); - await downloadVersionFromNdjson( + await downloadVersion( "unknown-linux-gnu", "x86_64", "0.9.26", @@ -264,14 +237,12 @@ describe("download-version", () => { ); expect(mockDownloadTool).toHaveBeenCalledTimes(2); - // Mirror request: no token expect(mockDownloadTool).toHaveBeenNthCalledWith( 1, "https://releases.astral.sh/github/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", undefined, undefined, ); - // GitHub fallback: token restored expect(mockDownloadTool).toHaveBeenNthCalledWith( 2, "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-unknown-linux-gnu.tar.gz", @@ -284,16 +255,16 @@ describe("download-version", () => { }); it("does not fall back for non-GitHub URLs", async () => { - mockGetArtifactFromNdjson.mockResolvedValue({ + mockGetArtifact.mockResolvedValue({ archiveFormat: "tar.gz", - sha256: "abc123", - url: "https://example.com/uv.tar.gz", + checksum: "abc123", + downloadUrl: "https://example.com/uv.tar.gz", }); mockDownloadTool.mockRejectedValue(new Error("download failed")); await expect( - downloadVersionFromNdjson( + downloadVersion( "unknown-linux-gnu", "x86_64", "0.9.26", @@ -304,6 +275,56 @@ describe("download-version", () => { expect(mockDownloadTool).toHaveBeenCalledTimes(1); }); + + it("uses manifest-file checksum metadata when checksum input is unset", async () => { + mockGetArtifact.mockResolvedValue({ + archiveFormat: "tar.gz", + checksum: "manifest-checksum", + downloadUrl: "https://example.com/custom-uv.tar.gz", + }); + + await downloadVersion( + "unknown-linux-gnu", + "x86_64", + "0.9.26", + "", + "token", + "https://example.com/custom.ndjson", + ); + + expect(mockValidateChecksum).toHaveBeenCalledWith( + "manifest-checksum", + "/tmp/downloaded", + "x86_64", + "unknown-linux-gnu", + "0.9.26", + ); + }); + + it("prefers checksum input over manifest-file checksum metadata", async () => { + mockGetArtifact.mockResolvedValue({ + archiveFormat: "tar.gz", + checksum: "manifest-checksum", + downloadUrl: "https://example.com/custom-uv.tar.gz", + }); + + await downloadVersion( + "unknown-linux-gnu", + "x86_64", + "0.9.26", + "user-checksum", + "token", + "https://example.com/custom.ndjson", + ); + + expect(mockValidateChecksum).toHaveBeenCalledWith( + "user-checksum", + "/tmp/downloaded", + "x86_64", + "unknown-linux-gnu", + "0.9.26", + ); + }); }); describe("rewriteToMirror", () => { @@ -329,56 +350,4 @@ describe("download-version", () => { ).toBeUndefined(); }); }); - - describe("downloadVersionFromManifest", () => { - it("uses manifest-file checksum metadata when checksum input is unset", async () => { - mockGetManifestArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "manifest-checksum", - downloadUrl: "https://example.com/custom-uv.tar.gz", - }); - - await downloadVersionFromManifest( - "https://example.com/custom.ndjson", - "unknown-linux-gnu", - "x86_64", - "0.9.26", - "", - "token", - ); - - expect(mockValidateChecksum).toHaveBeenCalledWith( - "manifest-checksum", - "/tmp/downloaded", - "x86_64", - "unknown-linux-gnu", - "0.9.26", - ); - }); - - it("prefers checksum input over manifest-file checksum metadata", async () => { - mockGetManifestArtifact.mockResolvedValue({ - archiveFormat: "tar.gz", - checksum: "manifest-checksum", - downloadUrl: "https://example.com/custom-uv.tar.gz", - }); - - await downloadVersionFromManifest( - "https://example.com/custom.ndjson", - "unknown-linux-gnu", - "x86_64", - "0.9.26", - "user-checksum", - "token", - ); - - expect(mockValidateChecksum).toHaveBeenCalledWith( - "user-checksum", - "/tmp/downloaded", - "x86_64", - "unknown-linux-gnu", - "0.9.26", - ); - }); - }); }); diff --git a/__tests__/download/manifest.test.ts b/__tests__/download/manifest.test.ts new file mode 100644 index 0000000..90b2e56 --- /dev/null +++ b/__tests__/download/manifest.test.ts @@ -0,0 +1,168 @@ +import { beforeEach, describe, expect, it, jest } from "@jest/globals"; + +// biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. +const mockFetch = jest.fn(); + +jest.unstable_mockModule("@actions/core", () => ({ + debug: jest.fn(), + info: jest.fn(), +})); + +jest.unstable_mockModule("../../src/utils/fetch", () => ({ + fetch: mockFetch, +})); + +const { + clearManifestCache, + fetchManifest, + getAllVersions, + getArtifact, + getLatestVersion, + parseManifest, +} = await import("../../src/download/manifest"); + +const sampleManifestResponse = `{"version":"0.9.25","artifacts":[{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.25/uv-aarch64-apple-darwin.tar.gz","archive_format":"tar.gz","sha256":"606b3c6949d971709f2526fa0d9f0fd23ccf60e09f117999b406b424af18a6a6"}]} +{"version":"0.9.26","artifacts":[{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.tar.gz","archive_format":"tar.gz","sha256":"fcf0a9ea6599c6ae28a4c854ac6da76f2c889354d7c36ce136ef071f7ab9721f"},{"platform":"x86_64-pc-windows-msvc","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-pc-windows-msvc.zip","archive_format":"zip","sha256":"eb02fd95d8e0eed462b4a67ecdd320d865b38c560bffcda9a0b87ec944bdf036"}]}`; + +const multiVariantManifestResponse = `{"version":"0.9.26","artifacts":[{"platform":"aarch64-apple-darwin","variant":"python-managed","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin-managed.tar.gz","archive_format":"tar.gz","sha256":"managed-checksum"},{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.zip","archive_format":"zip","sha256":"default-checksum"}]}`; + +function createMockResponse( + ok: boolean, + status: number, + statusText: string, + data: string, +) { + return { + ok, + status, + statusText, + text: async () => data, + }; +} + +describe("manifest", () => { + beforeEach(() => { + clearManifestCache(); + mockFetch.mockReset(); + }); + + describe("fetchManifest", () => { + it("fetches and parses manifest data", async () => { + mockFetch.mockResolvedValue( + createMockResponse(true, 200, "OK", sampleManifestResponse), + ); + + const versions = await fetchManifest(); + + expect(versions).toHaveLength(2); + expect(versions[0]?.version).toBe("0.9.25"); + expect(versions[1]?.version).toBe("0.9.26"); + }); + + it("throws on a failed fetch", async () => { + mockFetch.mockResolvedValue( + createMockResponse(false, 500, "Internal Server Error", ""), + ); + + await expect(fetchManifest()).rejects.toThrow( + "Failed to fetch manifest data: 500 Internal Server Error", + ); + }); + + it("caches results per URL", async () => { + mockFetch.mockResolvedValue( + createMockResponse(true, 200, "OK", sampleManifestResponse), + ); + + await fetchManifest("https://example.com/custom.ndjson"); + await fetchManifest("https://example.com/custom.ndjson"); + + expect(mockFetch).toHaveBeenCalledTimes(1); + }); + }); + + describe("getAllVersions", () => { + it("returns all version strings", async () => { + mockFetch.mockResolvedValue( + createMockResponse(true, 200, "OK", sampleManifestResponse), + ); + + const versions = await getAllVersions( + "https://example.com/custom.ndjson", + ); + + expect(versions).toEqual(["0.9.25", "0.9.26"]); + }); + }); + + describe("getArtifact", () => { + beforeEach(() => { + mockFetch.mockResolvedValue( + createMockResponse(true, 200, "OK", sampleManifestResponse), + ); + }); + + it("finds an artifact by version and platform", async () => { + const artifact = await getArtifact("0.9.26", "aarch64", "apple-darwin"); + + expect(artifact).toEqual({ + archiveFormat: "tar.gz", + checksum: + "fcf0a9ea6599c6ae28a4c854ac6da76f2c889354d7c36ce136ef071f7ab9721f", + downloadUrl: + "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.tar.gz", + }); + }); + + it("finds a windows artifact", async () => { + const artifact = await getArtifact("0.9.26", "x86_64", "pc-windows-msvc"); + + expect(artifact).toEqual({ + archiveFormat: "zip", + checksum: + "eb02fd95d8e0eed462b4a67ecdd320d865b38c560bffcda9a0b87ec944bdf036", + downloadUrl: + "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-pc-windows-msvc.zip", + }); + }); + + it("prefers the default variant when multiple artifacts share a platform", async () => { + mockFetch.mockResolvedValue( + createMockResponse(true, 200, "OK", multiVariantManifestResponse), + ); + + const artifact = await getArtifact("0.9.26", "aarch64", "apple-darwin"); + + expect(artifact).toEqual({ + archiveFormat: "zip", + checksum: "default-checksum", + downloadUrl: + "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.zip", + }); + }); + + it("returns undefined for an unknown version", async () => { + const artifact = await getArtifact("0.0.1", "aarch64", "apple-darwin"); + + expect(artifact).toBeUndefined(); + }); + + it("returns undefined for an unknown platform", async () => { + const artifact = await getArtifact( + "0.9.26", + "aarch64", + "unknown-linux-musl", + ); + + expect(artifact).toBeUndefined(); + }); + }); + + describe("parseManifest", () => { + it("throws for malformed manifest data", () => { + expect(() => parseManifest('{"version":"0.1.0"', "test-source")).toThrow( + "Failed to parse manifest data from test-source", + ); + }); + }); +}); diff --git a/__tests__/download/version-manifest.test.ts b/__tests__/download/version-manifest.test.ts deleted file mode 100644 index 2cd30ed..0000000 --- a/__tests__/download/version-manifest.test.ts +++ /dev/null @@ -1,136 +0,0 @@ -import { beforeEach, describe, expect, it, jest } from "@jest/globals"; - -const mockWarning = jest.fn(); - -jest.unstable_mockModule("@actions/core", () => ({ - debug: jest.fn(), - info: jest.fn(), - warning: mockWarning, -})); - -// biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. -const mockFetch = jest.fn(); -jest.unstable_mockModule("../../src/utils/fetch", () => ({ - fetch: mockFetch, -})); - -const { - clearManifestCache, - getAllVersions, - getLatestKnownVersion, - getManifestArtifact, -} = await import("../../src/download/version-manifest"); - -const legacyManifestResponse = JSON.stringify([ - { - arch: "x86_64", - artifactName: "uv-x86_64-unknown-linux-gnu.tar.gz", - downloadUrl: - "https://example.com/releases/download/0.7.12-alpha.1/uv-x86_64-unknown-linux-gnu.tar.gz", - platform: "unknown-linux-gnu", - version: "0.7.12-alpha.1", - }, - { - arch: "x86_64", - artifactName: "uv-x86_64-unknown-linux-gnu.tar.gz", - downloadUrl: - "https://example.com/releases/download/0.7.13/uv-x86_64-unknown-linux-gnu.tar.gz", - platform: "unknown-linux-gnu", - version: "0.7.13", - }, -]); - -const ndjsonManifestResponse = `{"version":"0.10.0","artifacts":[{"platform":"x86_64-unknown-linux-gnu","variant":"default","url":"https://example.com/releases/download/0.10.0/uv-x86_64-unknown-linux-gnu.tar.gz","archive_format":"tar.gz","sha256":"checksum-100"}]} -{"version":"0.9.30","artifacts":[{"platform":"x86_64-unknown-linux-gnu","variant":"default","url":"https://example.com/releases/download/0.9.30/uv-x86_64-unknown-linux-gnu.tar.gz","archive_format":"tar.gz","sha256":"checksum-0930"}]}`; - -const multiVariantManifestResponse = `{"version":"0.10.0","artifacts":[{"platform":"x86_64-unknown-linux-gnu","variant":"managed-python","url":"https://example.com/releases/download/0.10.0/uv-x86_64-unknown-linux-gnu-managed-python.tar.gz","archive_format":"tar.gz","sha256":"checksum-managed"},{"platform":"x86_64-unknown-linux-gnu","variant":"default","url":"https://example.com/releases/download/0.10.0/uv-x86_64-unknown-linux-gnu-default.zip","archive_format":"zip","sha256":"checksum-default"}]}`; - -function createMockResponse( - ok: boolean, - status: number, - statusText: string, - data: string, -) { - return { - ok, - status, - statusText, - text: async () => data, - }; -} - -describe("version-manifest", () => { - beforeEach(() => { - clearManifestCache(); - mockFetch.mockReset(); - mockWarning.mockReset(); - }); - - it("supports the legacy JSON manifest format", async () => { - mockFetch.mockResolvedValue( - createMockResponse(true, 200, "OK", legacyManifestResponse), - ); - - const latest = await getLatestKnownVersion( - "https://example.com/legacy.json", - ); - const artifact = await getManifestArtifact( - "https://example.com/legacy.json", - "0.7.13", - "x86_64", - "unknown-linux-gnu", - ); - - expect(latest).toBe("0.7.13"); - expect(artifact).toEqual({ - archiveFormat: undefined, - checksum: undefined, - downloadUrl: - "https://example.com/releases/download/0.7.13/uv-x86_64-unknown-linux-gnu.tar.gz", - }); - expect(mockWarning).toHaveBeenCalledTimes(1); - }); - - it("supports NDJSON manifests", async () => { - mockFetch.mockResolvedValue( - createMockResponse(true, 200, "OK", ndjsonManifestResponse), - ); - - const versions = await getAllVersions("https://example.com/custom.ndjson"); - const artifact = await getManifestArtifact( - "https://example.com/custom.ndjson", - "0.10.0", - "x86_64", - "unknown-linux-gnu", - ); - - expect(versions).toEqual(["0.10.0", "0.9.30"]); - expect(artifact).toEqual({ - archiveFormat: "tar.gz", - checksum: "checksum-100", - downloadUrl: - "https://example.com/releases/download/0.10.0/uv-x86_64-unknown-linux-gnu.tar.gz", - }); - expect(mockWarning).not.toHaveBeenCalled(); - }); - - it("prefers the default variant when a manifest contains multiple variants", async () => { - mockFetch.mockResolvedValue( - createMockResponse(true, 200, "OK", multiVariantManifestResponse), - ); - - const artifact = await getManifestArtifact( - "https://example.com/multi-variant.ndjson", - "0.10.0", - "x86_64", - "unknown-linux-gnu", - ); - - expect(artifact).toEqual({ - archiveFormat: "zip", - checksum: "checksum-default", - downloadUrl: - "https://example.com/releases/download/0.10.0/uv-x86_64-unknown-linux-gnu-default.zip", - }); - }); -}); diff --git a/__tests__/download/versions-client.test.ts b/__tests__/download/versions-client.test.ts deleted file mode 100644 index f963716..0000000 --- a/__tests__/download/versions-client.test.ts +++ /dev/null @@ -1,170 +0,0 @@ -import { beforeEach, describe, expect, it, jest } from "@jest/globals"; - -// biome-ignore lint/suspicious/noExplicitAny: Mock requires flexible typing in tests. -const mockFetch = jest.fn(); - -jest.unstable_mockModule("../../src/utils/fetch", () => ({ - fetch: mockFetch, -})); - -const { - clearCache, - fetchVersionData, - getAllVersions, - getArtifact, - getLatestVersion, - parseVersionData, -} = await import("../../src/download/versions-client"); - -const sampleNdjsonResponse = `{"version":"0.9.26","artifacts":[{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.tar.gz","archive_format":"tar.gz","sha256":"fcf0a9ea6599c6ae28a4c854ac6da76f2c889354d7c36ce136ef071f7ab9721f"},{"platform":"x86_64-pc-windows-msvc","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-pc-windows-msvc.zip","archive_format":"zip","sha256":"eb02fd95d8e0eed462b4a67ecdd320d865b38c560bffcda9a0b87ec944bdf036"}]} -{"version":"0.9.25","artifacts":[{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.25/uv-aarch64-apple-darwin.tar.gz","archive_format":"tar.gz","sha256":"606b3c6949d971709f2526fa0d9f0fd23ccf60e09f117999b406b424af18a6a6"}]}`; - -const multiVariantNdjsonResponse = `{"version":"0.9.26","artifacts":[{"platform":"aarch64-apple-darwin","variant":"python-managed","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin-managed.tar.gz","archive_format":"tar.gz","sha256":"managed-checksum"},{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.zip","archive_format":"zip","sha256":"default-checksum"}]}`; - -function createMockResponse( - ok: boolean, - status: number, - statusText: string, - data: string, -) { - return { - ok, - status, - statusText, - text: async () => data, - }; -} - -describe("versions-client", () => { - beforeEach(() => { - clearCache(); - mockFetch.mockReset(); - }); - - describe("fetchVersionData", () => { - it("should fetch and parse NDJSON data", async () => { - mockFetch.mockResolvedValue( - createMockResponse(true, 200, "OK", sampleNdjsonResponse), - ); - - const versions = await fetchVersionData(); - - expect(versions).toHaveLength(2); - expect(versions[0].version).toBe("0.9.26"); - expect(versions[1].version).toBe("0.9.25"); - }); - - it("should throw error on failed fetch", async () => { - mockFetch.mockResolvedValue( - createMockResponse(false, 500, "Internal Server Error", ""), - ); - - await expect(fetchVersionData()).rejects.toThrow( - "Failed to fetch version data: 500 Internal Server Error", - ); - }); - - it("should cache results", async () => { - mockFetch.mockResolvedValue( - createMockResponse(true, 200, "OK", sampleNdjsonResponse), - ); - - await fetchVersionData(); - await fetchVersionData(); - - expect(mockFetch).toHaveBeenCalledTimes(1); - }); - }); - - describe("getLatestVersion", () => { - it("should return the first version (newest)", async () => { - mockFetch.mockResolvedValue( - createMockResponse(true, 200, "OK", sampleNdjsonResponse), - ); - - const latest = await getLatestVersion(); - - expect(latest).toBe("0.9.26"); - }); - }); - - describe("getAllVersions", () => { - it("should return all version strings", async () => { - mockFetch.mockResolvedValue( - createMockResponse(true, 200, "OK", sampleNdjsonResponse), - ); - - const versions = await getAllVersions(); - - expect(versions).toEqual(["0.9.26", "0.9.25"]); - }); - }); - - describe("getArtifact", () => { - beforeEach(() => { - mockFetch.mockResolvedValue( - createMockResponse(true, 200, "OK", sampleNdjsonResponse), - ); - }); - - it("should find artifact by version and platform", async () => { - const artifact = await getArtifact("0.9.26", "aarch64", "apple-darwin"); - - expect(artifact).toEqual({ - archiveFormat: "tar.gz", - sha256: - "fcf0a9ea6599c6ae28a4c854ac6da76f2c889354d7c36ce136ef071f7ab9721f", - url: "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.tar.gz", - }); - }); - - it("should find windows artifact", async () => { - const artifact = await getArtifact("0.9.26", "x86_64", "pc-windows-msvc"); - - expect(artifact).toEqual({ - archiveFormat: "zip", - sha256: - "eb02fd95d8e0eed462b4a67ecdd320d865b38c560bffcda9a0b87ec944bdf036", - url: "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-pc-windows-msvc.zip", - }); - }); - - it("should prefer the default variant when multiple artifacts share a platform", async () => { - mockFetch.mockResolvedValue( - createMockResponse(true, 200, "OK", multiVariantNdjsonResponse), - ); - - const artifact = await getArtifact("0.9.26", "aarch64", "apple-darwin"); - - expect(artifact).toEqual({ - archiveFormat: "zip", - sha256: "default-checksum", - url: "https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.zip", - }); - }); - - it("should return undefined for unknown version", async () => { - const artifact = await getArtifact("0.0.1", "aarch64", "apple-darwin"); - - expect(artifact).toBeUndefined(); - }); - - it("should return undefined for unknown platform", async () => { - const artifact = await getArtifact( - "0.9.26", - "aarch64", - "unknown-linux-musl", - ); - - expect(artifact).toBeUndefined(); - }); - }); - - describe("parseVersionData", () => { - it("should throw for malformed NDJSON", () => { - expect(() => - parseVersionData('{"version":"0.1.0"', "test-source"), - ).toThrow("Failed to parse version data from test-source"); - }); - }); -}); diff --git a/action.yml b/action.yml index 2f566fa..8882beb 100644 --- a/action.yml +++ b/action.yml @@ -75,7 +75,7 @@ inputs: description: "Custom path to set UV_TOOL_BIN_DIR to." required: false manifest-file: - description: "URL to a custom manifest file. Supports the astral-sh/versions NDJSON format and the legacy JSON array format (deprecated)." + description: "URL to a custom manifest file in the astral-sh/versions format." required: false add-problem-matchers: description: "Add problem matchers." diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index 0b999c8..a052050 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -91886,7 +91886,7 @@ var semver5 = __toESM(require_semver5(), 1); var TOOL_CACHE_NAME = "uv"; var STATE_UV_PATH = "uv-path"; var STATE_UV_VERSION = "uv-version"; -var VERSIONS_NDJSON_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson"; +var VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson"; var GITHUB_RELEASES_PREFIX = "https://github.com/astral-sh/uv/releases/download/"; var ASTRAL_MIRROR_PREFIX = "https://releases.astral.sh/github/uv/releases/download/"; @@ -96373,7 +96373,7 @@ async function validateFileCheckSum(filePath, expected) { }); } -// src/download/version-manifest.ts +// src/download/manifest.ts var semver4 = __toESM(require_semver5(), 1); // src/utils/fetch.ts @@ -96394,45 +96394,6 @@ var fetch = async (url2, opts) => await (0, import_undici2.fetch)(url2, { ...opts }); -// src/download/legacy-version-manifest.ts -var warnedLegacyManifestUrls = /* @__PURE__ */ new Set(); -function parseLegacyManifestEntries(parsedEntries, manifestUrl) { - warnAboutLegacyManifestFormat(manifestUrl); - return parsedEntries.map((entry, index) => { - if (!isLegacyManifestEntry(entry)) { - throw new Error( - `Invalid legacy manifest-file entry at index ${index} in ${manifestUrl}.` - ); - } - return { - arch: entry.arch, - checksum: entry.checksum, - downloadUrl: entry.downloadUrl, - platform: entry.platform, - version: entry.version - }; - }); -} -function warnAboutLegacyManifestFormat(manifestUrl) { - if (warnedLegacyManifestUrls.has(manifestUrl)) { - return; - } - warnedLegacyManifestUrls.add(manifestUrl); - warning( - `manifest-file ${manifestUrl} uses the legacy JSON array format, which is deprecated. Please migrate to the astral-sh/versions NDJSON format before the next major release.` - ); -} -function isLegacyManifestEntry(value) { - if (!isRecord(value)) { - return false; - } - const checksumIsValid = typeof value.checksum === "string" || value.checksum === void 0; - return typeof value.arch === "string" && checksumIsValid && typeof value.downloadUrl === "string" && typeof value.platform === "string" && typeof value.version === "string"; -} -function isRecord(value) { - return typeof value === "object" && value !== null; -} - // src/download/variant-selection.ts function selectDefaultVariant(entries, duplicateEntryDescription) { const firstEntry = entries[0]; @@ -96459,73 +96420,88 @@ function formatVariants(entries) { return entries.map((entry) => entry.variant ?? "default").sort((left, right) => left.localeCompare(right)).join(", "); } -// src/download/versions-client.ts -var cachedVersionData = /* @__PURE__ */ new Map(); -async function fetchVersionData(url2 = VERSIONS_NDJSON_URL) { - const cachedVersions = cachedVersionData.get(url2); +// src/download/manifest.ts +var cachedManifestData = /* @__PURE__ */ new Map(); +async function fetchManifest(manifestUrl = VERSIONS_MANIFEST_URL) { + const cachedVersions = cachedManifestData.get(manifestUrl); if (cachedVersions !== void 0) { - debug(`Using cached NDJSON version data from ${url2}`); + debug(`Using cached manifest data from ${manifestUrl}`); return cachedVersions; } - info(`Fetching version data from ${url2} ...`); - const response = await fetch(url2, {}); + info(`Fetching manifest data from ${manifestUrl} ...`); + const response = await fetch(manifestUrl, {}); if (!response.ok) { throw new Error( - `Failed to fetch version data: ${response.status} ${response.statusText}` + `Failed to fetch manifest data: ${response.status} ${response.statusText}` ); } const body2 = await response.text(); - const versions = parseVersionData(body2, url2); - cachedVersionData.set(url2, versions); + const versions = parseManifest(body2, manifestUrl); + cachedManifestData.set(manifestUrl, versions); return versions; } -function parseVersionData(data, sourceDescription) { +function parseManifest(data, sourceDescription) { + const trimmed = data.trim(); + if (trimmed === "") { + throw new Error(`Manifest at ${sourceDescription} is empty.`); + } + if (trimmed.startsWith("[")) { + throw new Error( + `Legacy JSON array manifests are no longer supported in ${sourceDescription}. Use the astral-sh/versions manifest format instead.` + ); + } const versions = []; for (const [index, line] of data.split("\n").entries()) { - const trimmed = line.trim(); - if (trimmed === "") { + const record = line.trim(); + if (record === "") { continue; } let parsed; try { - parsed = JSON.parse(trimmed); + parsed = JSON.parse(record); } catch (error2) { throw new Error( - `Failed to parse version data from ${sourceDescription} at line ${index + 1}: ${error2.message}` + `Failed to parse manifest data from ${sourceDescription} at line ${index + 1}: ${error2.message}` ); } - if (!isNdjsonVersion(parsed)) { + if (!isManifestVersion(parsed)) { throw new Error( - `Invalid NDJSON record in ${sourceDescription} at line ${index + 1}.` + `Invalid manifest record in ${sourceDescription} at line ${index + 1}.` ); } versions.push(parsed); } if (versions.length === 0) { - throw new Error(`No version data found in ${sourceDescription}.`); + throw new Error(`No manifest data found in ${sourceDescription}.`); } return versions; } -async function getLatestVersion() { - const versions = await fetchVersionData(); - const latestVersion = versions[0]?.version; - if (!latestVersion) { - throw new Error("No versions found in NDJSON data"); +async function getLatestVersion(manifestUrl = VERSIONS_MANIFEST_URL) { + const versions = await fetchManifest(manifestUrl); + const [firstVersion, ...remainingVersions] = versions.map( + (versionData) => versionData.version + ); + if (firstVersion === void 0) { + throw new Error("No versions found in manifest data"); } - debug(`Latest version from NDJSON: ${latestVersion}`); + const latestVersion = remainingVersions.reduce( + (latest, current) => semver4.gt(current, latest) ? current : latest, + firstVersion + ); + debug(`Latest version from manifest: ${latestVersion}`); return latestVersion; } -async function getAllVersions() { - const versions = await fetchVersionData(); +async function getAllVersions(manifestUrl = VERSIONS_MANIFEST_URL) { + const versions = await fetchManifest(manifestUrl); return versions.map((versionData) => versionData.version); } -async function getArtifact(version4, arch3, platform2) { - const versions = await fetchVersionData(); +async function getArtifact(version4, arch3, platform2, manifestUrl = VERSIONS_MANIFEST_URL) { + const versions = await fetchManifest(manifestUrl); const versionData = versions.find( (candidate) => candidate.version === version4 ); if (!versionData) { - debug(`Version ${version4} not found in NDJSON data`); + debug(`Version ${version4} not found in manifest ${manifestUrl}`); return void 0; } const targetPlatform = `${arch3}-${platform2}`; @@ -96538,143 +96514,36 @@ async function getArtifact(version4, arch3, platform2) { ); return void 0; } - const artifact = selectArtifact(matchingArtifacts, version4, targetPlatform); - return { - archiveFormat: artifact.archive_format, - sha256: artifact.sha256, - url: artifact.url - }; -} -function selectArtifact(artifacts, version4, targetPlatform) { - return selectDefaultVariant( - artifacts, + const artifact = selectDefaultVariant( + matchingArtifacts, `Multiple artifacts found for ${targetPlatform} in version ${version4}` ); + return { + archiveFormat: artifact.archive_format, + checksum: artifact.sha256, + downloadUrl: artifact.url + }; } -function isNdjsonVersion(value) { - if (!isRecord2(value)) { +function isManifestVersion(value) { + if (!isRecord(value)) { return false; } if (typeof value.version !== "string" || !Array.isArray(value.artifacts)) { return false; } - return value.artifacts.every(isNdjsonArtifact); + return value.artifacts.every(isManifestArtifact); } -function isNdjsonArtifact(value) { - if (!isRecord2(value)) { +function isManifestArtifact(value) { + if (!isRecord(value)) { return false; } const variantIsValid = typeof value.variant === "string" || value.variant === void 0; return typeof value.archive_format === "string" && typeof value.platform === "string" && typeof value.sha256 === "string" && typeof value.url === "string" && variantIsValid; } -function isRecord2(value) { +function isRecord(value) { return typeof value === "object" && value !== null; } -// src/download/version-manifest.ts -var cachedManifestEntries = /* @__PURE__ */ new Map(); -async function getLatestKnownVersion(manifestUrl) { - const versions = await getAllVersions2(manifestUrl); - const latestVersion = versions.reduce( - (latest, current) => semver4.gt(current, latest) ? current : latest - ); - return latestVersion; -} -async function getAllVersions2(manifestUrl) { - const manifestEntries = await getManifestEntries(manifestUrl); - return [...new Set(manifestEntries.map((entry) => entry.version))]; -} -async function getManifestArtifact(manifestUrl, version4, arch3, platform2) { - const manifestEntries = await getManifestEntries(manifestUrl); - const entry = selectManifestEntry( - manifestEntries, - manifestUrl, - version4, - arch3, - platform2 - ); - if (!entry) { - return void 0; - } - return { - archiveFormat: entry.archiveFormat, - checksum: entry.checksum, - downloadUrl: entry.downloadUrl - }; -} -async function getManifestEntries(manifestUrl) { - const cachedEntries = cachedManifestEntries.get(manifestUrl); - if (cachedEntries !== void 0) { - debug(`Using cached manifest-file from: ${manifestUrl}`); - return cachedEntries; - } - info(`Fetching manifest-file from: ${manifestUrl}`); - const response = await fetch(manifestUrl, {}); - if (!response.ok) { - throw new Error( - `Failed to fetch manifest-file: ${response.status} ${response.statusText}` - ); - } - const data = await response.text(); - const parsedEntries = parseManifestEntries(data, manifestUrl); - cachedManifestEntries.set(manifestUrl, parsedEntries); - return parsedEntries; -} -function parseManifestEntries(data, manifestUrl) { - const trimmed = data.trim(); - if (trimmed === "") { - throw new Error(`manifest-file at ${manifestUrl} is empty.`); - } - const parsedAsJson = tryParseJson(trimmed); - if (Array.isArray(parsedAsJson)) { - return parseLegacyManifestEntries(parsedAsJson, manifestUrl); - } - const versions = parseVersionData(trimmed, manifestUrl); - return mapNdjsonVersionsToManifestEntries(versions, manifestUrl); -} -function mapNdjsonVersionsToManifestEntries(versions, manifestUrl) { - const manifestEntries = []; - for (const versionData of versions) { - for (const artifact of versionData.artifacts) { - const [arch3, ...platformParts] = artifact.platform.split("-"); - if (arch3 === void 0 || platformParts.length === 0) { - throw new Error( - `Invalid artifact platform '${artifact.platform}' in manifest-file ${manifestUrl}.` - ); - } - manifestEntries.push({ - arch: arch3, - archiveFormat: artifact.archive_format, - checksum: artifact.sha256, - downloadUrl: artifact.url, - platform: platformParts.join("-"), - variant: artifact.variant, - version: versionData.version - }); - } - } - return manifestEntries; -} -function selectManifestEntry(manifestEntries, manifestUrl, version4, arch3, platform2) { - const matches = manifestEntries.filter( - (candidate) => candidate.version === version4 && candidate.arch === arch3 && candidate.platform === platform2 - ); - if (matches.length === 0) { - return void 0; - } - return selectDefaultVariant( - matches, - `manifest-file ${manifestUrl} contains multiple artifacts for version ${version4}, arch ${arch3}, platform ${platform2}` - ); -} -function tryParseJson(value) { - try { - return JSON.parse(value); - } catch { - return void 0; - } -} - // src/download/download-version.ts function tryGetFromToolCache(arch3, version4) { debug(`Trying to get uv from tool cache for ${version4}...`); @@ -96687,24 +96556,25 @@ function tryGetFromToolCache(arch3, version4) { const installedPath = find(TOOL_CACHE_NAME, resolvedVersion, arch3); return { installedPath, version: resolvedVersion }; } -async function downloadVersionFromNdjson(platform2, arch3, version4, checkSum2, githubToken2) { - const artifact = await getArtifact(version4, arch3, platform2); +async function downloadVersion(platform2, arch3, version4, checkSum2, githubToken2, manifestUrl) { + const artifact = await getArtifact(version4, arch3, platform2, manifestUrl); if (!artifact) { throw new Error( - `Could not find artifact for version ${version4}, arch ${arch3}, platform ${platform2} in ${VERSIONS_NDJSON_URL} .` + getMissingArtifactMessage(version4, arch3, platform2, manifestUrl) ); } - const mirrorUrl = rewriteToMirror(artifact.url); - const downloadUrl = mirrorUrl ?? artifact.url; + const checksum = manifestUrl === void 0 ? checkSum2 : resolveChecksum(checkSum2, artifact.checksum); + const mirrorUrl = rewriteToMirror(artifact.downloadUrl); + const downloadUrl = mirrorUrl ?? artifact.downloadUrl; const downloadToken = mirrorUrl !== void 0 ? void 0 : githubToken2; try { - return await downloadVersion( + return await downloadArtifact( downloadUrl, `uv-${arch3}-${platform2}`, platform2, arch3, version4, - checkSum2, + checksum, downloadToken ); } catch (err) { @@ -96714,13 +96584,13 @@ async function downloadVersionFromNdjson(platform2, arch3, version4, checkSum2, warning( `Failed to download from mirror, falling back to GitHub Releases: ${err.message}` ); - return await downloadVersion( - artifact.url, + return await downloadArtifact( + artifact.downloadUrl, `uv-${arch3}-${platform2}`, platform2, arch3, version4, - checkSum2, + checksum, githubToken2 ); } @@ -96731,29 +96601,7 @@ function rewriteToMirror(url2) { } return ASTRAL_MIRROR_PREFIX + url2.slice(GITHUB_RELEASES_PREFIX.length); } -async function downloadVersionFromManifest(manifestUrl, platform2, arch3, version4, checkSum2, githubToken2) { - const artifact = await getManifestArtifact( - manifestUrl, - version4, - arch3, - platform2 - ); - if (!artifact) { - throw new Error( - `manifest-file does not contain version ${version4}, arch ${arch3}, platform ${platform2}.` - ); - } - return await downloadVersion( - artifact.downloadUrl, - `uv-${arch3}-${platform2}`, - platform2, - arch3, - version4, - resolveChecksum(checkSum2, artifact.checksum), - githubToken2 - ); -} -async function downloadVersion(downloadUrl, artifactName, platform2, arch3, version4, checksum, githubToken2) { +async function downloadArtifact(downloadUrl, artifactName, platform2, arch3, version4, checksum, githubToken2) { info(`Downloading uv from "${downloadUrl}" ...`); const downloadPath = await downloadTool( downloadUrl, @@ -96786,6 +96634,12 @@ async function downloadVersion(downloadUrl, artifactName, platform2, arch3, vers ); return { cachedToolDir, version: version4 }; } +function getMissingArtifactMessage(version4, arch3, platform2, manifestUrl) { + if (manifestUrl === void 0) { + return `Could not find artifact for version ${version4}, arch ${arch3}, platform ${platform2} in ${VERSIONS_MANIFEST_URL} .`; + } + return `manifest-file does not contain version ${version4}, arch ${arch3}, platform ${platform2}.`; +} function resolveChecksum(checkSum2, manifestChecksum) { return checkSum2 !== void 0 && checkSum2 !== "" ? checkSum2 : manifestChecksum; } @@ -96794,23 +96648,16 @@ function getExtension(platform2) { } async function resolveVersion(versionInput, manifestUrl, resolutionStrategy2 = "highest") { debug(`Resolving version: ${versionInput}`); - let version4; const isSimpleMinimumVersionSpecifier = versionInput.includes(">") && !versionInput.includes(","); const resolveVersionSpecifierToLatest = isSimpleMinimumVersionSpecifier && resolutionStrategy2 === "highest"; if (resolveVersionSpecifierToLatest) { info("Found minimum version specifier, using latest version"); } - if (manifestUrl !== void 0) { - version4 = versionInput === "latest" || resolveVersionSpecifierToLatest ? await getLatestKnownVersion(manifestUrl) : versionInput; - } else { - version4 = versionInput === "latest" || resolveVersionSpecifierToLatest ? await getLatestVersion() : versionInput; - } + const version4 = versionInput === "latest" || resolveVersionSpecifierToLatest ? await getLatestVersion(manifestUrl) : versionInput; if (isExplicitVersion(version4)) { debug(`Version ${version4} is an explicit version.`); - if (resolveVersionSpecifierToLatest) { - if (!pep440.satisfies(version4, versionInput)) { - throw new Error(`No version found for ${versionInput}`); - } + if (resolveVersionSpecifierToLatest && !pep440.satisfies(version4, versionInput)) { + throw new Error(`No version found for ${versionInput}`); } return version4; } @@ -96827,10 +96674,10 @@ async function getAvailableVersions(manifestUrl) { info( `Getting available versions from manifest-file ${manifestUrl} ...` ); - return await getAllVersions2(manifestUrl); + } else { + info(`Getting available versions from ${VERSIONS_MANIFEST_URL} ...`); } - info(`Getting available versions from ${VERSIONS_NDJSON_URL} ...`); - return await getAllVersions(); + return await getAllVersions(manifestUrl); } function maxSatisfying2(versions, version4) { const maxSemver = evaluateVersions(versions, version4); @@ -97024,7 +96871,7 @@ function detectEmptyWorkdir() { } } async function setupUv(platform2, arch3, checkSum2, githubToken2) { - const resolvedVersion = await determineVersion(manifestFile); + const resolvedVersion = await determineVersion(); const toolCacheResult = tryGetFromToolCache(arch3, resolvedVersion); if (toolCacheResult.installedPath) { info(`Found uv in tool-cache for ${toolCacheResult.version}`); @@ -97033,28 +96880,29 @@ async function setupUv(platform2, arch3, checkSum2, githubToken2) { version: toolCacheResult.version }; } - const downloadVersionResult = manifestFile !== void 0 ? await downloadVersionFromManifest( - manifestFile, + const downloadResult = await downloadVersion( platform2, arch3, resolvedVersion, checkSum2, - githubToken2 - ) : await downloadVersionFromNdjson( - platform2, - arch3, - resolvedVersion, - checkSum2, - githubToken2 + githubToken2, + manifestFile ); return { - uvDir: downloadVersionResult.cachedToolDir, - version: downloadVersionResult.version + uvDir: downloadResult.cachedToolDir, + version: downloadResult.version }; } -async function determineVersion(manifestFile2) { +async function determineVersion() { + return await resolveVersion( + getRequestedVersion(), + manifestFile, + resolutionStrategy + ); +} +function getRequestedVersion() { if (version3 !== "") { - return await resolveVersion(version3, manifestFile2, resolutionStrategy); + return version3; } if (versionFile !== "") { const versionFromFile = getUvVersionFromFile(versionFile); @@ -97063,11 +96911,7 @@ async function determineVersion(manifestFile2) { `Could not determine uv version from file: ${versionFile}` ); } - return await resolveVersion( - versionFromFile, - manifestFile2, - resolutionStrategy - ); + return versionFromFile; } const versionFromUvToml = getUvVersionFromFile( `${workingDirectory}${path15.sep}uv.toml` @@ -97080,11 +96924,7 @@ async function determineVersion(manifestFile2) { "Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest." ); } - return await resolveVersion( - versionFromUvToml || versionFromPyproject || "latest", - manifestFile2, - resolutionStrategy - ); + return versionFromUvToml || versionFromPyproject || "latest"; } function addUvToPathAndOutput(cachedPath) { setOutput("uv-path", `${cachedPath}${path15.sep}uv`); diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index b10872f..bd014ed 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -19064,8 +19064,8 @@ var require_semver = __commonJS({ return exports2.compareBuild(b, a, loose); }); } - exports2.gt = gt; - function gt(a, b, loose) { + exports2.gt = gt2; + function gt2(a, b, loose) { return compare(a, b, loose) > 0; } exports2.lt = lt; @@ -19110,7 +19110,7 @@ var require_semver = __commonJS({ case "!=": return neq(a, b, loose); case ">": - return gt(a, b, loose); + return gt2(a, b, loose); case ">=": return gte(a, b, loose); case "<": @@ -19608,7 +19608,7 @@ var require_semver = __commonJS({ /* fallthrough */ case "": case ">=": - if (!minver || gt(minver, compver)) { + if (!minver || gt2(minver, compver)) { minver = compver; } break; @@ -19649,7 +19649,7 @@ var require_semver = __commonJS({ var gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { case ">": - gtfn = gt; + gtfn = gt2; ltefn = lte2; ltfn = lt; comp = ">"; @@ -19658,7 +19658,7 @@ var require_semver = __commonJS({ case "<": gtfn = lt; ltefn = gte; - ltfn = gt; + ltfn = gt2; comp = "<"; ecomp = "<="; break; @@ -44945,7 +44945,7 @@ function info(message) { } // src/update-known-checksums.ts -var semver = __toESM(require_semver(), 1); +var semver2 = __toESM(require_semver(), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { @@ -49410,8 +49410,11 @@ async function updateChecksums(filePath, checksumEntries) { await import_node_fs.promises.writeFile(filePath, content); } +// src/download/manifest.ts +var semver = __toESM(require_semver(), 1); + // src/utils/constants.ts -var VERSIONS_NDJSON_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson"; +var VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson"; // src/utils/fetch.ts var import_undici2 = __toESM(require_undici2(), 1); @@ -49431,72 +49434,87 @@ var fetch = async (url, opts) => await (0, import_undici2.fetch)(url, { ...opts }); -// src/download/versions-client.ts -var cachedVersionData = /* @__PURE__ */ new Map(); -async function fetchVersionData(url = VERSIONS_NDJSON_URL) { - const cachedVersions = cachedVersionData.get(url); +// src/download/manifest.ts +var cachedManifestData = /* @__PURE__ */ new Map(); +async function fetchManifest(manifestUrl = VERSIONS_MANIFEST_URL) { + const cachedVersions = cachedManifestData.get(manifestUrl); if (cachedVersions !== void 0) { - debug(`Using cached NDJSON version data from ${url}`); + debug(`Using cached manifest data from ${manifestUrl}`); return cachedVersions; } - info(`Fetching version data from ${url} ...`); - const response = await fetch(url, {}); + info(`Fetching manifest data from ${manifestUrl} ...`); + const response = await fetch(manifestUrl, {}); if (!response.ok) { throw new Error( - `Failed to fetch version data: ${response.status} ${response.statusText}` + `Failed to fetch manifest data: ${response.status} ${response.statusText}` ); } const body = await response.text(); - const versions = parseVersionData(body, url); - cachedVersionData.set(url, versions); + const versions = parseManifest(body, manifestUrl); + cachedManifestData.set(manifestUrl, versions); return versions; } -function parseVersionData(data, sourceDescription) { +function parseManifest(data, sourceDescription) { + const trimmed = data.trim(); + if (trimmed === "") { + throw new Error(`Manifest at ${sourceDescription} is empty.`); + } + if (trimmed.startsWith("[")) { + throw new Error( + `Legacy JSON array manifests are no longer supported in ${sourceDescription}. Use the astral-sh/versions manifest format instead.` + ); + } const versions = []; for (const [index, line] of data.split("\n").entries()) { - const trimmed = line.trim(); - if (trimmed === "") { + const record = line.trim(); + if (record === "") { continue; } let parsed; try { - parsed = JSON.parse(trimmed); + parsed = JSON.parse(record); } catch (error) { throw new Error( - `Failed to parse version data from ${sourceDescription} at line ${index + 1}: ${error.message}` + `Failed to parse manifest data from ${sourceDescription} at line ${index + 1}: ${error.message}` ); } - if (!isNdjsonVersion(parsed)) { + if (!isManifestVersion(parsed)) { throw new Error( - `Invalid NDJSON record in ${sourceDescription} at line ${index + 1}.` + `Invalid manifest record in ${sourceDescription} at line ${index + 1}.` ); } versions.push(parsed); } if (versions.length === 0) { - throw new Error(`No version data found in ${sourceDescription}.`); + throw new Error(`No manifest data found in ${sourceDescription}.`); } return versions; } -async function getLatestVersion() { - const versions = await fetchVersionData(); - const latestVersion = versions[0]?.version; - if (!latestVersion) { - throw new Error("No versions found in NDJSON data"); +async function getLatestVersion(manifestUrl = VERSIONS_MANIFEST_URL) { + const versions = await fetchManifest(manifestUrl); + const [firstVersion, ...remainingVersions] = versions.map( + (versionData) => versionData.version + ); + if (firstVersion === void 0) { + throw new Error("No versions found in manifest data"); } - debug(`Latest version from NDJSON: ${latestVersion}`); + const latestVersion = remainingVersions.reduce( + (latest, current) => semver.gt(current, latest) ? current : latest, + firstVersion + ); + debug(`Latest version from manifest: ${latestVersion}`); return latestVersion; } -function isNdjsonVersion(value) { +function isManifestVersion(value) { if (!isRecord(value)) { return false; } if (typeof value.version !== "string" || !Array.isArray(value.artifacts)) { return false; } - return value.artifacts.every(isNdjsonArtifact); + return value.artifacts.every(isManifestArtifact); } -function isNdjsonArtifact(value) { +function isManifestArtifact(value) { if (!isRecord(value)) { return false; } @@ -49518,14 +49536,14 @@ async function run() { } const latestVersion = await getLatestVersion(); const latestKnownVersion = getLatestKnownVersionFromChecksums(); - if (semver.lte(latestVersion, latestKnownVersion)) { + if (semver2.lte(latestVersion, latestKnownVersion)) { info( `Latest release (${latestVersion}) is not newer than the latest known version (${latestKnownVersion}). Skipping update.` ); return; } - const versions = await fetchVersionData(); - const checksumEntries = extractChecksumsFromNdjson(versions); + const versions = await fetchManifest(); + const checksumEntries = extractChecksumsFromManifest(versions); await updateChecksums(checksumFilePath, checksumEntries); setOutput("latest-version", latestVersion); } @@ -49537,7 +49555,7 @@ function getLatestKnownVersionFromChecksums() { versions.add(version); } } - const latestVersion = [...versions].sort(semver.rcompare)[0]; + const latestVersion = [...versions].sort(semver2.rcompare)[0]; if (!latestVersion) { throw new Error("Could not determine latest known version from checksums."); } @@ -49546,7 +49564,7 @@ function getLatestKnownVersionFromChecksums() { function extractVersionFromChecksumKey(key) { return key.match(VERSION_IN_CHECKSUM_KEY_PATTERN)?.[1]; } -function extractChecksumsFromNdjson(versions) { +function extractChecksumsFromManifest(versions) { const checksums = []; for (const version of versions) { for (const artifact of version.artifacts) { diff --git a/docs/customization.md b/docs/customization.md index a317591..5079746 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -19,14 +19,14 @@ are automatically verified by this action. The sha256 hashes can be found on the ## Manifest file By default, setup-uv reads version metadata from -[`astral-sh/versions`](https://github.com/astral-sh/versions) (NDJSON format). +[`astral-sh/versions`](https://github.com/astral-sh/versions). The `manifest-file` input lets you override that source with your own URL, for example to test custom uv builds or alternate download locations. ### Format -The manifest file must be in NDJSON format, where each line is a JSON object representing a version and its artifacts. For example: +The manifest file must use the same format as `astral-sh/versions`: one JSON object per line, where each object represents a version and its artifacts. The versions must be sorted in descending order. For example: ```json {"version":"0.10.7","artifacts":[{"platform":"x86_64-unknown-linux-gnu","variant":"default","url":"https://example.com/uv-x86_64-unknown-linux-gnu.tar.gz","archive_format":"tar.gz","sha256":"..."}]} @@ -37,23 +37,6 @@ setup-uv currently only supports `default` as the `variant`. The `archive_format` field is currently ignored. -### Legacy format: JSON array (deprecated) - -The previous JSON array format is still supported for compatibility, but deprecated and will be -removed in a future major release. - -```json -[ - { - "version": "0.7.13", - "artifactName": "uv-aarch64-apple-darwin.tar.gz", - "arch": "aarch64", - "platform": "apple-darwin", - "downloadUrl": "https://github.com/astral-sh/uv/releases/download/0.7.13/uv-aarch64-apple-darwin.tar.gz" - } -] -``` - ```yaml - name: Use a custom manifest file uses: astral-sh/setup-uv@v7 diff --git a/src/download/download-version.ts b/src/download/download-version.ts index 5c92068..38a60dd 100644 --- a/src/download/download-version.ts +++ b/src/download/download-version.ts @@ -8,20 +8,11 @@ import { ASTRAL_MIRROR_PREFIX, GITHUB_RELEASES_PREFIX, TOOL_CACHE_NAME, - VERSIONS_NDJSON_URL, + VERSIONS_MANIFEST_URL, } from "../utils/constants"; import type { Architecture, Platform } from "../utils/platforms"; import { validateChecksum } from "./checksum/checksum"; -import { - getAllVersions as getAllManifestVersions, - getLatestKnownVersion as getLatestVersionInManifest, - getManifestArtifact, -} from "./version-manifest"; -import { - getAllVersions as getAllVersionsFromNdjson, - getArtifact as getArtifactFromNdjson, - getLatestVersion as getLatestVersionFromNdjson, -} from "./versions-client"; +import { getAllVersions, getArtifact, getLatestVersion } from "./manifest"; export function tryGetFromToolCache( arch: Architecture, @@ -38,36 +29,42 @@ export function tryGetFromToolCache( return { installedPath, version: resolvedVersion }; } -export async function downloadVersionFromNdjson( +export async function downloadVersion( platform: Platform, arch: Architecture, version: string, checkSum: string | undefined, githubToken: string, + manifestUrl?: string, ): Promise<{ version: string; cachedToolDir: string }> { - const artifact = await getArtifactFromNdjson(version, arch, platform); + const artifact = await getArtifact(version, arch, platform, manifestUrl); if (!artifact) { throw new Error( - `Could not find artifact for version ${version}, arch ${arch}, platform ${platform} in ${VERSIONS_NDJSON_URL} .`, + getMissingArtifactMessage(version, arch, platform, manifestUrl), ); } - const mirrorUrl = rewriteToMirror(artifact.url); - const downloadUrl = mirrorUrl ?? artifact.url; + // For the default astral-sh/versions source, checksum validation relies on + // user input or the built-in KNOWN_CHECKSUMS table, not manifest sha256 values. + const checksum = + manifestUrl === undefined + ? checkSum + : resolveChecksum(checkSum, artifact.checksum); + + const mirrorUrl = rewriteToMirror(artifact.downloadUrl); + const downloadUrl = mirrorUrl ?? artifact.downloadUrl; // Don't send the GitHub token to the Astral mirror. const downloadToken = mirrorUrl !== undefined ? undefined : githubToken; - // For the default astral-sh/versions source, checksum validation relies on - // user input or the built-in KNOWN_CHECKSUMS table, not NDJSON sha256 values. try { - return await downloadVersion( + return await downloadArtifact( downloadUrl, `uv-${arch}-${platform}`, platform, arch, version, - checkSum, + checksum, downloadToken, ); } catch (err) { @@ -79,13 +76,13 @@ export async function downloadVersionFromNdjson( `Failed to download from mirror, falling back to GitHub Releases: ${(err as Error).message}`, ); - return await downloadVersion( - artifact.url, + return await downloadArtifact( + artifact.downloadUrl, `uv-${arch}-${platform}`, platform, arch, version, - checkSum, + checksum, githubToken, ); } @@ -99,41 +96,11 @@ export function rewriteToMirror(url: string): string | undefined { if (!url.startsWith(GITHUB_RELEASES_PREFIX)) { return undefined; } + return ASTRAL_MIRROR_PREFIX + url.slice(GITHUB_RELEASES_PREFIX.length); } -export async function downloadVersionFromManifest( - manifestUrl: string, - platform: Platform, - arch: Architecture, - version: string, - checkSum: string | undefined, - githubToken: string, -): Promise<{ version: string; cachedToolDir: string }> { - const artifact = await getManifestArtifact( - manifestUrl, - version, - arch, - platform, - ); - if (!artifact) { - throw new Error( - `manifest-file does not contain version ${version}, arch ${arch}, platform ${platform}.`, - ); - } - - return await downloadVersion( - artifact.downloadUrl, - `uv-${arch}-${platform}`, - platform, - arch, - version, - resolveChecksum(checkSum, artifact.checksum), - githubToken, - ); -} - -async function downloadVersion( +async function downloadArtifact( downloadUrl: string, artifactName: string, platform: Platform, @@ -177,13 +144,26 @@ async function downloadVersion( version, arch, ); - return { cachedToolDir, version: version }; + return { cachedToolDir, version }; +} + +function getMissingArtifactMessage( + version: string, + arch: Architecture, + platform: Platform, + manifestUrl?: string, +): string { + if (manifestUrl === undefined) { + return `Could not find artifact for version ${version}, arch ${arch}, platform ${platform} in ${VERSIONS_MANIFEST_URL} .`; + } + + return `manifest-file does not contain version ${version}, arch ${arch}, platform ${platform}.`; } function resolveChecksum( checkSum: string | undefined, - manifestChecksum?: string, -): string | undefined { + manifestChecksum: string, +): string { return checkSum !== undefined && checkSum !== "" ? checkSum : manifestChecksum; @@ -199,31 +179,27 @@ export async function resolveVersion( resolutionStrategy: "highest" | "lowest" = "highest", ): Promise { core.debug(`Resolving version: ${versionInput}`); - let version: string; const isSimpleMinimumVersionSpecifier = versionInput.includes(">") && !versionInput.includes(","); const resolveVersionSpecifierToLatest = isSimpleMinimumVersionSpecifier && resolutionStrategy === "highest"; + if (resolveVersionSpecifierToLatest) { core.info("Found minimum version specifier, using latest version"); } - if (manifestUrl !== undefined) { - version = - versionInput === "latest" || resolveVersionSpecifierToLatest - ? await getLatestVersionInManifest(manifestUrl) - : versionInput; - } else { - version = - versionInput === "latest" || resolveVersionSpecifierToLatest - ? await getLatestVersionFromNdjson() - : versionInput; - } + + const version = + versionInput === "latest" || resolveVersionSpecifierToLatest + ? await getLatestVersion(manifestUrl) + : versionInput; + if (tc.isExplicitVersion(version)) { core.debug(`Version ${version} is an explicit version.`); - if (resolveVersionSpecifierToLatest) { - if (!pep440.satisfies(version, versionInput)) { - throw new Error(`No version found for ${versionInput}`); - } + if ( + resolveVersionSpecifierToLatest && + !pep440.satisfies(version, versionInput) + ) { + throw new Error(`No version found for ${versionInput}`); } return version; } @@ -249,11 +225,11 @@ async function getAvailableVersions( core.info( `Getting available versions from manifest-file ${manifestUrl} ...`, ); - return await getAllManifestVersions(manifestUrl); + } else { + core.info(`Getting available versions from ${VERSIONS_MANIFEST_URL} ...`); } - core.info(`Getting available versions from ${VERSIONS_NDJSON_URL} ...`); - return await getAllVersionsFromNdjson(); + return await getAllVersions(manifestUrl); } function maxSatisfying( diff --git a/src/download/legacy-version-manifest.ts b/src/download/legacy-version-manifest.ts deleted file mode 100644 index 69e76c0..0000000 --- a/src/download/legacy-version-manifest.ts +++ /dev/null @@ -1,80 +0,0 @@ -import * as core from "@actions/core"; - -export interface ManifestEntry { - arch: string; - platform: string; - version: string; - downloadUrl: string; - checksum?: string; - variant?: string; - archiveFormat?: string; -} - -interface LegacyManifestEntry { - arch: string; - platform: string; - version: string; - downloadUrl: string; - checksum?: string; -} - -const warnedLegacyManifestUrls = new Set(); - -export function parseLegacyManifestEntries( - parsedEntries: unknown[], - manifestUrl: string, -): ManifestEntry[] { - warnAboutLegacyManifestFormat(manifestUrl); - - return parsedEntries.map((entry, index) => { - if (!isLegacyManifestEntry(entry)) { - throw new Error( - `Invalid legacy manifest-file entry at index ${index} in ${manifestUrl}.`, - ); - } - - return { - arch: entry.arch, - checksum: entry.checksum, - downloadUrl: entry.downloadUrl, - platform: entry.platform, - version: entry.version, - }; - }); -} - -export function clearLegacyManifestWarnings(): void { - warnedLegacyManifestUrls.clear(); -} - -function warnAboutLegacyManifestFormat(manifestUrl: string): void { - if (warnedLegacyManifestUrls.has(manifestUrl)) { - return; - } - - warnedLegacyManifestUrls.add(manifestUrl); - core.warning( - `manifest-file ${manifestUrl} uses the legacy JSON array format, which is deprecated. Please migrate to the astral-sh/versions NDJSON format before the next major release.`, - ); -} - -function isLegacyManifestEntry(value: unknown): value is LegacyManifestEntry { - if (!isRecord(value)) { - return false; - } - - const checksumIsValid = - typeof value.checksum === "string" || value.checksum === undefined; - - return ( - typeof value.arch === "string" && - checksumIsValid && - typeof value.downloadUrl === "string" && - typeof value.platform === "string" && - typeof value.version === "string" - ); -} - -function isRecord(value: unknown): value is Record { - return typeof value === "object" && value !== null; -} diff --git a/src/download/manifest.ts b/src/download/manifest.ts new file mode 100644 index 0000000..21084b7 --- /dev/null +++ b/src/download/manifest.ts @@ -0,0 +1,208 @@ +import * as core from "@actions/core"; +import * as semver from "semver"; +import { VERSIONS_MANIFEST_URL } from "../utils/constants"; +import { fetch } from "../utils/fetch"; +import { selectDefaultVariant } from "./variant-selection"; + +export interface ManifestArtifact { + platform: string; + variant?: string; + url: string; + archive_format: string; + sha256: string; +} + +export interface ManifestVersion { + version: string; + artifacts: ManifestArtifact[]; +} + +export interface ArtifactResult { + archiveFormat: string; + checksum: string; + downloadUrl: string; +} + +const cachedManifestData = new Map(); + +export async function fetchManifest( + manifestUrl: string = VERSIONS_MANIFEST_URL, +): Promise { + const cachedVersions = cachedManifestData.get(manifestUrl); + if (cachedVersions !== undefined) { + core.debug(`Using cached manifest data from ${manifestUrl}`); + return cachedVersions; + } + + core.info(`Fetching manifest data from ${manifestUrl} ...`); + const response = await fetch(manifestUrl, {}); + if (!response.ok) { + throw new Error( + `Failed to fetch manifest data: ${response.status} ${response.statusText}`, + ); + } + + const body = await response.text(); + const versions = parseManifest(body, manifestUrl); + cachedManifestData.set(manifestUrl, versions); + return versions; +} + +export function parseManifest( + data: string, + sourceDescription: string, +): ManifestVersion[] { + const trimmed = data.trim(); + if (trimmed === "") { + throw new Error(`Manifest at ${sourceDescription} is empty.`); + } + + if (trimmed.startsWith("[")) { + throw new Error( + `Legacy JSON array manifests are no longer supported in ${sourceDescription}. Use the astral-sh/versions manifest format instead.`, + ); + } + + const versions: ManifestVersion[] = []; + + for (const [index, line] of data.split("\n").entries()) { + const record = line.trim(); + if (record === "") { + continue; + } + + let parsed: unknown; + try { + parsed = JSON.parse(record); + } catch (error) { + throw new Error( + `Failed to parse manifest data from ${sourceDescription} at line ${index + 1}: ${(error as Error).message}`, + ); + } + + if (!isManifestVersion(parsed)) { + throw new Error( + `Invalid manifest record in ${sourceDescription} at line ${index + 1}.`, + ); + } + + versions.push(parsed); + } + + if (versions.length === 0) { + throw new Error(`No manifest data found in ${sourceDescription}.`); + } + + return versions; +} + +export async function getLatestVersion( + manifestUrl: string = VERSIONS_MANIFEST_URL, +): Promise { + const versions = await fetchManifest(manifestUrl); + const [firstVersion, ...remainingVersions] = versions.map( + (versionData) => versionData.version, + ); + + if (firstVersion === undefined) { + throw new Error("No versions found in manifest data"); + } + + const latestVersion = remainingVersions.reduce( + (latest, current) => (semver.gt(current, latest) ? current : latest), + firstVersion, + ); + + core.debug(`Latest version from manifest: ${latestVersion}`); + return latestVersion; +} + +export async function getAllVersions( + manifestUrl: string = VERSIONS_MANIFEST_URL, +): Promise { + const versions = await fetchManifest(manifestUrl); + return versions.map((versionData) => versionData.version); +} + +export async function getArtifact( + version: string, + arch: string, + platform: string, + manifestUrl: string = VERSIONS_MANIFEST_URL, +): Promise { + const versions = await fetchManifest(manifestUrl); + const versionData = versions.find( + (candidate) => candidate.version === version, + ); + if (!versionData) { + core.debug(`Version ${version} not found in manifest ${manifestUrl}`); + return undefined; + } + + const targetPlatform = `${arch}-${platform}`; + const matchingArtifacts = versionData.artifacts.filter( + (candidate) => candidate.platform === targetPlatform, + ); + + if (matchingArtifacts.length === 0) { + core.debug( + `Artifact for ${targetPlatform} not found in version ${version}. Available platforms: ${versionData.artifacts + .map((candidate) => candidate.platform) + .join(", ")}`, + ); + return undefined; + } + + const artifact = selectDefaultVariant( + matchingArtifacts, + `Multiple artifacts found for ${targetPlatform} in version ${version}`, + ); + + return { + archiveFormat: artifact.archive_format, + checksum: artifact.sha256, + downloadUrl: artifact.url, + }; +} + +export function clearManifestCache(manifestUrl?: string): void { + if (manifestUrl === undefined) { + cachedManifestData.clear(); + return; + } + + cachedManifestData.delete(manifestUrl); +} + +function isManifestVersion(value: unknown): value is ManifestVersion { + if (!isRecord(value)) { + return false; + } + + if (typeof value.version !== "string" || !Array.isArray(value.artifacts)) { + return false; + } + + return value.artifacts.every(isManifestArtifact); +} + +function isManifestArtifact(value: unknown): value is ManifestArtifact { + if (!isRecord(value)) { + return false; + } + + const variantIsValid = + typeof value.variant === "string" || value.variant === undefined; + + return ( + typeof value.archive_format === "string" && + typeof value.platform === "string" && + typeof value.sha256 === "string" && + typeof value.url === "string" && + variantIsValid + ); +} + +function isRecord(value: unknown): value is Record { + return typeof value === "object" && value !== null; +} diff --git a/src/download/version-manifest.ts b/src/download/version-manifest.ts deleted file mode 100644 index 92f2ba1..0000000 --- a/src/download/version-manifest.ts +++ /dev/null @@ -1,169 +0,0 @@ -import * as core from "@actions/core"; -import * as semver from "semver"; -import { fetch } from "../utils/fetch"; -import { - clearLegacyManifestWarnings, - type ManifestEntry, - parseLegacyManifestEntries, -} from "./legacy-version-manifest"; -import { selectDefaultVariant } from "./variant-selection"; -import { type NdjsonVersion, parseVersionData } from "./versions-client"; - -export interface ManifestArtifact { - downloadUrl: string; - checksum?: string; - archiveFormat?: string; -} - -const cachedManifestEntries = new Map(); - -export async function getLatestKnownVersion( - manifestUrl: string, -): Promise { - const versions = await getAllVersions(manifestUrl); - const latestVersion = versions.reduce((latest, current) => - semver.gt(current, latest) ? current : latest, - ); - - return latestVersion; -} - -export async function getAllVersions(manifestUrl: string): Promise { - const manifestEntries = await getManifestEntries(manifestUrl); - return [...new Set(manifestEntries.map((entry) => entry.version))]; -} - -export async function getManifestArtifact( - manifestUrl: string, - version: string, - arch: string, - platform: string, -): Promise { - const manifestEntries = await getManifestEntries(manifestUrl); - const entry = selectManifestEntry( - manifestEntries, - manifestUrl, - version, - arch, - platform, - ); - - if (!entry) { - return undefined; - } - - return { - archiveFormat: entry.archiveFormat, - checksum: entry.checksum, - downloadUrl: entry.downloadUrl, - }; -} - -export function clearManifestCache(): void { - cachedManifestEntries.clear(); - clearLegacyManifestWarnings(); -} - -async function getManifestEntries( - manifestUrl: string, -): Promise { - const cachedEntries = cachedManifestEntries.get(manifestUrl); - if (cachedEntries !== undefined) { - core.debug(`Using cached manifest-file from: ${manifestUrl}`); - return cachedEntries; - } - - core.info(`Fetching manifest-file from: ${manifestUrl}`); - const response = await fetch(manifestUrl, {}); - if (!response.ok) { - throw new Error( - `Failed to fetch manifest-file: ${response.status} ${response.statusText}`, - ); - } - - const data = await response.text(); - const parsedEntries = parseManifestEntries(data, manifestUrl); - cachedManifestEntries.set(manifestUrl, parsedEntries); - - return parsedEntries; -} - -function parseManifestEntries( - data: string, - manifestUrl: string, -): ManifestEntry[] { - const trimmed = data.trim(); - if (trimmed === "") { - throw new Error(`manifest-file at ${manifestUrl} is empty.`); - } - - const parsedAsJson = tryParseJson(trimmed); - if (Array.isArray(parsedAsJson)) { - return parseLegacyManifestEntries(parsedAsJson, manifestUrl); - } - - const versions = parseVersionData(trimmed, manifestUrl); - return mapNdjsonVersionsToManifestEntries(versions, manifestUrl); -} - -function mapNdjsonVersionsToManifestEntries( - versions: NdjsonVersion[], - manifestUrl: string, -): ManifestEntry[] { - const manifestEntries: ManifestEntry[] = []; - - for (const versionData of versions) { - for (const artifact of versionData.artifacts) { - const [arch, ...platformParts] = artifact.platform.split("-"); - if (arch === undefined || platformParts.length === 0) { - throw new Error( - `Invalid artifact platform '${artifact.platform}' in manifest-file ${manifestUrl}.`, - ); - } - - manifestEntries.push({ - arch, - archiveFormat: artifact.archive_format, - checksum: artifact.sha256, - downloadUrl: artifact.url, - platform: platformParts.join("-"), - variant: artifact.variant, - version: versionData.version, - }); - } - } - - return manifestEntries; -} - -function selectManifestEntry( - manifestEntries: ManifestEntry[], - manifestUrl: string, - version: string, - arch: string, - platform: string, -): ManifestEntry | undefined { - const matches = manifestEntries.filter( - (candidate) => - candidate.version === version && - candidate.arch === arch && - candidate.platform === platform, - ); - - if (matches.length === 0) { - return undefined; - } - - return selectDefaultVariant( - matches, - `manifest-file ${manifestUrl} contains multiple artifacts for version ${version}, arch ${arch}, platform ${platform}`, - ); -} - -function tryParseJson(value: string): unknown { - try { - return JSON.parse(value); - } catch { - return undefined; - } -} diff --git a/src/download/versions-client.ts b/src/download/versions-client.ts deleted file mode 100644 index f11c091..0000000 --- a/src/download/versions-client.ts +++ /dev/null @@ -1,191 +0,0 @@ -import * as core from "@actions/core"; -import { VERSIONS_NDJSON_URL } from "../utils/constants"; -import { fetch } from "../utils/fetch"; -import { selectDefaultVariant } from "./variant-selection"; - -export interface NdjsonArtifact { - platform: string; - variant?: string; - url: string; - archive_format: string; - sha256: string; -} - -export interface NdjsonVersion { - version: string; - artifacts: NdjsonArtifact[]; -} - -export interface ArtifactResult { - url: string; - sha256: string; - archiveFormat: string; -} - -const cachedVersionData = new Map(); - -export async function fetchVersionData( - url: string = VERSIONS_NDJSON_URL, -): Promise { - const cachedVersions = cachedVersionData.get(url); - if (cachedVersions !== undefined) { - core.debug(`Using cached NDJSON version data from ${url}`); - return cachedVersions; - } - - core.info(`Fetching version data from ${url} ...`); - const response = await fetch(url, {}); - if (!response.ok) { - throw new Error( - `Failed to fetch version data: ${response.status} ${response.statusText}`, - ); - } - - const body = await response.text(); - const versions = parseVersionData(body, url); - cachedVersionData.set(url, versions); - return versions; -} - -export function parseVersionData( - data: string, - sourceDescription: string, -): NdjsonVersion[] { - const versions: NdjsonVersion[] = []; - - for (const [index, line] of data.split("\n").entries()) { - const trimmed = line.trim(); - if (trimmed === "") { - continue; - } - - let parsed: unknown; - try { - parsed = JSON.parse(trimmed); - } catch (error) { - throw new Error( - `Failed to parse version data from ${sourceDescription} at line ${index + 1}: ${(error as Error).message}`, - ); - } - - if (!isNdjsonVersion(parsed)) { - throw new Error( - `Invalid NDJSON record in ${sourceDescription} at line ${index + 1}.`, - ); - } - - versions.push(parsed); - } - - if (versions.length === 0) { - throw new Error(`No version data found in ${sourceDescription}.`); - } - - return versions; -} - -export async function getLatestVersion(): Promise { - const versions = await fetchVersionData(); - const latestVersion = versions[0]?.version; - if (!latestVersion) { - throw new Error("No versions found in NDJSON data"); - } - - core.debug(`Latest version from NDJSON: ${latestVersion}`); - return latestVersion; -} - -export async function getAllVersions(): Promise { - const versions = await fetchVersionData(); - return versions.map((versionData) => versionData.version); -} - -export async function getArtifact( - version: string, - arch: string, - platform: string, -): Promise { - const versions = await fetchVersionData(); - const versionData = versions.find( - (candidate) => candidate.version === version, - ); - if (!versionData) { - core.debug(`Version ${version} not found in NDJSON data`); - return undefined; - } - - const targetPlatform = `${arch}-${platform}`; - const matchingArtifacts = versionData.artifacts.filter( - (candidate) => candidate.platform === targetPlatform, - ); - - if (matchingArtifacts.length === 0) { - core.debug( - `Artifact for ${targetPlatform} not found in version ${version}. Available platforms: ${versionData.artifacts - .map((candidate) => candidate.platform) - .join(", ")}`, - ); - return undefined; - } - - const artifact = selectArtifact(matchingArtifacts, version, targetPlatform); - - return { - archiveFormat: artifact.archive_format, - sha256: artifact.sha256, - url: artifact.url, - }; -} - -export function clearCache(url?: string): void { - if (url === undefined) { - cachedVersionData.clear(); - return; - } - - cachedVersionData.delete(url); -} - -function selectArtifact( - artifacts: NdjsonArtifact[], - version: string, - targetPlatform: string, -): NdjsonArtifact { - return selectDefaultVariant( - artifacts, - `Multiple artifacts found for ${targetPlatform} in version ${version}`, - ); -} - -function isNdjsonVersion(value: unknown): value is NdjsonVersion { - if (!isRecord(value)) { - return false; - } - - if (typeof value.version !== "string" || !Array.isArray(value.artifacts)) { - return false; - } - - return value.artifacts.every(isNdjsonArtifact); -} - -function isNdjsonArtifact(value: unknown): value is NdjsonArtifact { - if (!isRecord(value)) { - return false; - } - - const variantIsValid = - typeof value.variant === "string" || value.variant === undefined; - - return ( - typeof value.archive_format === "string" && - typeof value.platform === "string" && - typeof value.sha256 === "string" && - typeof value.url === "string" && - variantIsValid - ); -} - -function isRecord(value: unknown): value is Record { - return typeof value === "object" && value !== null; -} diff --git a/src/setup-uv.ts b/src/setup-uv.ts index 08da661..60ddec4 100644 --- a/src/setup-uv.ts +++ b/src/setup-uv.ts @@ -4,8 +4,7 @@ import * as core from "@actions/core"; import * as exec from "@actions/exec"; import { restoreCache } from "./cache/restore-cache"; import { - downloadVersionFromManifest, - downloadVersionFromNdjson, + downloadVersion, resolveVersion, tryGetFromToolCache, } from "./download/download-version"; @@ -132,7 +131,7 @@ async function setupUv( checkSum: string | undefined, githubToken: string, ): Promise<{ uvDir: string; version: string }> { - const resolvedVersion = await determineVersion(manifestFile); + const resolvedVersion = await determineVersion(); const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion); if (toolCacheResult.installedPath) { core.info(`Found uv in tool-cache for ${toolCacheResult.version}`); @@ -142,36 +141,34 @@ async function setupUv( }; } - const downloadVersionResult = - manifestFile !== undefined - ? await downloadVersionFromManifest( - manifestFile, - platform, - arch, - resolvedVersion, - checkSum, - githubToken, - ) - : await downloadVersionFromNdjson( - platform, - arch, - resolvedVersion, - checkSum, - githubToken, - ); + const downloadResult = await downloadVersion( + platform, + arch, + resolvedVersion, + checkSum, + githubToken, + manifestFile, + ); return { - uvDir: downloadVersionResult.cachedToolDir, - version: downloadVersionResult.version, + uvDir: downloadResult.cachedToolDir, + version: downloadResult.version, }; } -async function determineVersion( - manifestFile: string | undefined, -): Promise { +async function determineVersion(): Promise { + return await resolveVersion( + getRequestedVersion(), + manifestFile, + resolutionStrategy, + ); +} + +function getRequestedVersion(): string { if (versionInput !== "") { - return await resolveVersion(versionInput, manifestFile, resolutionStrategy); + return versionInput; } + if (versionFileInput !== "") { const versionFromFile = getUvVersionFromFile(versionFileInput); if (versionFromFile === undefined) { @@ -179,28 +176,23 @@ async function determineVersion( `Could not determine uv version from file: ${versionFileInput}`, ); } - return await resolveVersion( - versionFromFile, - manifestFile, - resolutionStrategy, - ); + return versionFromFile; } + const versionFromUvToml = getUvVersionFromFile( `${workingDirectory}${path.sep}uv.toml`, ); const versionFromPyproject = getUvVersionFromFile( `${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 await resolveVersion( - versionFromUvToml || versionFromPyproject || "latest", - manifestFile, - resolutionStrategy, - ); + + return versionFromUvToml || versionFromPyproject || "latest"; } function addUvToPathAndOutput(cachedPath: string): void { diff --git a/src/update-known-checksums.ts b/src/update-known-checksums.ts index f29f267..95bda6b 100644 --- a/src/update-known-checksums.ts +++ b/src/update-known-checksums.ts @@ -6,10 +6,10 @@ import { updateChecksums, } from "./download/checksum/update-known-checksums"; import { - fetchVersionData, + fetchManifest, getLatestVersion, - type NdjsonVersion, -} from "./download/versions-client"; + type ManifestVersion, +} from "./download/manifest"; const VERSION_IN_CHECKSUM_KEY_PATTERN = /-(\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?)$/; @@ -32,8 +32,8 @@ async function run(): Promise { return; } - const versions = await fetchVersionData(); - const checksumEntries = extractChecksumsFromNdjson(versions); + const versions = await fetchManifest(); + const checksumEntries = extractChecksumsFromManifest(versions); await updateChecksums(checksumFilePath, checksumEntries); core.setOutput("latest-version", latestVersion); @@ -61,8 +61,8 @@ function extractVersionFromChecksumKey(key: string): string | undefined { return key.match(VERSION_IN_CHECKSUM_KEY_PATTERN)?.[1]; } -function extractChecksumsFromNdjson( - versions: NdjsonVersion[], +function extractChecksumsFromManifest( + versions: ManifestVersion[], ): ChecksumEntry[] { const checksums: ChecksumEntry[] = []; diff --git a/src/utils/constants.ts b/src/utils/constants.ts index bc7d03a..ba2d07e 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,7 +1,7 @@ export const TOOL_CACHE_NAME = "uv"; export const STATE_UV_PATH = "uv-path"; export const STATE_UV_VERSION = "uv-version"; -export const VERSIONS_NDJSON_URL = +export const VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson"; /** GitHub Releases URL prefix for uv artifacts. */ From e1a7373adb857afd2a70b971e8ebdacc64ed27d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 07:42:01 +0100 Subject: [PATCH 04/20] chore: update known checksums for 0.11.0 (#815) chore: update known checksums for 0.11.0 Co-authored-by: eifinger --- dist/setup/index.cjs | 17 ++++++++++++ dist/update-known-checksums/index.cjs | 17 ++++++++++++ src/download/checksum/known-checksums.ts | 34 ++++++++++++++++++++++++ 3 files changed, 68 insertions(+) diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index a052050..e8a6e03 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -91896,6 +91896,23 @@ var fs11 = __toESM(require("node:fs"), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.0": "0c0f32c6a3473c5928aff96c3233715edfc79290e892f255cac93710cde7b91a", + "aarch64-pc-windows-msvc-0.11.0": "95419e04a3ef5f13fb2a06bd6d787ba80a9d8981d6f097780e5a979817a2879d", + "aarch64-unknown-linux-gnu-0.11.0": "8e179ca110343a17f801444ff9ef117dba56ef5fc9f6a4c9bb77b318ddba5f24", + "aarch64-unknown-linux-musl-0.11.0": "658be4b8ec905635f1295468d4d5120d9e1ab1722eec9a104473ce993590babe", + "arm-unknown-linux-musleabihf-0.11.0": "bfdcbd5fa41c8a9877a72c2b55a95da2bc79933885ef56c699b65bb2ed9cea91", + "armv7-unknown-linux-gnueabihf-0.11.0": "0cad4e1b6769e48aa1e80cf639ddcc7c1bfe9ed017e95868fed185a8d818c949", + "armv7-unknown-linux-musleabihf-0.11.0": "2aa9da83c6c0cf8a06bc9df14d51056284fa067ef5390b4db79998ff12f3bee7", + "i686-pc-windows-msvc-0.11.0": "3b09d70e686087e096dbd8a2af21b922a2cac7d613dc053c3281c3ddbb961961", + "i686-unknown-linux-gnu-0.11.0": "59928a0267501c20d9f9942f5f1d81a991ec55e29a19e002ae3d5c178c674c89", + "i686-unknown-linux-musl-0.11.0": "1f438d6f6f851f0dabad3307ce7fd46541ecc5c42ebb664f382eb6c9a424a67d", + "powerpc64le-unknown-linux-gnu-0.11.0": "29f17fb43595492b1a36cda57df7adad74183132df32799d32897268ff4e26dd", + "riscv64gc-unknown-linux-gnu-0.11.0": "84ef37dda1003c5b65fa6c8f84242d35a7fcc84cc5ea9490d702edc36cad1f67", + "s390x-unknown-linux-gnu-0.11.0": "b25be62f3b642348a2fece5c658624586661b8d1103891ab6903768b0529edc4", + "x86_64-apple-darwin-0.11.0": "31aaec764166af8885cf99321fd6ed24fef80225a6f26ed1ae8ce04111688a7e", + "x86_64-pc-windows-msvc-0.11.0": "e21d00b172df83531564a95e75a2bdc0c59b471dbb3515f0c1b4d6ef657dc451", + "x86_64-unknown-linux-gnu-0.11.0": "cc0fbb42b3642125f600a55b0b095bea65cddaadb94c6ea2b6ba5d79c5825089", + "x86_64-unknown-linux-musl-0.11.0": "bf6b0757c73d1726faa2a819b155d4d864919a95766720215d78fdcd09d42d26", "aarch64-apple-darwin-0.10.12": "ae738b5661a900579ec621d3918c0ef17bdec0da2a8a6d8b161137cd15f25414", "aarch64-pc-windows-msvc-0.10.12": "e79881e2c4f98a0f3a37b8770bf224e8fee70f6dcf8fc17055d8291bb1b0b867", "aarch64-unknown-linux-gnu-0.10.12": "0ed7d20f49f6b9b60d45fdfcac28f3ac01a671a6ef08672401ed2833423fea2a", diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index bd014ed..35befe0 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -44949,6 +44949,23 @@ var semver2 = __toESM(require_semver(), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.0": "0c0f32c6a3473c5928aff96c3233715edfc79290e892f255cac93710cde7b91a", + "aarch64-pc-windows-msvc-0.11.0": "95419e04a3ef5f13fb2a06bd6d787ba80a9d8981d6f097780e5a979817a2879d", + "aarch64-unknown-linux-gnu-0.11.0": "8e179ca110343a17f801444ff9ef117dba56ef5fc9f6a4c9bb77b318ddba5f24", + "aarch64-unknown-linux-musl-0.11.0": "658be4b8ec905635f1295468d4d5120d9e1ab1722eec9a104473ce993590babe", + "arm-unknown-linux-musleabihf-0.11.0": "bfdcbd5fa41c8a9877a72c2b55a95da2bc79933885ef56c699b65bb2ed9cea91", + "armv7-unknown-linux-gnueabihf-0.11.0": "0cad4e1b6769e48aa1e80cf639ddcc7c1bfe9ed017e95868fed185a8d818c949", + "armv7-unknown-linux-musleabihf-0.11.0": "2aa9da83c6c0cf8a06bc9df14d51056284fa067ef5390b4db79998ff12f3bee7", + "i686-pc-windows-msvc-0.11.0": "3b09d70e686087e096dbd8a2af21b922a2cac7d613dc053c3281c3ddbb961961", + "i686-unknown-linux-gnu-0.11.0": "59928a0267501c20d9f9942f5f1d81a991ec55e29a19e002ae3d5c178c674c89", + "i686-unknown-linux-musl-0.11.0": "1f438d6f6f851f0dabad3307ce7fd46541ecc5c42ebb664f382eb6c9a424a67d", + "powerpc64le-unknown-linux-gnu-0.11.0": "29f17fb43595492b1a36cda57df7adad74183132df32799d32897268ff4e26dd", + "riscv64gc-unknown-linux-gnu-0.11.0": "84ef37dda1003c5b65fa6c8f84242d35a7fcc84cc5ea9490d702edc36cad1f67", + "s390x-unknown-linux-gnu-0.11.0": "b25be62f3b642348a2fece5c658624586661b8d1103891ab6903768b0529edc4", + "x86_64-apple-darwin-0.11.0": "31aaec764166af8885cf99321fd6ed24fef80225a6f26ed1ae8ce04111688a7e", + "x86_64-pc-windows-msvc-0.11.0": "e21d00b172df83531564a95e75a2bdc0c59b471dbb3515f0c1b4d6ef657dc451", + "x86_64-unknown-linux-gnu-0.11.0": "cc0fbb42b3642125f600a55b0b095bea65cddaadb94c6ea2b6ba5d79c5825089", + "x86_64-unknown-linux-musl-0.11.0": "bf6b0757c73d1726faa2a819b155d4d864919a95766720215d78fdcd09d42d26", "aarch64-apple-darwin-0.10.12": "ae738b5661a900579ec621d3918c0ef17bdec0da2a8a6d8b161137cd15f25414", "aarch64-pc-windows-msvc-0.10.12": "e79881e2c4f98a0f3a37b8770bf224e8fee70f6dcf8fc17055d8291bb1b0b867", "aarch64-unknown-linux-gnu-0.10.12": "0ed7d20f49f6b9b60d45fdfcac28f3ac01a671a6ef08672401ed2833423fea2a", diff --git a/src/download/checksum/known-checksums.ts b/src/download/checksum/known-checksums.ts index af636eb..b304258 100644 --- a/src/download/checksum/known-checksums.ts +++ b/src/download/checksum/known-checksums.ts @@ -1,5 +1,39 @@ // AUTOGENERATED_DO_NOT_EDIT export const KNOWN_CHECKSUMS: { [key: string]: string } = { + "aarch64-apple-darwin-0.11.0": + "0c0f32c6a3473c5928aff96c3233715edfc79290e892f255cac93710cde7b91a", + "aarch64-pc-windows-msvc-0.11.0": + "95419e04a3ef5f13fb2a06bd6d787ba80a9d8981d6f097780e5a979817a2879d", + "aarch64-unknown-linux-gnu-0.11.0": + "8e179ca110343a17f801444ff9ef117dba56ef5fc9f6a4c9bb77b318ddba5f24", + "aarch64-unknown-linux-musl-0.11.0": + "658be4b8ec905635f1295468d4d5120d9e1ab1722eec9a104473ce993590babe", + "arm-unknown-linux-musleabihf-0.11.0": + "bfdcbd5fa41c8a9877a72c2b55a95da2bc79933885ef56c699b65bb2ed9cea91", + "armv7-unknown-linux-gnueabihf-0.11.0": + "0cad4e1b6769e48aa1e80cf639ddcc7c1bfe9ed017e95868fed185a8d818c949", + "armv7-unknown-linux-musleabihf-0.11.0": + "2aa9da83c6c0cf8a06bc9df14d51056284fa067ef5390b4db79998ff12f3bee7", + "i686-pc-windows-msvc-0.11.0": + "3b09d70e686087e096dbd8a2af21b922a2cac7d613dc053c3281c3ddbb961961", + "i686-unknown-linux-gnu-0.11.0": + "59928a0267501c20d9f9942f5f1d81a991ec55e29a19e002ae3d5c178c674c89", + "i686-unknown-linux-musl-0.11.0": + "1f438d6f6f851f0dabad3307ce7fd46541ecc5c42ebb664f382eb6c9a424a67d", + "powerpc64le-unknown-linux-gnu-0.11.0": + "29f17fb43595492b1a36cda57df7adad74183132df32799d32897268ff4e26dd", + "riscv64gc-unknown-linux-gnu-0.11.0": + "84ef37dda1003c5b65fa6c8f84242d35a7fcc84cc5ea9490d702edc36cad1f67", + "s390x-unknown-linux-gnu-0.11.0": + "b25be62f3b642348a2fece5c658624586661b8d1103891ab6903768b0529edc4", + "x86_64-apple-darwin-0.11.0": + "31aaec764166af8885cf99321fd6ed24fef80225a6f26ed1ae8ce04111688a7e", + "x86_64-pc-windows-msvc-0.11.0": + "e21d00b172df83531564a95e75a2bdc0c59b471dbb3515f0c1b4d6ef657dc451", + "x86_64-unknown-linux-gnu-0.11.0": + "cc0fbb42b3642125f600a55b0b095bea65cddaadb94c6ea2b6ba5d79c5825089", + "x86_64-unknown-linux-musl-0.11.0": + "bf6b0757c73d1726faa2a819b155d4d864919a95766720215d78fdcd09d42d26", "aarch64-apple-darwin-0.10.12": "ae738b5661a900579ec621d3918c0ef17bdec0da2a8a6d8b161137cd15f25414", "aarch64-pc-windows-msvc-0.10.12": From 5c62c5926145985eec91f09e2e0a75f40daed929 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 25 Mar 2026 08:14:06 +0100 Subject: [PATCH 05/20] chore: update known checksums for 0.11.1 (#817) chore: update known checksums for 0.11.1 Co-authored-by: eifinger --- dist/setup/index.cjs | 18 ++++++++++++ dist/update-known-checksums/index.cjs | 18 ++++++++++++ src/download/checksum/known-checksums.ts | 36 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index e8a6e03..600a137 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -91896,6 +91896,24 @@ var fs11 = __toESM(require("node:fs"), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.1": "f7815f739ed5d0e4202e6292acedb8659b9ae7de663d07188d8c6cbd7f96303f", + "aarch64-pc-windows-msvc-0.11.1": "b789db0c1504dd3b02c090bd5783487497cc46cc2eb71754874cdd1ef59eb52a", + "aarch64-unknown-linux-gnu-0.11.1": "1340e62da1ee3c1109764340e1247e8a1a232c30dde4a0f0548976dcaa90f06d", + "aarch64-unknown-linux-musl-0.11.1": "bd04ffce77ee8d77f39823c13606183581847c2f5dcd704f2ea0f15e376b1a27", + "arm-unknown-linux-musleabihf-0.11.1": "625c0e756e2374fce864ceaa6beedd5821e276e2b6307f2b719f2d62b449b89c", + "armv7-unknown-linux-gnueabihf-0.11.1": "baf8daaab20b0502d1853dbfd916afb0762c024ae7f0df1c2deb2a1a1c1c3467", + "armv7-unknown-linux-musleabihf-0.11.1": "684c25b74e83bcb1b177152379cfe2c974ba731aa5af278e1d161e41709f8bcf", + "i686-pc-windows-msvc-0.11.1": "3c07858a08c54e4e5753239354c7b07ae69071b2b6f5aa2cc970e612adcb4740", + "i686-unknown-linux-gnu-0.11.1": "6e83167c05708570563b10b6cc7e8c289daef5f51fde0b152e41af2a7ef70813", + "i686-unknown-linux-musl-0.11.1": "b0d5152635c257fec76f95cb9268112b47ff70bd33a23866295a4f2ed9f46b7f", + "powerpc64le-unknown-linux-gnu-0.11.1": "e42d2abfac46f57564789e2bfa6dbea4ae3135892e36ae066ba0ae77b69bb676", + "riscv64gc-unknown-linux-gnu-0.11.1": "5e2c757b35dab015ad37f74ee3e060208390b5f4defb6684876f1be0664f3f6e", + "riscv64gc-unknown-linux-musl-0.11.1": "6f590a824aed363cbec4079f7ddab87b5685119e0f5f0e71cd114c7b7c326199", + "s390x-unknown-linux-gnu-0.11.1": "4208173c74e29572b799178709b5ed5828b24888659f944a4b47c0aaf78b42d2", + "x86_64-apple-darwin-0.11.1": "2103670e8e949605e51926c7b953923ff6f6befbfb55aee928f5e760c9c910f8", + "x86_64-pc-windows-msvc-0.11.1": "6659250cebbd3bb6ee48bcb21a3f0c6656450d63fb97f0f069bcb532bdb688ed", + "x86_64-unknown-linux-gnu-0.11.1": "7c0c8069053e6e99e5911ff32b916be571f3419cd8e11bd28fb7da2c7dcaa553", + "x86_64-unknown-linux-musl-0.11.1": "4e949471a95b37088a1ff1a585f69abed4d3cd3f921f50709a46b6ba62986d38", "aarch64-apple-darwin-0.11.0": "0c0f32c6a3473c5928aff96c3233715edfc79290e892f255cac93710cde7b91a", "aarch64-pc-windows-msvc-0.11.0": "95419e04a3ef5f13fb2a06bd6d787ba80a9d8981d6f097780e5a979817a2879d", "aarch64-unknown-linux-gnu-0.11.0": "8e179ca110343a17f801444ff9ef117dba56ef5fc9f6a4c9bb77b318ddba5f24", diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index 35befe0..f72fa09 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -44949,6 +44949,24 @@ var semver2 = __toESM(require_semver(), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.1": "f7815f739ed5d0e4202e6292acedb8659b9ae7de663d07188d8c6cbd7f96303f", + "aarch64-pc-windows-msvc-0.11.1": "b789db0c1504dd3b02c090bd5783487497cc46cc2eb71754874cdd1ef59eb52a", + "aarch64-unknown-linux-gnu-0.11.1": "1340e62da1ee3c1109764340e1247e8a1a232c30dde4a0f0548976dcaa90f06d", + "aarch64-unknown-linux-musl-0.11.1": "bd04ffce77ee8d77f39823c13606183581847c2f5dcd704f2ea0f15e376b1a27", + "arm-unknown-linux-musleabihf-0.11.1": "625c0e756e2374fce864ceaa6beedd5821e276e2b6307f2b719f2d62b449b89c", + "armv7-unknown-linux-gnueabihf-0.11.1": "baf8daaab20b0502d1853dbfd916afb0762c024ae7f0df1c2deb2a1a1c1c3467", + "armv7-unknown-linux-musleabihf-0.11.1": "684c25b74e83bcb1b177152379cfe2c974ba731aa5af278e1d161e41709f8bcf", + "i686-pc-windows-msvc-0.11.1": "3c07858a08c54e4e5753239354c7b07ae69071b2b6f5aa2cc970e612adcb4740", + "i686-unknown-linux-gnu-0.11.1": "6e83167c05708570563b10b6cc7e8c289daef5f51fde0b152e41af2a7ef70813", + "i686-unknown-linux-musl-0.11.1": "b0d5152635c257fec76f95cb9268112b47ff70bd33a23866295a4f2ed9f46b7f", + "powerpc64le-unknown-linux-gnu-0.11.1": "e42d2abfac46f57564789e2bfa6dbea4ae3135892e36ae066ba0ae77b69bb676", + "riscv64gc-unknown-linux-gnu-0.11.1": "5e2c757b35dab015ad37f74ee3e060208390b5f4defb6684876f1be0664f3f6e", + "riscv64gc-unknown-linux-musl-0.11.1": "6f590a824aed363cbec4079f7ddab87b5685119e0f5f0e71cd114c7b7c326199", + "s390x-unknown-linux-gnu-0.11.1": "4208173c74e29572b799178709b5ed5828b24888659f944a4b47c0aaf78b42d2", + "x86_64-apple-darwin-0.11.1": "2103670e8e949605e51926c7b953923ff6f6befbfb55aee928f5e760c9c910f8", + "x86_64-pc-windows-msvc-0.11.1": "6659250cebbd3bb6ee48bcb21a3f0c6656450d63fb97f0f069bcb532bdb688ed", + "x86_64-unknown-linux-gnu-0.11.1": "7c0c8069053e6e99e5911ff32b916be571f3419cd8e11bd28fb7da2c7dcaa553", + "x86_64-unknown-linux-musl-0.11.1": "4e949471a95b37088a1ff1a585f69abed4d3cd3f921f50709a46b6ba62986d38", "aarch64-apple-darwin-0.11.0": "0c0f32c6a3473c5928aff96c3233715edfc79290e892f255cac93710cde7b91a", "aarch64-pc-windows-msvc-0.11.0": "95419e04a3ef5f13fb2a06bd6d787ba80a9d8981d6f097780e5a979817a2879d", "aarch64-unknown-linux-gnu-0.11.0": "8e179ca110343a17f801444ff9ef117dba56ef5fc9f6a4c9bb77b318ddba5f24", diff --git a/src/download/checksum/known-checksums.ts b/src/download/checksum/known-checksums.ts index b304258..ed1caac 100644 --- a/src/download/checksum/known-checksums.ts +++ b/src/download/checksum/known-checksums.ts @@ -1,5 +1,41 @@ // AUTOGENERATED_DO_NOT_EDIT export const KNOWN_CHECKSUMS: { [key: string]: string } = { + "aarch64-apple-darwin-0.11.1": + "f7815f739ed5d0e4202e6292acedb8659b9ae7de663d07188d8c6cbd7f96303f", + "aarch64-pc-windows-msvc-0.11.1": + "b789db0c1504dd3b02c090bd5783487497cc46cc2eb71754874cdd1ef59eb52a", + "aarch64-unknown-linux-gnu-0.11.1": + "1340e62da1ee3c1109764340e1247e8a1a232c30dde4a0f0548976dcaa90f06d", + "aarch64-unknown-linux-musl-0.11.1": + "bd04ffce77ee8d77f39823c13606183581847c2f5dcd704f2ea0f15e376b1a27", + "arm-unknown-linux-musleabihf-0.11.1": + "625c0e756e2374fce864ceaa6beedd5821e276e2b6307f2b719f2d62b449b89c", + "armv7-unknown-linux-gnueabihf-0.11.1": + "baf8daaab20b0502d1853dbfd916afb0762c024ae7f0df1c2deb2a1a1c1c3467", + "armv7-unknown-linux-musleabihf-0.11.1": + "684c25b74e83bcb1b177152379cfe2c974ba731aa5af278e1d161e41709f8bcf", + "i686-pc-windows-msvc-0.11.1": + "3c07858a08c54e4e5753239354c7b07ae69071b2b6f5aa2cc970e612adcb4740", + "i686-unknown-linux-gnu-0.11.1": + "6e83167c05708570563b10b6cc7e8c289daef5f51fde0b152e41af2a7ef70813", + "i686-unknown-linux-musl-0.11.1": + "b0d5152635c257fec76f95cb9268112b47ff70bd33a23866295a4f2ed9f46b7f", + "powerpc64le-unknown-linux-gnu-0.11.1": + "e42d2abfac46f57564789e2bfa6dbea4ae3135892e36ae066ba0ae77b69bb676", + "riscv64gc-unknown-linux-gnu-0.11.1": + "5e2c757b35dab015ad37f74ee3e060208390b5f4defb6684876f1be0664f3f6e", + "riscv64gc-unknown-linux-musl-0.11.1": + "6f590a824aed363cbec4079f7ddab87b5685119e0f5f0e71cd114c7b7c326199", + "s390x-unknown-linux-gnu-0.11.1": + "4208173c74e29572b799178709b5ed5828b24888659f944a4b47c0aaf78b42d2", + "x86_64-apple-darwin-0.11.1": + "2103670e8e949605e51926c7b953923ff6f6befbfb55aee928f5e760c9c910f8", + "x86_64-pc-windows-msvc-0.11.1": + "6659250cebbd3bb6ee48bcb21a3f0c6656450d63fb97f0f069bcb532bdb688ed", + "x86_64-unknown-linux-gnu-0.11.1": + "7c0c8069053e6e99e5911ff32b916be571f3419cd8e11bd28fb7da2c7dcaa553", + "x86_64-unknown-linux-musl-0.11.1": + "4e949471a95b37088a1ff1a585f69abed4d3cd3f921f50709a46b6ba62986d38", "aarch64-apple-darwin-0.11.0": "0c0f32c6a3473c5928aff96c3233715edfc79290e892f255cac93710cde7b91a", "aarch64-pc-windows-msvc-0.11.0": From 447e6d02b15d65b3247cce2d6019f11957285d11 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2026 07:12:16 +0100 Subject: [PATCH 06/20] chore: update known checksums for 0.11.2 (#821) chore: update known checksums for 0.11.2 Co-authored-by: eifinger --- dist/setup/index.cjs | 18 ++++++++++++ dist/update-known-checksums/index.cjs | 18 ++++++++++++ src/download/checksum/known-checksums.ts | 36 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index 600a137..f87e0b7 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -91896,6 +91896,24 @@ var fs11 = __toESM(require("node:fs"), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.2": "4beaa9550f93ef7f0fc02f7c28c9c48cd61fe30db00f5ac8947e0a425c3fb282", + "aarch64-pc-windows-msvc-0.11.2": "ffdded8338205f53727b51d404563a5ac8eaa9aea53279a7b7c42177e11d478c", + "aarch64-unknown-linux-gnu-0.11.2": "04792cac761c4a6ba78267f36f2af541b7f92196d42ac55d21d3ff6b0f5ab6a5", + "aarch64-unknown-linux-musl-0.11.2": "275d91dd1f1955136591e7ec5e1fa21e84d0d37ead7da7c35c3683df748d9855", + "arm-unknown-linux-musleabihf-0.11.2": "ce572dac1a8f9a92960f89e99351352fae068d34b24bed86fb88e75fd5dd67d9", + "armv7-unknown-linux-gnueabihf-0.11.2": "3e90d7de9e3a4e2d8d1bd9ce164362fce22248474986e712039479fb6fd73136", + "armv7-unknown-linux-musleabihf-0.11.2": "5222cdd7c7dd3263f8c243831606a9f01a1a07a40ffc3c26c03afb34491075c2", + "i686-pc-windows-msvc-0.11.2": "506f8274b253b2386881a121f3b7d915b637019bda15876bbd1357235305cf12", + "i686-unknown-linux-gnu-0.11.2": "c7ec378bab887443a70786382e58d76489da14a7e33b155915d648cca4bdb46c", + "i686-unknown-linux-musl-0.11.2": "ade8714be45457899568c5b03ef885a0cc94476c07a0bdbe34531ba84231bab2", + "powerpc64le-unknown-linux-gnu-0.11.2": "3f3a50e99364efc8ff7add10e79757a2b8458700a38180ec5f313524481b9fbc", + "riscv64gc-unknown-linux-gnu-0.11.2": "e56a93f0ff21d6908461a6ecbf465beae19ae22719f900284abb7680bd07ec41", + "riscv64gc-unknown-linux-musl-0.11.2": "4f263571bb457a16a31cb38fba4fcc9cf1059d1d32c5b2e54c43175fcd59205d", + "s390x-unknown-linux-gnu-0.11.2": "42ebe40775f2a77a514fa47399fde86473bf35bd33b6896c6410a0309fc4d205", + "x86_64-apple-darwin-0.11.2": "a9c3653245031304c50dd60ac0301bf6c112e12c38c32302a71d4fa6a63ba2cb", + "x86_64-pc-windows-msvc-0.11.2": "171b7ccda1bbd562da6babeffcf533a1c6cc7862cf998da826e1db534fc43e48", + "x86_64-unknown-linux-gnu-0.11.2": "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981", + "x86_64-unknown-linux-musl-0.11.2": "4700d9fc75734247587deb3e25dd2c6c24f4ac69e8fe91d6acad4a6013115c06", "aarch64-apple-darwin-0.11.1": "f7815f739ed5d0e4202e6292acedb8659b9ae7de663d07188d8c6cbd7f96303f", "aarch64-pc-windows-msvc-0.11.1": "b789db0c1504dd3b02c090bd5783487497cc46cc2eb71754874cdd1ef59eb52a", "aarch64-unknown-linux-gnu-0.11.1": "1340e62da1ee3c1109764340e1247e8a1a232c30dde4a0f0548976dcaa90f06d", diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index f72fa09..3b81829 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -44949,6 +44949,24 @@ var semver2 = __toESM(require_semver(), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.2": "4beaa9550f93ef7f0fc02f7c28c9c48cd61fe30db00f5ac8947e0a425c3fb282", + "aarch64-pc-windows-msvc-0.11.2": "ffdded8338205f53727b51d404563a5ac8eaa9aea53279a7b7c42177e11d478c", + "aarch64-unknown-linux-gnu-0.11.2": "04792cac761c4a6ba78267f36f2af541b7f92196d42ac55d21d3ff6b0f5ab6a5", + "aarch64-unknown-linux-musl-0.11.2": "275d91dd1f1955136591e7ec5e1fa21e84d0d37ead7da7c35c3683df748d9855", + "arm-unknown-linux-musleabihf-0.11.2": "ce572dac1a8f9a92960f89e99351352fae068d34b24bed86fb88e75fd5dd67d9", + "armv7-unknown-linux-gnueabihf-0.11.2": "3e90d7de9e3a4e2d8d1bd9ce164362fce22248474986e712039479fb6fd73136", + "armv7-unknown-linux-musleabihf-0.11.2": "5222cdd7c7dd3263f8c243831606a9f01a1a07a40ffc3c26c03afb34491075c2", + "i686-pc-windows-msvc-0.11.2": "506f8274b253b2386881a121f3b7d915b637019bda15876bbd1357235305cf12", + "i686-unknown-linux-gnu-0.11.2": "c7ec378bab887443a70786382e58d76489da14a7e33b155915d648cca4bdb46c", + "i686-unknown-linux-musl-0.11.2": "ade8714be45457899568c5b03ef885a0cc94476c07a0bdbe34531ba84231bab2", + "powerpc64le-unknown-linux-gnu-0.11.2": "3f3a50e99364efc8ff7add10e79757a2b8458700a38180ec5f313524481b9fbc", + "riscv64gc-unknown-linux-gnu-0.11.2": "e56a93f0ff21d6908461a6ecbf465beae19ae22719f900284abb7680bd07ec41", + "riscv64gc-unknown-linux-musl-0.11.2": "4f263571bb457a16a31cb38fba4fcc9cf1059d1d32c5b2e54c43175fcd59205d", + "s390x-unknown-linux-gnu-0.11.2": "42ebe40775f2a77a514fa47399fde86473bf35bd33b6896c6410a0309fc4d205", + "x86_64-apple-darwin-0.11.2": "a9c3653245031304c50dd60ac0301bf6c112e12c38c32302a71d4fa6a63ba2cb", + "x86_64-pc-windows-msvc-0.11.2": "171b7ccda1bbd562da6babeffcf533a1c6cc7862cf998da826e1db534fc43e48", + "x86_64-unknown-linux-gnu-0.11.2": "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981", + "x86_64-unknown-linux-musl-0.11.2": "4700d9fc75734247587deb3e25dd2c6c24f4ac69e8fe91d6acad4a6013115c06", "aarch64-apple-darwin-0.11.1": "f7815f739ed5d0e4202e6292acedb8659b9ae7de663d07188d8c6cbd7f96303f", "aarch64-pc-windows-msvc-0.11.1": "b789db0c1504dd3b02c090bd5783487497cc46cc2eb71754874cdd1ef59eb52a", "aarch64-unknown-linux-gnu-0.11.1": "1340e62da1ee3c1109764340e1247e8a1a232c30dde4a0f0548976dcaa90f06d", diff --git a/src/download/checksum/known-checksums.ts b/src/download/checksum/known-checksums.ts index ed1caac..3caebc2 100644 --- a/src/download/checksum/known-checksums.ts +++ b/src/download/checksum/known-checksums.ts @@ -1,5 +1,41 @@ // AUTOGENERATED_DO_NOT_EDIT export const KNOWN_CHECKSUMS: { [key: string]: string } = { + "aarch64-apple-darwin-0.11.2": + "4beaa9550f93ef7f0fc02f7c28c9c48cd61fe30db00f5ac8947e0a425c3fb282", + "aarch64-pc-windows-msvc-0.11.2": + "ffdded8338205f53727b51d404563a5ac8eaa9aea53279a7b7c42177e11d478c", + "aarch64-unknown-linux-gnu-0.11.2": + "04792cac761c4a6ba78267f36f2af541b7f92196d42ac55d21d3ff6b0f5ab6a5", + "aarch64-unknown-linux-musl-0.11.2": + "275d91dd1f1955136591e7ec5e1fa21e84d0d37ead7da7c35c3683df748d9855", + "arm-unknown-linux-musleabihf-0.11.2": + "ce572dac1a8f9a92960f89e99351352fae068d34b24bed86fb88e75fd5dd67d9", + "armv7-unknown-linux-gnueabihf-0.11.2": + "3e90d7de9e3a4e2d8d1bd9ce164362fce22248474986e712039479fb6fd73136", + "armv7-unknown-linux-musleabihf-0.11.2": + "5222cdd7c7dd3263f8c243831606a9f01a1a07a40ffc3c26c03afb34491075c2", + "i686-pc-windows-msvc-0.11.2": + "506f8274b253b2386881a121f3b7d915b637019bda15876bbd1357235305cf12", + "i686-unknown-linux-gnu-0.11.2": + "c7ec378bab887443a70786382e58d76489da14a7e33b155915d648cca4bdb46c", + "i686-unknown-linux-musl-0.11.2": + "ade8714be45457899568c5b03ef885a0cc94476c07a0bdbe34531ba84231bab2", + "powerpc64le-unknown-linux-gnu-0.11.2": + "3f3a50e99364efc8ff7add10e79757a2b8458700a38180ec5f313524481b9fbc", + "riscv64gc-unknown-linux-gnu-0.11.2": + "e56a93f0ff21d6908461a6ecbf465beae19ae22719f900284abb7680bd07ec41", + "riscv64gc-unknown-linux-musl-0.11.2": + "4f263571bb457a16a31cb38fba4fcc9cf1059d1d32c5b2e54c43175fcd59205d", + "s390x-unknown-linux-gnu-0.11.2": + "42ebe40775f2a77a514fa47399fde86473bf35bd33b6896c6410a0309fc4d205", + "x86_64-apple-darwin-0.11.2": + "a9c3653245031304c50dd60ac0301bf6c112e12c38c32302a71d4fa6a63ba2cb", + "x86_64-pc-windows-msvc-0.11.2": + "171b7ccda1bbd562da6babeffcf533a1c6cc7862cf998da826e1db534fc43e48", + "x86_64-unknown-linux-gnu-0.11.2": + "7ac2ca0449c8d68dae9b99e635cd3bc9b22a4cb1de64b7c43716398447d42981", + "x86_64-unknown-linux-musl-0.11.2": + "4700d9fc75734247587deb3e25dd2c6c24f4ac69e8fe91d6acad4a6013115c06", "aarch64-apple-darwin-0.11.1": "f7815f739ed5d0e4202e6292acedb8659b9ae7de663d07188d8c6cbd7f96303f", "aarch64-pc-windows-msvc-0.11.1": From 868d1f74d9d862d7b40219546bfe35299c6dd452 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sat, 28 Mar 2026 16:19:09 +0100 Subject: [PATCH 07/20] Replace inline compile args with tsconfig (#824) --- .github/scripts/tsconfig.json | 9 +++++++++ .github/workflows/test.yml | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .github/scripts/tsconfig.json diff --git a/.github/scripts/tsconfig.json b/.github/scripts/tsconfig.json new file mode 100644 index 0000000..89e68fa --- /dev/null +++ b/.github/scripts/tsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "module": "nodenext", + "moduleResolution": "nodenext", + "target": "es2022", + "types": ["node"] + }, + "include": ["check-all-tests-passed-needs.ts"] +} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 04669ee..0b876cc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -38,7 +38,7 @@ jobs: npm run all - name: Check all jobs are in all-tests-passed.needs run: | - tsc --module nodenext --moduleResolution nodenext --target es2022 check-all-tests-passed-needs.ts + tsc -p tsconfig.json node check-all-tests-passed-needs.js working-directory: .github/scripts - name: Make sure no changes from linters are detected From f82eb19c06057c455674b2602e0139fd906f1428 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sat, 28 Mar 2026 16:23:26 +0100 Subject: [PATCH 08/20] Refactor inputs (#823) Don't load at import time and make it easier to test --- __tests__/download/manifest.test.ts | 1 - __tests__/utils/inputs.test.ts | 337 +-- dist/save-cache/index.cjs | 656 +++--- dist/setup/index.cjs | 2973 ++++++++++++++------------- src/cache/restore-cache.ts | 49 +- src/download/download-version.ts | 18 +- src/save-cache.ts | 43 +- src/setup-uv.ts | 177 +- src/utils/inputs.ts | 221 +- 9 files changed, 2363 insertions(+), 2112 deletions(-) diff --git a/__tests__/download/manifest.test.ts b/__tests__/download/manifest.test.ts index 90b2e56..74cd428 100644 --- a/__tests__/download/manifest.test.ts +++ b/__tests__/download/manifest.test.ts @@ -17,7 +17,6 @@ const { fetchManifest, getAllVersions, getArtifact, - getLatestVersion, parseManifest, } = await import("../../src/download/manifest"); diff --git a/__tests__/utils/inputs.test.ts b/__tests__/utils/inputs.test.ts index a83c7a7..a066833 100644 --- a/__tests__/utils/inputs.test.ts +++ b/__tests__/utils/inputs.test.ts @@ -1,3 +1,6 @@ +import fs from "node:fs"; +import os from "node:os"; +import path from "node:path"; import { afterEach, beforeEach, @@ -7,9 +10,13 @@ import { jest, } from "@jest/globals"; -// Will be mutated per test before (re-)importing the module under test let mockInputs: Record = {}; +const tempDirs: string[] = []; const ORIGINAL_HOME = process.env.HOME; +const ORIGINAL_RUNNER_ENVIRONMENT = process.env.RUNNER_ENVIRONMENT; +const ORIGINAL_RUNNER_TEMP = process.env.RUNNER_TEMP; +const ORIGINAL_UV_CACHE_DIR = process.env.UV_CACHE_DIR; +const ORIGINAL_UV_PYTHON_INSTALL_DIR = process.env.UV_PYTHON_INSTALL_DIR; const mockDebug = jest.fn(); const mockGetBooleanInput = jest.fn( @@ -27,118 +34,228 @@ jest.unstable_mockModule("@actions/core", () => ({ warning: mockWarning, })); -async function importInputsModule() { - return await import("../../src/utils/inputs"); +const { CacheLocalSource, loadInputs } = await import("../../src/utils/inputs"); + +function createTempProject(files: Record): string { + const dir = fs.mkdtempSync(path.join(os.tmpdir(), "setup-uv-inputs-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; } +function resetEnvironment(): void { + jest.clearAllMocks(); + mockInputs = {}; + process.env.HOME = "/home/testuser"; + delete process.env.RUNNER_ENVIRONMENT; + delete process.env.RUNNER_TEMP; + delete process.env.UV_CACHE_DIR; + delete process.env.UV_PYTHON_INSTALL_DIR; +} + +function restoreEnvironment(): void { + while (tempDirs.length > 0) { + const dir = tempDirs.pop(); + if (dir !== undefined) { + fs.rmSync(dir, { force: true, recursive: true }); + } + } + + process.env.HOME = ORIGINAL_HOME; + process.env.RUNNER_ENVIRONMENT = ORIGINAL_RUNNER_ENVIRONMENT; + process.env.RUNNER_TEMP = ORIGINAL_RUNNER_TEMP; + process.env.UV_CACHE_DIR = ORIGINAL_UV_CACHE_DIR; + process.env.UV_PYTHON_INSTALL_DIR = ORIGINAL_UV_PYTHON_INSTALL_DIR; +} + +beforeEach(() => { + resetEnvironment(); +}); + +afterEach(() => { + restoreEnvironment(); +}); + +describe("loadInputs", () => { + it("loads defaults for a github-hosted runner", () => { + mockInputs["working-directory"] = "/workspace"; + mockInputs["enable-cache"] = "auto"; + process.env.RUNNER_ENVIRONMENT = "github-hosted"; + process.env.RUNNER_TEMP = "/runner-temp"; + + const inputs = loadInputs(); + + expect(inputs.enableCache).toBe(true); + expect(inputs.cacheLocalPath).toEqual({ + path: "/runner-temp/setup-uv-cache", + source: CacheLocalSource.Default, + }); + expect(inputs.pythonDir).toBe("/runner-temp/uv-python-dir"); + expect(inputs.venvPath).toBe("/workspace/.venv"); + expect(inputs.manifestFile).toBeUndefined(); + expect(inputs.resolutionStrategy).toBe("highest"); + }); + + it("uses cache-dir from pyproject.toml when present", () => { + mockInputs["working-directory"] = createTempProject({ + "pyproject.toml": `[project] +name = "uv-project" +version = "0.1.0" + +[tool.uv] +cache-dir = "/tmp/pyproject-toml-defined-cache-path" +`, + }); + + const inputs = loadInputs(); + + expect(inputs.cacheLocalPath).toEqual({ + path: "/tmp/pyproject-toml-defined-cache-path", + source: CacheLocalSource.Config, + }); + expect(mockInfo).toHaveBeenCalledWith( + expect.stringContaining("Found cache-dir in"), + ); + }); + + it("uses UV_CACHE_DIR from the environment", () => { + mockInputs["working-directory"] = createTempProject({}); + process.env.UV_CACHE_DIR = "/env/cache-dir"; + + const inputs = loadInputs(); + + expect(inputs.cacheLocalPath).toEqual({ + path: "/env/cache-dir", + source: CacheLocalSource.Env, + }); + expect(mockInfo).toHaveBeenCalledWith( + "UV_CACHE_DIR is already set to /env/cache-dir", + ); + }); + + it("uses UV_PYTHON_INSTALL_DIR from the environment", () => { + mockInputs["working-directory"] = "/workspace"; + process.env.UV_PYTHON_INSTALL_DIR = "/env/python-dir"; + + const inputs = loadInputs(); + + expect(inputs.pythonDir).toBe("/env/python-dir"); + expect(mockInfo).toHaveBeenCalledWith( + "UV_PYTHON_INSTALL_DIR is already set to /env/python-dir", + ); + }); + + it("warns when parsing a malformed pyproject.toml for cache-dir", () => { + mockInputs["working-directory"] = createTempProject({ + "pyproject.toml": `[project] +name = "malformed-pyproject-toml-project" +version = "0.1.0" + +[malformed-toml +`, + }); + + const inputs = loadInputs(); + + expect(inputs.cacheLocalPath).toBeUndefined(); + expect(mockWarning).toHaveBeenCalledWith( + expect.stringContaining("Error while parsing pyproject.toml:"), + ); + }); + + it("throws for an invalid resolution strategy", () => { + mockInputs["working-directory"] = "/workspace"; + mockInputs["resolution-strategy"] = "middle"; + + expect(() => loadInputs()).toThrow( + "Invalid resolution-strategy: middle. Must be 'highest' or 'lowest'.", + ); + }); +}); + describe("cacheDependencyGlob", () => { - beforeEach(() => { - jest.resetModules(); - jest.clearAllMocks(); - mockInputs = {}; - process.env.HOME = "/home/testuser"; - }); - - afterEach(() => { - process.env.HOME = ORIGINAL_HOME; - }); - - it("returns empty string when input not provided", async () => { + it("returns empty string when input not provided", () => { mockInputs["working-directory"] = "/workspace"; - const { cacheDependencyGlob } = await importInputsModule(); - expect(cacheDependencyGlob).toBe(""); + + const inputs = loadInputs(); + + expect(inputs.cacheDependencyGlob).toBe(""); }); - it("resolves a single relative path", async () => { + it.each([ + ["requirements.txt", "/workspace/requirements.txt"], + ["./uv.lock", "/workspace/uv.lock"], + ])("resolves %s to %s", (globInput, expected) => { mockInputs["working-directory"] = "/workspace"; - mockInputs["cache-dependency-glob"] = "requirements.txt"; - const { cacheDependencyGlob } = await importInputsModule(); - expect(cacheDependencyGlob).toBe("/workspace/requirements.txt"); + mockInputs["cache-dependency-glob"] = globInput; + + const inputs = loadInputs(); + + expect(inputs.cacheDependencyGlob).toBe(expected); }); - it("strips leading ./ from relative path", async () => { - mockInputs["working-directory"] = "/workspace"; - mockInputs["cache-dependency-glob"] = "./uv.lock"; - const { cacheDependencyGlob } = await importInputsModule(); - expect(cacheDependencyGlob).toBe("/workspace/uv.lock"); - }); - - it("handles multiple lines, trimming whitespace, tilde expansion and absolute paths", async () => { + it("handles multiple lines, trimming whitespace, tilde expansion and absolute paths", () => { mockInputs["working-directory"] = "/workspace"; mockInputs["cache-dependency-glob"] = " ~/.cache/file1\n ./rel/file2 \nfile3.txt"; - const { cacheDependencyGlob } = await importInputsModule(); - expect(cacheDependencyGlob).toBe( + + const inputs = loadInputs(); + + expect(inputs.cacheDependencyGlob).toBe( [ - "/home/testuser/.cache/file1", // expanded tilde, absolute path unchanged - "/workspace/rel/file2", // ./ stripped and resolved - "/workspace/file3.txt", // relative path resolved + "/home/testuser/.cache/file1", + "/workspace/rel/file2", + "/workspace/file3.txt", ].join("\n"), ); }); - it("keeps absolute path unchanged in multiline input", async () => { - mockInputs["working-directory"] = "/workspace"; - mockInputs["cache-dependency-glob"] = "/abs/path.lock\nrelative.lock"; - const { cacheDependencyGlob } = await importInputsModule(); - expect(cacheDependencyGlob).toBe( + it.each([ + [ + "/abs/path.lock\nrelative.lock", ["/abs/path.lock", "/workspace/relative.lock"].join("\n"), - ); - }); - - it("handles exclusions in relative paths correct", async () => { - mockInputs["working-directory"] = "/workspace"; - mockInputs["cache-dependency-glob"] = "!/abs/path.lock\n!relative.lock"; - const { cacheDependencyGlob } = await importInputsModule(); - expect(cacheDependencyGlob).toBe( + ], + [ + "!/abs/path.lock\n!relative.lock", ["!/abs/path.lock", "!/workspace/relative.lock"].join("\n"), - ); + ], + ])("normalizes multiline glob %s", (globInput, expected) => { + mockInputs["working-directory"] = "/workspace"; + mockInputs["cache-dependency-glob"] = globInput; + + const inputs = loadInputs(); + + expect(inputs.cacheDependencyGlob).toBe(expected); }); }); describe("tool directories", () => { - beforeEach(() => { - jest.resetModules(); - jest.clearAllMocks(); - mockInputs = {}; - process.env.HOME = "/home/testuser"; - }); - - afterEach(() => { - process.env.HOME = ORIGINAL_HOME; - }); - - it("expands tilde for tool-bin-dir and tool-dir", async () => { + it("expands tilde for tool-bin-dir and tool-dir", () => { mockInputs["working-directory"] = "/workspace"; mockInputs["tool-bin-dir"] = "~/tool-bin-dir"; mockInputs["tool-dir"] = "~/tool-dir"; - const { toolBinDir, toolDir } = await importInputsModule(); + const inputs = loadInputs(); - expect(toolBinDir).toBe("/home/testuser/tool-bin-dir"); - expect(toolDir).toBe("/home/testuser/tool-dir"); + expect(inputs.toolBinDir).toBe("/home/testuser/tool-bin-dir"); + expect(inputs.toolDir).toBe("/home/testuser/tool-dir"); }); }); describe("cacheLocalPath", () => { - beforeEach(() => { - jest.resetModules(); - jest.clearAllMocks(); - mockInputs = {}; - process.env.HOME = "/home/testuser"; - }); - - afterEach(() => { - process.env.HOME = ORIGINAL_HOME; - }); - - it("expands tilde in cache-local-path", async () => { + it("expands tilde in cache-local-path", () => { mockInputs["working-directory"] = "/workspace"; mockInputs["cache-local-path"] = "~/uv-cache/cache-local-path"; - const { CacheLocalSource, cacheLocalPath } = await importInputsModule(); + const inputs = loadInputs(); - expect(cacheLocalPath).toEqual({ + expect(inputs.cacheLocalPath).toEqual({ path: "/home/testuser/uv-cache/cache-local-path", source: CacheLocalSource.Input, }); @@ -146,63 +263,37 @@ describe("cacheLocalPath", () => { }); describe("venvPath", () => { - beforeEach(() => { - jest.resetModules(); - jest.clearAllMocks(); - mockInputs = {}; - process.env.HOME = "/home/testuser"; - }); - - afterEach(() => { - process.env.HOME = ORIGINAL_HOME; - }); - - it("defaults to .venv in the working directory", async () => { + it("defaults to .venv in the working directory", () => { mockInputs["working-directory"] = "/workspace"; - const { venvPath } = await importInputsModule(); - expect(venvPath).toBe("/workspace/.venv"); + + const inputs = loadInputs(); + + expect(inputs.venvPath).toBe("/workspace/.venv"); }); - it("resolves a relative venv-path", async () => { + it.each([ + ["custom-venv", "/workspace/custom-venv"], + ["custom-venv/", "/workspace/custom-venv"], + ["/tmp/custom-venv", "/tmp/custom-venv"], + ["~/.venv", "/home/testuser/.venv"], + ])("resolves venv-path %s to %s", (venvPathInput, expected) => { mockInputs["working-directory"] = "/workspace"; mockInputs["activate-environment"] = "true"; - mockInputs["venv-path"] = "custom-venv"; - const { venvPath } = await importInputsModule(); - expect(venvPath).toBe("/workspace/custom-venv"); + mockInputs["venv-path"] = venvPathInput; + + const inputs = loadInputs(); + + expect(inputs.venvPath).toBe(expected); }); - it("normalizes venv-path with trailing slash", async () => { - mockInputs["working-directory"] = "/workspace"; - mockInputs["activate-environment"] = "true"; - mockInputs["venv-path"] = "custom-venv/"; - const { venvPath } = await importInputsModule(); - expect(venvPath).toBe("/workspace/custom-venv"); - }); - - it("keeps an absolute venv-path unchanged", async () => { - mockInputs["working-directory"] = "/workspace"; - mockInputs["activate-environment"] = "true"; - mockInputs["venv-path"] = "/tmp/custom-venv"; - const { venvPath } = await importInputsModule(); - expect(venvPath).toBe("/tmp/custom-venv"); - }); - - it("expands tilde in venv-path", async () => { - mockInputs["working-directory"] = "/workspace"; - mockInputs["activate-environment"] = "true"; - mockInputs["venv-path"] = "~/.venv"; - const { venvPath } = await importInputsModule(); - expect(venvPath).toBe("/home/testuser/.venv"); - }); - - it("warns when venv-path is set but activate-environment is false", async () => { + it("warns when venv-path is set but activate-environment is false", () => { mockInputs["working-directory"] = "/workspace"; mockInputs["venv-path"] = "custom-venv"; - const { activateEnvironment, venvPath } = await importInputsModule(); + const inputs = loadInputs(); - expect(activateEnvironment).toBe(false); - expect(venvPath).toBe("/workspace/custom-venv"); + expect(inputs.activateEnvironment).toBe(false); + expect(inputs.venvPath).toBe("/workspace/custom-venv"); expect(mockWarning).toHaveBeenCalledWith( "venv-path is only used when activate-environment is true", ); diff --git a/dist/save-cache/index.cjs b/dist/save-cache/index.cjs index f79c54a..42f3ae7 100644 --- a/dist/save-cache/index.cjs +++ b/dist/save-cache/index.cjs @@ -1492,36 +1492,36 @@ var require_diagnostics = __commonJS({ const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog; diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debuglog( "connecting to %s using %s%s", `${host}${port ? `:${port}` : ""}`, protocol, - version4 + version3 ); }); diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debuglog( "connected to %s using %s%s", `${host}${port ? `:${port}` : ""}`, protocol, - version4 + version3 ); }); diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host }, + connectParams: { version: version3, protocol, port, host }, error: error2 } = evt; debuglog( "connection to %s using %s%s errored - %s", `${host}${port ? `:${port}` : ""}`, protocol, - version4, + version3, error2.message ); }); @@ -1570,31 +1570,31 @@ var require_diagnostics = __commonJS({ const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog; diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debuglog( "connecting to %s%s using %s%s", host, port ? `:${port}` : "", protocol, - version4 + version3 ); }); diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debuglog( "connected to %s%s using %s%s", host, port ? `:${port}` : "", protocol, - version4 + version3 ); }); diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host }, + connectParams: { version: version3, protocol, port, host }, error: error2 } = evt; debuglog( @@ -1602,7 +1602,7 @@ var require_diagnostics = __commonJS({ host, port ? `:${port}` : "", protocol, - version4, + version3, error2.message ); }); @@ -19562,31 +19562,31 @@ var require_semver = __commonJS({ var parseOptions = require_parse_options(); var { compareIdentifiers } = require_identifiers(); var SemVer = class _SemVer { - constructor(version4, options) { + constructor(version3, options) { options = parseOptions(options); - if (version4 instanceof _SemVer) { - if (version4.loose === !!options.loose && version4.includePrerelease === !!options.includePrerelease) { - return version4; + if (version3 instanceof _SemVer) { + if (version3.loose === !!options.loose && version3.includePrerelease === !!options.includePrerelease) { + return version3; } else { - version4 = version4.version; + version3 = version3.version; } - } else if (typeof version4 !== "string") { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version4}".`); + } else if (typeof version3 !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version3}".`); } - if (version4.length > MAX_LENGTH) { + if (version3.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ); } - debug2("SemVer", version4, options); + debug2("SemVer", version3, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; - const m = version4.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); + const m = version3.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); if (!m) { - throw new TypeError(`Invalid Version: ${version4}`); + throw new TypeError(`Invalid Version: ${version3}`); } - this.raw = version4; + this.raw = version3; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; @@ -19836,12 +19836,12 @@ var require_parse2 = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/parse.js"(exports2, module2) { "use strict"; var SemVer = require_semver(); - var parse3 = (version4, options, throwErrors = false) => { - if (version4 instanceof SemVer) { - return version4; + var parse3 = (version3, options, throwErrors = false) => { + if (version3 instanceof SemVer) { + return version3; } try { - return new SemVer(version4, options); + return new SemVer(version3, options); } catch (er) { if (!throwErrors) { return null; @@ -19858,8 +19858,8 @@ var require_valid = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/valid.js"(exports2, module2) { "use strict"; var parse3 = require_parse2(); - var valid = (version4, options) => { - const v = parse3(version4, options); + var valid = (version3, options) => { + const v = parse3(version3, options); return v ? v.version : null; }; module2.exports = valid; @@ -19871,8 +19871,8 @@ var require_clean = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/clean.js"(exports2, module2) { "use strict"; var parse3 = require_parse2(); - var clean2 = (version4, options) => { - const s = parse3(version4.trim().replace(/^[=v]+/, ""), options); + var clean2 = (version3, options) => { + const s = parse3(version3.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; }; module2.exports = clean2; @@ -19884,7 +19884,7 @@ var require_inc = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/inc.js"(exports2, module2) { "use strict"; var SemVer = require_semver(); - var inc = (version4, release, options, identifier, identifierBase) => { + var inc = (version3, release, options, identifier, identifierBase) => { if (typeof options === "string") { identifierBase = identifier; identifier = options; @@ -19892,7 +19892,7 @@ var require_inc = __commonJS({ } try { return new SemVer( - version4 instanceof SemVer ? version4.version : version4, + version3 instanceof SemVer ? version3.version : version3, options ).inc(release, identifier, identifierBase).version; } catch (er) { @@ -19982,8 +19982,8 @@ var require_prerelease = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/prerelease.js"(exports2, module2) { "use strict"; var parse3 = require_parse2(); - var prerelease = (version4, options) => { - const parsed = parse3(version4, options); + var prerelease = (version3, options) => { + const parsed = parse3(version3, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; }; module2.exports = prerelease; @@ -20171,24 +20171,24 @@ var require_coerce = __commonJS({ var SemVer = require_semver(); var parse3 = require_parse2(); var { safeRe: re, t } = require_re(); - var coerce = (version4, options) => { - if (version4 instanceof SemVer) { - return version4; + var coerce = (version3, options) => { + if (version3 instanceof SemVer) { + return version3; } - if (typeof version4 === "number") { - version4 = String(version4); + if (typeof version3 === "number") { + version3 = String(version3); } - if (typeof version4 !== "string") { + if (typeof version3 !== "string") { return null; } options = options || {}; let match2 = null; if (!options.rtl) { - match2 = version4.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); + match2 = version3.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); } else { const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; let next; - while ((next = coerceRtlRegex.exec(version4)) && (!match2 || match2.index + match2[0].length !== version4.length)) { + while ((next = coerceRtlRegex.exec(version3)) && (!match2 || match2.index + match2[0].length !== version3.length)) { if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) { match2 = next; } @@ -20372,19 +20372,19 @@ var require_range = __commonJS({ }); } // if ANY of the sets match ALL of its comparators, then pass - test(version4) { - if (!version4) { + test(version3) { + if (!version3) { return false; } - if (typeof version4 === "string") { + if (typeof version3 === "string") { try { - version4 = new SemVer(version4, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version4, this.options)) { + if (testSet(this.set[i], version3, this.options)) { return true; } } @@ -20599,13 +20599,13 @@ var require_range = __commonJS({ } return `${from} ${to}`.trim(); }; - var testSet = (set, version4, options) => { + var testSet = (set, version3, options) => { for (let i = 0; i < set.length; i++) { - if (!set[i].test(version4)) { + if (!set[i].test(version3)) { return false; } } - if (version4.prerelease.length && !options.includePrerelease) { + if (version3.prerelease.length && !options.includePrerelease) { for (let i = 0; i < set.length; i++) { debug2(set[i].semver); if (set[i].semver === Comparator.ANY) { @@ -20613,7 +20613,7 @@ var require_range = __commonJS({ } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver; - if (allowed.major === version4.major && allowed.minor === version4.minor && allowed.patch === version4.patch) { + if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) { return true; } } @@ -20674,19 +20674,19 @@ var require_comparator = __commonJS({ toString() { return this.value; } - test(version4) { - debug2("Comparator.test", version4, this.options.loose); - if (this.semver === ANY || version4 === ANY) { + test(version3) { + debug2("Comparator.test", version3, this.options.loose); + if (this.semver === ANY || version3 === ANY) { return true; } - if (typeof version4 === "string") { + if (typeof version3 === "string") { try { - version4 = new SemVer(version4, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } - return cmp(version4, this.operator, this.semver, this.options); + return cmp(version3, this.operator, this.semver, this.options); } intersects(comp26, options) { if (!(comp26 instanceof _Comparator)) { @@ -20743,13 +20743,13 @@ var require_satisfies = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/satisfies.js"(exports2, module2) { "use strict"; var Range = require_range(); - var satisfies = (version4, range2, options) => { + var satisfies = (version3, range2, options) => { try { range2 = new Range(range2, options); } catch (er) { return false; } - return range2.test(version4); + return range2.test(version3); }; module2.exports = satisfies; } @@ -20911,8 +20911,8 @@ var require_outside = __commonJS({ var lt = require_lt(); var lte = require_lte(); var gte2 = require_gte(); - var outside = (version4, range2, hilo, options) => { - version4 = new SemVer(version4, options); + var outside = (version3, range2, hilo, options) => { + version3 = new SemVer(version3, options); range2 = new Range(range2, options); let gtfn, ltefn, ltfn, comp26, ecomp; switch (hilo) { @@ -20933,7 +20933,7 @@ var require_outside = __commonJS({ default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (satisfies(version4, range2, options)) { + if (satisfies(version3, range2, options)) { return false; } for (let i = 0; i < range2.set.length; ++i) { @@ -20955,9 +20955,9 @@ var require_outside = __commonJS({ if (high.operator === comp26 || high.operator === ecomp) { return false; } - if ((!low.operator || low.operator === comp26) && ltefn(version4, low.semver)) { + if ((!low.operator || low.operator === comp26) && ltefn(version3, low.semver)) { return false; - } else if (low.operator === ecomp && ltfn(version4, low.semver)) { + } else if (low.operator === ecomp && ltfn(version3, low.semver)) { return false; } } @@ -20972,7 +20972,7 @@ var require_gtr = __commonJS({ "node_modules/@actions/cache/node_modules/semver/ranges/gtr.js"(exports2, module2) { "use strict"; var outside = require_outside(); - var gtr = (version4, range2, options) => outside(version4, range2, ">", options); + var gtr = (version3, range2, options) => outside(version3, range2, ">", options); module2.exports = gtr; } }); @@ -20982,7 +20982,7 @@ var require_ltr = __commonJS({ "node_modules/@actions/cache/node_modules/semver/ranges/ltr.js"(exports2, module2) { "use strict"; var outside = require_outside(); - var ltr = (version4, range2, options) => outside(version4, range2, "<", options); + var ltr = (version3, range2, options) => outside(version3, range2, "<", options); module2.exports = ltr; } }); @@ -21012,12 +21012,12 @@ var require_simplify = __commonJS({ let first = null; let prev = null; const v = versions.sort((a, b) => compare(a, b, options)); - for (const version4 of v) { - const included = satisfies(version4, range2, options); + for (const version3 of v) { + const included = satisfies(version3, range2, options); if (included) { - prev = version4; + prev = version3; if (!first) { - first = version4; + first = version3; } } else { if (prev) { @@ -21840,10 +21840,10 @@ var require_supports_color = __commonJS({ return 3; } if ("TERM_PROGRAM" in env) { - const version4 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + const version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env.TERM_PROGRAM) { case "iTerm.app": - return version4 >= 3 ? 3 : 2; + return version3 >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } @@ -27060,15 +27060,15 @@ var require_version = __commonJS({ stringify: stringify2 }; var validRegex = new RegExp("^" + VERSION_PATTERN + "$", "i"); - function valid(version4) { - return validRegex.test(version4) ? version4 : null; + function valid(version3) { + return validRegex.test(version3) ? version3 : null; } var cleanRegex = new RegExp("^\\s*" + VERSION_PATTERN + "\\s*$", "i"); - function clean2(version4) { - return stringify2(parse3(version4, cleanRegex)); + function clean2(version3) { + return stringify2(parse3(version3, cleanRegex)); } - function parse3(version4, regex) { - const { groups } = (regex || validRegex).exec(version4) || {}; + function parse3(version3, regex) { + const { groups } = (regex || validRegex).exec(version3) || {}; if (!groups) { return null; } @@ -27142,8 +27142,8 @@ var require_version = __commonJS({ } return null; } - function explain(version4) { - const parsed = parse3(version4); + function explain(version3) { + const parsed = parse3(version3); if (!parsed) { return parsed; } @@ -27194,36 +27194,36 @@ var require_operator = __commonJS({ ">": gt, "===": arbitrary }; - function lt(version4, other) { - return compare(version4, other) < 0; + function lt(version3, other) { + return compare(version3, other) < 0; } - function le(version4, other) { - return compare(version4, other) <= 0; + function le(version3, other) { + return compare(version3, other) <= 0; } - function eq(version4, other) { - return compare(version4, other) === 0; + function eq(version3, other) { + return compare(version3, other) === 0; } - function ne(version4, other) { - return compare(version4, other) !== 0; + function ne(version3, other) { + return compare(version3, other) !== 0; } - function ge(version4, other) { - return compare(version4, other) >= 0; + function ge(version3, other) { + return compare(version3, other) >= 0; } - function gt(version4, other) { - return compare(version4, other) > 0; + function gt(version3, other) { + return compare(version3, other) > 0; } - function arbitrary(version4, other) { - return version4.toLowerCase() === other.toLowerCase(); + function arbitrary(version3, other) { + return version3.toLowerCase() === other.toLowerCase(); } - function compare(version4, other) { - const parsedVersion = parse3(version4); + function compare(version3, other) { + const parsedVersion = parse3(version3); const parsedOther = parse3(other); const keyVersion = calculateKey(parsedVersion); const keyOther = calculateKey(parsedOther); return pyCompare(keyVersion, keyOther); } - function rcompare(version4, other) { - return -compare(version4, other); + function rcompare(version3, other) { + return -compare(version3, other); } function pyCompare(elemIn, otherIn) { let elem = elemIn; @@ -27317,9 +27317,9 @@ var require_specifier = __commonJS({ return null; } let { ...spec } = groups; - const { operator, version: version4, prefix: prefix2, legacy } = groups; - if (version4) { - spec = { ...spec, ...explainVersion(version4) }; + const { operator, version: version3, prefix: prefix2, legacy } = groups; + if (version3) { + spec = { ...spec, ...explainVersion(version3) }; if (operator === "~=") { if (spec.release.length < 2) { return null; @@ -27364,8 +27364,8 @@ var require_specifier = __commonJS({ if (!parsed) { return []; } - return versions.filter((version4) => { - const explained = explainVersion(version4); + return versions.filter((version3) => { + const explained = explainVersion(version3); if (!parsed.length) { return explained && !(explained.is_prerelease && !options.prereleases); } @@ -27373,12 +27373,12 @@ var require_specifier = __commonJS({ if (!pass) { return false; } - return contains({ ...spec, ...options }, { version: version4, explained }); + return contains({ ...spec, ...options }, { version: version3, explained }); }, true); }); } - function satisfies(version4, specifier, options = {}) { - const filtered = pick([version4], specifier, options); + function satisfies(version3, specifier, options = {}) { + const filtered = pick([version3], specifier, options); return filtered.length === 1; } function arrayStartsWith(array, prefix2) { @@ -27394,7 +27394,7 @@ var require_specifier = __commonJS({ } function contains(specifier, input) { const { explained } = input; - let { version: version4 } = input; + let { version: version3 } = input; const { ...spec } = specifier; if (spec.prereleases === void 0) { spec.prereleases = spec.is_prerelease; @@ -27407,7 +27407,7 @@ var require_specifier = __commonJS({ if (spec.epoch) { compatiblePrefix = spec.epoch + "!" + compatiblePrefix; } - return satisfies(version4, `>=${spec.version}, ==${compatiblePrefix}`, { + return satisfies(version3, `>=${spec.version}, ==${compatiblePrefix}`, { prereleases: spec.prereleases }); } @@ -27418,7 +27418,7 @@ var require_specifier = __commonJS({ } if (explained) { if (explained.local && spec.version) { - version4 = explained.public; + version3 = explained.public; spec.version = explainVersion(spec.version).public; } } @@ -27428,7 +27428,7 @@ var require_specifier = __commonJS({ } } const op = Operator[spec.operator]; - return op(version4, spec.version || spec.legacy); + return op(version3, spec.version || spec.legacy); } function validRange(specifier) { return Boolean(parse3(specifier)); @@ -27447,36 +27447,36 @@ var require_semantic = __commonJS({ inc }; function major(input) { - const version4 = explain(input); - if (!version4) { + const version3 = explain(input); + if (!version3) { throw new TypeError("Invalid Version: " + input); } - return version4.release[0]; + return version3.release[0]; } function minor(input) { - const version4 = explain(input); - if (!version4) { + const version3 = explain(input); + if (!version3) { throw new TypeError("Invalid Version: " + input); } - if (version4.release.length < 2) { + if (version3.release.length < 2) { return 0; } - return version4.release[1]; + return version3.release[1]; } function patch(input) { - const version4 = explain(input); - if (!version4) { + const version3 = explain(input); + if (!version3) { throw new TypeError("Invalid Version: " + input); } - if (version4.release.length < 3) { + if (version3.release.length < 3) { return 0; } - return version4.release[2]; + return version3.release[2]; } function inc(input, release, preReleaseIdentifier) { let identifier = preReleaseIdentifier || `a`; - const version4 = parse3(input); - if (!version4) { + const version3 = parse3(input); + if (!version3) { return null; } if (!["a", "b", "c", "rc", "alpha", "beta", "pre", "preview"].includes( @@ -27487,103 +27487,103 @@ var require_semantic = __commonJS({ switch (release) { case "premajor": { - const [majorVersion] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion + 1; + const [majorVersion] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion + 1; } - version4.pre = [identifier, 0]; - delete version4.post; - delete version4.dev; - delete version4.local; + version3.pre = [identifier, 0]; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "preminor": { - const [majorVersion, minorVersion = 0] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion; - version4.release[1] = minorVersion + 1; + const [majorVersion, minorVersion = 0] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion; + version3.release[1] = minorVersion + 1; } - version4.pre = [identifier, 0]; - delete version4.post; - delete version4.dev; - delete version4.local; + version3.pre = [identifier, 0]; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "prepatch": { - const [majorVersion, minorVersion = 0, patchVersion = 0] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion; - version4.release[1] = minorVersion; - version4.release[2] = patchVersion + 1; + const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion; + version3.release[1] = minorVersion; + version3.release[2] = patchVersion + 1; } - version4.pre = [identifier, 0]; - delete version4.post; - delete version4.dev; - delete version4.local; + version3.pre = [identifier, 0]; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "prerelease": - if (version4.pre === null) { - const [majorVersion, minorVersion = 0, patchVersion = 0] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion; - version4.release[1] = minorVersion; - version4.release[2] = patchVersion + 1; - version4.pre = [identifier, 0]; + if (version3.pre === null) { + const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion; + version3.release[1] = minorVersion; + version3.release[2] = patchVersion + 1; + version3.pre = [identifier, 0]; } else { - if (preReleaseIdentifier === void 0 && version4.pre !== null) { - [identifier] = version4.pre; + if (preReleaseIdentifier === void 0 && version3.pre !== null) { + [identifier] = version3.pre; } - const [letter, number] = version4.pre; + const [letter, number] = version3.pre; if (letter === identifier) { - version4.pre = [letter, number + 1]; + version3.pre = [letter, number + 1]; } else { - version4.pre = [identifier, 0]; + version3.pre = [identifier, 0]; } } - delete version4.post; - delete version4.dev; - delete version4.local; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "major": - if (version4.release.slice(1).some((value) => value !== 0) || version4.pre === null) { - const [majorVersion] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion + 1; + if (version3.release.slice(1).some((value) => value !== 0) || version3.pre === null) { + const [majorVersion] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion + 1; } - delete version4.pre; - delete version4.post; - delete version4.dev; - delete version4.local; + delete version3.pre; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "minor": - if (version4.release.slice(2).some((value) => value !== 0) || version4.pre === null) { - const [majorVersion, minorVersion = 0] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion; - version4.release[1] = minorVersion + 1; + if (version3.release.slice(2).some((value) => value !== 0) || version3.pre === null) { + const [majorVersion, minorVersion = 0] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion; + version3.release[1] = minorVersion + 1; } - delete version4.pre; - delete version4.post; - delete version4.dev; - delete version4.local; + delete version3.pre; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "patch": - if (version4.release.slice(3).some((value) => value !== 0) || version4.pre === null) { - const [majorVersion, minorVersion = 0, patchVersion = 0] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion; - version4.release[1] = minorVersion; - version4.release[2] = patchVersion + 1; + if (version3.release.slice(3).some((value) => value !== 0) || version3.pre === null) { + const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion; + version3.release[1] = minorVersion; + version3.release[2] = patchVersion + 1; } - delete version4.pre; - delete version4.post; - delete version4.dev; - delete version4.local; + delete version3.pre; + delete version3.post; + delete version3.dev; + delete version3.local; break; default: return null; } - return stringify2(version4); + return stringify2(version3); } } }); @@ -30412,8 +30412,8 @@ function getVersion(app_1) { function getCompressionMethod() { return __awaiter10(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version4 = semver.clean(versionOutput); - debug(`zstd version: ${version4}`); + const version3 = semver.clean(versionOutput); + debug(`zstd version: ${version3}`); if (versionOutput === "") { return CompressionMethod.Gzip; } else { @@ -54754,8 +54754,8 @@ var SASQueryParameters = class { } return void 0; } - constructor(version4, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2, delegatedUserObjectId) { - this.version = version4; + constructor(version3, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2, delegatedUserObjectId) { + this.version = version3; this.signature = signature; if (permissionsOrOptions !== void 0 && typeof permissionsOrOptions !== "string") { this.permissions = permissionsOrOptions.permissions; @@ -54962,7 +54962,7 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; } function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version4 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; + const version3 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; let userDelegationKeyCredential; if (sharedKeyCredential === void 0 && accountName !== void 0) { @@ -54971,29 +54971,29 @@ function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKe if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } - if (version4 >= "2020-12-06") { + if (version3 >= "2020-12-06") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); } else { - if (version4 >= "2025-07-05") { + if (version3 >= "2025-07-05") { return generateBlobSASQueryParametersUDK20250705(blobSASSignatureValues, userDelegationKeyCredential); } else { return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); } } } - if (version4 >= "2018-11-09") { + if (version3 >= "2018-11-09") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); } else { - if (version4 >= "2020-02-10") { + if (version3 >= "2020-02-10") { return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); } else { return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); } } } - if (version4 >= "2015-04-05") { + if (version3 >= "2015-04-05") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential); } else { @@ -55368,44 +55368,44 @@ function getCanonicalName(accountName, containerName, blobName) { return elements.join(""); } function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version4 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version4 < "2018-11-09") { + const version3 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; + if (blobSASSignatureValues.snapshotTime && version3 < "2018-11-09") { throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); } if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - if (blobSASSignatureValues.versionId && version4 < "2019-10-10") { + if (blobSASSignatureValues.versionId && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version4 < "2020-08-04") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version3 < "2020-08-04") { throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version4 < "2019-10-10") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version4 < "2019-10-10") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version4 < "2019-12-12") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version3 < "2019-12-12") { throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - if (version4 < "2020-02-10" && blobSASSignatureValues.permissions && (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { + if (version3 < "2020-02-10" && blobSASSignatureValues.permissions && (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission."); } - if (version4 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + if (version3 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - if (version4 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { + if (version3 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); } - if (blobSASSignatureValues.encryptionScope && version4 < "2020-12-06") { + if (blobSASSignatureValues.encryptionScope && version3 < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - blobSASSignatureValues.version = version4; + blobSASSignatureValues.version = version3; return blobSASSignatureValues; } @@ -60801,14 +60801,14 @@ function getCacheServiceVersion() { return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } function getCacheServiceURL() { - const version4 = getCacheServiceVersion(); - switch (version4) { + const version3 = getCacheServiceVersion(); + switch (version3) { case "v1": return process.env["ACTIONS_CACHE_URL"] || process.env["ACTIONS_RESULTS_URL"] || ""; case "v2": return process.env["ACTIONS_RESULTS_URL"] || ""; default: - throw new Error(`Unsupported cache service version: ${version4}`); + throw new Error(`Unsupported cache service version: ${version3}`); } } @@ -60874,10 +60874,10 @@ function createHttpClient() { function reserveCache(key, paths, options) { return __awaiter13(this, void 0, void 0, function* () { const httpClient = createHttpClient(); - const version4 = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); + const version3 = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); const reserveCacheRequest = { key, - version: version4, + version: version3, cacheSize: options === null || options === void 0 ? void 0 : options.cacheSize }; const response = yield retryTypedResponse("reserveCache", () => __awaiter13(this, void 0, void 0, function* () { @@ -61887,14 +61887,14 @@ function getTarArgs(tarPath_1, compressionMethod_1, type_1) { const args = [`"${tarPath.path}"`]; const cacheFileName = getCacheFileName(compressionMethod); const tarFile = "cache.tar"; - const workingDirectory2 = getWorkingDirectory(); + const workingDirectory = getWorkingDirectory(); const BSD_TAR_ZSTD = tarPath.type === ArchiveToolType.BSD && compressionMethod !== CompressionMethod.Gzip && IS_WINDOWS8; switch (type) { case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path9.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path9.sep}`, "g"), "/"), "-P", "-C", workingDirectory2.replace(new RegExp(`\\${path9.sep}`, "g"), "/"), "--files-from", ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path9.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path9.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path9.sep}`, "g"), "/"), "--files-from", ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path9.sep}`, "g"), "/"), "-P", "-C", workingDirectory2.replace(new RegExp(`\\${path9.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path9.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path9.sep}`, "g"), "/")); break; case "list": args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path9.sep}`, "g"), "/"), "-P"); @@ -62177,10 +62177,10 @@ function saveCacheV2(paths_1, key_1, options_1) { debug(`File Size: ${archiveFileSize}`); options.archiveSizeBytes = archiveFileSize; debug("Reserving Cache"); - const version4 = getCacheVersion(paths, compressionMethod, enableCrossOsArchive); + const version3 = getCacheVersion(paths, compressionMethod, enableCrossOsArchive); const request = { key, - version: version4 + version: version3 }; let signedUploadUrl; try { @@ -62200,7 +62200,7 @@ function saveCacheV2(paths_1, key_1, options_1) { yield saveCache(cacheId, archivePath, signedUploadUrl, options); const finalizeRequest = { key, - version: version4, + version: version3, sizeBytes: `${archiveFileSize}` }; const finalizeResponse = yield twirpClient.FinalizeCacheEntryUpload(finalizeRequest); @@ -62241,6 +62241,15 @@ function saveCacheV2(paths_1, key_1, options_1) { // src/save-cache.ts var pep440 = __toESM(require_pep440(), 1); +// src/cache/restore-cache.ts +var STATE_CACHE_KEY = "cache-key"; +var STATE_CACHE_MATCHED_KEY = "cache-matched-key"; +var STATE_PYTHON_CACHE_MATCHED_KEY = "python-cache-matched-key"; + +// src/utils/constants.ts +var STATE_UV_PATH = "uv-path"; +var STATE_UV_VERSION = "uv-version"; + // src/utils/inputs.ts var import_node_path = __toESM(require("node:path"), 1); @@ -62947,61 +62956,104 @@ function getConfigValueFromTomlFile(filePath, key) { } // src/utils/inputs.ts -var workingDirectory = getInput("working-directory"); -var version3 = getInput("version"); -var versionFile = getVersionFile(); -var pythonVersion = getInput("python-version"); -var activateEnvironment = getBooleanInput("activate-environment"); -var venvPath = getVenvPath(); -var checkSum = getInput("checksum"); -var enableCache = getEnableCache(); -var restoreCache = getInput("restore-cache") === "true"; -var saveCache3 = getInput("save-cache") === "true"; -var cacheSuffix = getInput("cache-suffix") || ""; -var cacheLocalPath = getCacheLocalPath(); -var cacheDependencyGlob = getCacheDependencyGlob(); -var pruneCache = getInput("prune-cache") === "true"; -var cachePython = getInput("cache-python") === "true"; -var ignoreNothingToCache = getInput("ignore-nothing-to-cache") === "true"; -var ignoreEmptyWorkdir = getInput("ignore-empty-workdir") === "true"; -var toolBinDir = getToolBinDir(); -var toolDir = getToolDir(); -var pythonDir = getUvPythonDir(); -var githubToken = getInput("github-token"); -var manifestFile = getManifestFile(); -var addProblemMatchers = getInput("add-problem-matchers") === "true"; -var resolutionStrategy = getResolutionStrategy(); -function getVersionFile() { - const versionFileInput = getInput("version-file"); +function loadInputs() { + const workingDirectory = getInput("working-directory"); + const version3 = getInput("version"); + const versionFile = getVersionFile( + workingDirectory, + getInput("version-file") + ); + const pythonVersion = getInput("python-version"); + const activateEnvironment = getBooleanInput("activate-environment"); + const venvPath = getVenvPath( + workingDirectory, + getInput("venv-path"), + activateEnvironment + ); + const checksum = getInput("checksum"); + const enableCache = getEnableCache(getInput("enable-cache")); + const restoreCache2 = getInput("restore-cache") === "true"; + const saveCache4 = getInput("save-cache") === "true"; + const cacheSuffix = getInput("cache-suffix") || ""; + const cacheLocalPath = getCacheLocalPath( + workingDirectory, + versionFile, + enableCache + ); + const cacheDependencyGlob = getCacheDependencyGlob( + workingDirectory, + getInput("cache-dependency-glob") + ); + const pruneCache2 = getInput("prune-cache") === "true"; + const cachePython = getInput("cache-python") === "true"; + const ignoreNothingToCache = getInput("ignore-nothing-to-cache") === "true"; + const ignoreEmptyWorkdir = getInput("ignore-empty-workdir") === "true"; + const toolBinDir = getToolBinDir( + workingDirectory, + getInput("tool-bin-dir") + ); + const toolDir = getToolDir(workingDirectory, getInput("tool-dir")); + const pythonDir = getUvPythonDir(); + const githubToken = getInput("github-token"); + const manifestFile = getManifestFile(getInput("manifest-file")); + const addProblemMatchers = getInput("add-problem-matchers") === "true"; + const resolutionStrategy = getResolutionStrategy( + getInput("resolution-strategy") + ); + return { + activateEnvironment, + addProblemMatchers, + cacheDependencyGlob, + cacheLocalPath, + cachePython, + cacheSuffix, + checksum, + enableCache, + githubToken, + ignoreEmptyWorkdir, + ignoreNothingToCache, + manifestFile, + pruneCache: pruneCache2, + pythonDir, + pythonVersion, + resolutionStrategy, + restoreCache: restoreCache2, + saveCache: saveCache4, + toolBinDir, + toolDir, + venvPath, + version: version3, + versionFile, + workingDirectory + }; +} +function getVersionFile(workingDirectory, versionFileInput) { if (versionFileInput !== "") { const tildeExpanded = expandTilde(versionFileInput); - return resolveRelativePath(tildeExpanded); + return resolveRelativePath(workingDirectory, tildeExpanded); } return versionFileInput; } -function getVenvPath() { - const venvPathInput = getInput("venv-path"); +function getVenvPath(workingDirectory, venvPathInput, activateEnvironment) { if (venvPathInput !== "") { if (!activateEnvironment) { warning("venv-path is only used when activate-environment is true"); } const tildeExpanded = expandTilde(venvPathInput); - return normalizePath(resolveRelativePath(tildeExpanded)); + return normalizePath(resolveRelativePath(workingDirectory, tildeExpanded)); } - return normalizePath(resolveRelativePath(".venv")); + return normalizePath(resolveRelativePath(workingDirectory, ".venv")); } -function getEnableCache() { - const enableCacheInput = getInput("enable-cache"); +function getEnableCache(enableCacheInput) { if (enableCacheInput === "auto") { return process.env.RUNNER_ENVIRONMENT === "github-hosted"; } return enableCacheInput === "true"; } -function getToolBinDir() { - const toolBinDirInput = getInput("tool-bin-dir"); +function getToolBinDir(workingDirectory, toolBinDirInput) { if (toolBinDirInput !== "") { const tildeExpanded = expandTilde(toolBinDirInput); - return resolveRelativePath(tildeExpanded); + return resolveRelativePath(workingDirectory, tildeExpanded); } if (process.platform === "win32") { if (process.env.RUNNER_TEMP !== void 0) { @@ -63013,11 +63065,10 @@ function getToolBinDir() { } return void 0; } -function getToolDir() { - const toolDirInput = getInput("tool-dir"); +function getToolDir(workingDirectory, toolDirInput) { if (toolDirInput !== "") { const tildeExpanded = expandTilde(toolDirInput); - return resolveRelativePath(tildeExpanded); + return resolveRelativePath(workingDirectory, tildeExpanded); } if (process.platform === "win32") { if (process.env.RUNNER_TEMP !== void 0) { @@ -63029,16 +63080,19 @@ function getToolDir() { } return void 0; } -function getCacheLocalPath() { +function getCacheLocalPath(workingDirectory, versionFile, enableCache) { const cacheLocalPathInput = getInput("cache-local-path"); if (cacheLocalPathInput !== "") { const tildeExpanded = expandTilde(cacheLocalPathInput); return { - path: resolveRelativePath(tildeExpanded), + path: resolveRelativePath(workingDirectory, tildeExpanded), source: 0 /* Input */ }; } - const cacheDirFromConfig = getCacheDirFromConfig(); + const cacheDirFromConfig = getCacheDirFromConfig( + workingDirectory, + versionFile + ); if (cacheDirFromConfig !== void 0) { return { path: cacheDirFromConfig, source: 1 /* Config */ }; } @@ -63046,7 +63100,7 @@ function getCacheLocalPath() { info(`UV_CACHE_DIR is already set to ${process.env.UV_CACHE_DIR}`); return { path: process.env.UV_CACHE_DIR, source: 2 /* Env */ }; } - if (getEnableCache()) { + if (enableCache) { if (process.env.RUNNER_ENVIRONMENT === "github-hosted") { if (process.env.RUNNER_TEMP !== void 0) { return { @@ -63070,9 +63124,9 @@ function getCacheLocalPath() { }; } } -function getCacheDirFromConfig() { +function getCacheDirFromConfig(workingDirectory, versionFile) { for (const filePath of [versionFile, "uv.toml", "pyproject.toml"]) { - const resolvedPath = resolveRelativePath(filePath); + const resolvedPath = resolveRelativePath(workingDirectory, filePath); try { const cacheDir = getConfigValueFromTomlFile(resolvedPath, "cache-dir"); if (cacheDir !== void 0) { @@ -63097,9 +63151,8 @@ function getUvPythonDir() { if (process.env.RUNNER_ENVIRONMENT !== "github-hosted") { if (process.platform === "win32") { return `${process.env.APPDATA}${import_node_path.default.sep}uv${import_node_path.default.sep}python`; - } else { - return `${process.env.HOME}${import_node_path.default.sep}.local${import_node_path.default.sep}share${import_node_path.default.sep}uv${import_node_path.default.sep}python`; } + return `${process.env.HOME}${import_node_path.default.sep}.local${import_node_path.default.sep}share${import_node_path.default.sep}uv${import_node_path.default.sep}python`; } if (process.env.RUNNER_TEMP !== void 0) { return `${process.env.RUNNER_TEMP}${import_node_path.default.sep}uv-python-dir`; @@ -63108,10 +63161,9 @@ function getUvPythonDir() { "Could not determine UV_PYTHON_INSTALL_DIR. Please make sure RUNNER_TEMP is set or provide the UV_PYTHON_INSTALL_DIR environment variable" ); } -function getCacheDependencyGlob() { - const cacheDependencyGlobInput = getInput("cache-dependency-glob"); +function getCacheDependencyGlob(workingDirectory, cacheDependencyGlobInput) { if (cacheDependencyGlobInput !== "") { - return cacheDependencyGlobInput.split("\n").map((part) => part.trim()).map((part) => expandTilde(part)).map((part) => resolveRelativePath(part)).join("\n"); + return cacheDependencyGlobInput.split("\n").map((part) => part.trim()).map((part) => expandTilde(part)).map((part) => resolveRelativePath(workingDirectory, part)).join("\n"); } return cacheDependencyGlobInput; } @@ -63130,7 +63182,7 @@ function normalizePath(inputPath) { } return trimmed; } -function resolveRelativePath(inputPath) { +function resolveRelativePath(workingDirectory, inputPath) { const hasNegation = inputPath.startsWith("!"); const pathWithoutNegation = hasNegation ? inputPath.substring(1) : inputPath; const resolvedPath = import_node_path.default.resolve(workingDirectory, pathWithoutNegation); @@ -63139,15 +63191,13 @@ function resolveRelativePath(inputPath) { ); return hasNegation ? `!${resolvedPath}` : resolvedPath; } -function getManifestFile() { - const manifestFileInput = getInput("manifest-file"); +function getManifestFile(manifestFileInput) { if (manifestFileInput !== "") { return manifestFileInput; } return void 0; } -function getResolutionStrategy() { - const resolutionStrategyInput = getInput("resolution-strategy"); +function getResolutionStrategy(resolutionStrategyInput) { if (resolutionStrategyInput === "lowest") { return "lowest"; } @@ -63159,21 +63209,13 @@ function getResolutionStrategy() { ); } -// src/cache/restore-cache.ts -var STATE_CACHE_KEY = "cache-key"; -var STATE_CACHE_MATCHED_KEY = "cache-matched-key"; -var STATE_PYTHON_CACHE_MATCHED_KEY = "python-cache-matched-key"; - -// src/utils/constants.ts -var STATE_UV_PATH = "uv-path"; -var STATE_UV_VERSION = "uv-version"; - // src/save-cache.ts async function run() { try { - if (enableCache) { - if (saveCache3) { - await saveCache4(); + const inputs = loadInputs(); + if (inputs.enableCache) { + if (inputs.saveCache) { + await saveCache3(inputs); } else { info("save-cache is false. Skipping save cache step."); } @@ -63185,7 +63227,7 @@ async function run() { setFailed(err.message); } } -async function saveCache4() { +async function saveCache3(inputs) { const cacheKey = getState(STATE_CACHE_KEY); const matchedKey = getState(STATE_CACHE_MATCHED_KEY); if (!cacheKey) { @@ -63195,12 +63237,12 @@ async function saveCache4() { if (matchedKey === cacheKey) { info(`Cache hit occurred on key ${cacheKey}, not saving cache.`); } else { - if (pruneCache) { - await pruneCache2(); + if (inputs.pruneCache) { + await pruneCache(); } - const actualCachePath = getUvCachePath(); + const actualCachePath = getUvCachePath(inputs); if (!fs7.existsSync(actualCachePath)) { - if (ignoreNothingToCache) { + if (inputs.ignoreNothingToCache) { info( "No cacheable uv cache paths were found. Ignoring because ignore-nothing-to-cache is enabled." ); @@ -63218,23 +63260,23 @@ async function saveCache4() { ); } } - if (cachePython) { - if (!fs7.existsSync(pythonDir)) { + if (inputs.cachePython) { + if (!fs7.existsSync(inputs.pythonDir)) { warning( - `Python cache path ${pythonDir} does not exist on disk. Skipping Python cache save because no managed Python installation was found. If you want uv to install managed Python instead of using a system interpreter, set UV_PYTHON_PREFERENCE=only-managed.` + `Python cache path ${inputs.pythonDir} does not exist on disk. Skipping Python cache save because no managed Python installation was found. If you want uv to install managed Python instead of using a system interpreter, set UV_PYTHON_PREFERENCE=only-managed.` ); return; } const pythonCacheKey = `${cacheKey}-python`; await saveCacheToKey( pythonCacheKey, - pythonDir, + inputs.pythonDir, STATE_PYTHON_CACHE_MATCHED_KEY, "Python cache" ); } } -async function pruneCache2() { +async function pruneCache() { const forceSupported = pep440.gte(getState(STATE_UV_VERSION), "0.8.24"); const options = { silent: false @@ -63247,19 +63289,19 @@ async function pruneCache2() { const uvPath = getState(STATE_UV_PATH); await exec(uvPath, execArgs, options); } -function getUvCachePath() { - if (cacheLocalPath === void 0) { +function getUvCachePath(inputs) { + if (inputs.cacheLocalPath === void 0) { throw new Error( "cache-local-path is not set. Cannot save cache without a valid cache path." ); } - if (process.env.UV_CACHE_DIR && process.env.UV_CACHE_DIR !== cacheLocalPath.path) { + if (process.env.UV_CACHE_DIR && process.env.UV_CACHE_DIR !== inputs.cacheLocalPath.path) { warning( - `The environment variable UV_CACHE_DIR has been changed to "${process.env.UV_CACHE_DIR}", by an action or step running after astral-sh/setup-uv. This can lead to unexpected behavior. If you expected this to happen set the cache-local-path input to "${process.env.UV_CACHE_DIR}" instead of "${cacheLocalPath.path}".` + `The environment variable UV_CACHE_DIR has been changed to "${process.env.UV_CACHE_DIR}", by an action or step running after astral-sh/setup-uv. This can lead to unexpected behavior. If you expected this to happen set the cache-local-path input to "${process.env.UV_CACHE_DIR}" instead of "${inputs.cacheLocalPath.path}".` ); return process.env.UV_CACHE_DIR; } - return cacheLocalPath.path; + return inputs.cacheLocalPath.path; } async function saveCacheToKey(cacheKey, cachePath, stateKey, cacheName) { const matchedKey = getState(stateKey); diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index f87e0b7..fad1f29 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -1491,36 +1491,36 @@ var require_diagnostics = __commonJS({ const debuglog = fetchDebuglog.enabled ? fetchDebuglog : undiciDebugLog; diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debuglog( "connecting to %s using %s%s", `${host}${port ? `:${port}` : ""}`, protocol, - version4 + version3 ); }); diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debuglog( "connected to %s using %s%s", `${host}${port ? `:${port}` : ""}`, protocol, - version4 + version3 ); }); diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host }, + connectParams: { version: version3, protocol, port, host }, error: error2 } = evt; debuglog( "connection to %s using %s%s errored - %s", `${host}${port ? `:${port}` : ""}`, protocol, - version4, + version3, error2.message ); }); @@ -1569,31 +1569,31 @@ var require_diagnostics = __commonJS({ const debuglog = undiciDebugLog.enabled ? undiciDebugLog : websocketDebuglog; diagnosticsChannel.channel("undici:client:beforeConnect").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debuglog( "connecting to %s%s using %s%s", host, port ? `:${port}` : "", protocol, - version4 + version3 ); }); diagnosticsChannel.channel("undici:client:connected").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debuglog( "connected to %s%s using %s%s", host, port ? `:${port}` : "", protocol, - version4 + version3 ); }); diagnosticsChannel.channel("undici:client:connectError").subscribe((evt) => { const { - connectParams: { version: version4, protocol, port, host }, + connectParams: { version: version3, protocol, port, host }, error: error2 } = evt; debuglog( @@ -1601,7 +1601,7 @@ var require_diagnostics = __commonJS({ host, port ? `:${port}` : "", protocol, - version4, + version3, error2.message ); }); @@ -19561,31 +19561,31 @@ var require_semver = __commonJS({ var parseOptions = require_parse_options(); var { compareIdentifiers } = require_identifiers(); var SemVer = class _SemVer { - constructor(version4, options) { + constructor(version3, options) { options = parseOptions(options); - if (version4 instanceof _SemVer) { - if (version4.loose === !!options.loose && version4.includePrerelease === !!options.includePrerelease) { - return version4; + if (version3 instanceof _SemVer) { + if (version3.loose === !!options.loose && version3.includePrerelease === !!options.includePrerelease) { + return version3; } else { - version4 = version4.version; + version3 = version3.version; } - } else if (typeof version4 !== "string") { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version4}".`); + } else if (typeof version3 !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version3}".`); } - if (version4.length > MAX_LENGTH) { + if (version3.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ); } - debug2("SemVer", version4, options); + debug2("SemVer", version3, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; - const m = version4.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); + const m = version3.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); if (!m) { - throw new TypeError(`Invalid Version: ${version4}`); + throw new TypeError(`Invalid Version: ${version3}`); } - this.raw = version4; + this.raw = version3; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; @@ -19835,12 +19835,12 @@ var require_parse2 = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/parse.js"(exports2, module2) { "use strict"; var SemVer = require_semver(); - var parse3 = (version4, options, throwErrors = false) => { - if (version4 instanceof SemVer) { - return version4; + var parse3 = (version3, options, throwErrors = false) => { + if (version3 instanceof SemVer) { + return version3; } try { - return new SemVer(version4, options); + return new SemVer(version3, options); } catch (er) { if (!throwErrors) { return null; @@ -19857,8 +19857,8 @@ var require_valid = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/valid.js"(exports2, module2) { "use strict"; var parse3 = require_parse2(); - var valid2 = (version4, options) => { - const v = parse3(version4, options); + var valid2 = (version3, options) => { + const v = parse3(version3, options); return v ? v.version : null; }; module2.exports = valid2; @@ -19870,8 +19870,8 @@ var require_clean = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/clean.js"(exports2, module2) { "use strict"; var parse3 = require_parse2(); - var clean3 = (version4, options) => { - const s = parse3(version4.trim().replace(/^[=v]+/, ""), options); + var clean3 = (version3, options) => { + const s = parse3(version3.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; }; module2.exports = clean3; @@ -19883,7 +19883,7 @@ var require_inc = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/inc.js"(exports2, module2) { "use strict"; var SemVer = require_semver(); - var inc = (version4, release, options, identifier, identifierBase) => { + var inc = (version3, release, options, identifier, identifierBase) => { if (typeof options === "string") { identifierBase = identifier; identifier = options; @@ -19891,7 +19891,7 @@ var require_inc = __commonJS({ } try { return new SemVer( - version4 instanceof SemVer ? version4.version : version4, + version3 instanceof SemVer ? version3.version : version3, options ).inc(release, identifier, identifierBase).version; } catch (er) { @@ -19981,8 +19981,8 @@ var require_prerelease = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/prerelease.js"(exports2, module2) { "use strict"; var parse3 = require_parse2(); - var prerelease = (version4, options) => { - const parsed = parse3(version4, options); + var prerelease = (version3, options) => { + const parsed = parse3(version3, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; }; module2.exports = prerelease; @@ -20170,24 +20170,24 @@ var require_coerce = __commonJS({ var SemVer = require_semver(); var parse3 = require_parse2(); var { safeRe: re, t } = require_re(); - var coerce = (version4, options) => { - if (version4 instanceof SemVer) { - return version4; + var coerce = (version3, options) => { + if (version3 instanceof SemVer) { + return version3; } - if (typeof version4 === "number") { - version4 = String(version4); + if (typeof version3 === "number") { + version3 = String(version3); } - if (typeof version4 !== "string") { + if (typeof version3 !== "string") { return null; } options = options || {}; let match2 = null; if (!options.rtl) { - match2 = version4.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); + match2 = version3.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); } else { const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; let next; - while ((next = coerceRtlRegex.exec(version4)) && (!match2 || match2.index + match2[0].length !== version4.length)) { + while ((next = coerceRtlRegex.exec(version3)) && (!match2 || match2.index + match2[0].length !== version3.length)) { if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) { match2 = next; } @@ -20371,19 +20371,19 @@ var require_range = __commonJS({ }); } // if ANY of the sets match ALL of its comparators, then pass - test(version4) { - if (!version4) { + test(version3) { + if (!version3) { return false; } - if (typeof version4 === "string") { + if (typeof version3 === "string") { try { - version4 = new SemVer(version4, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version4, this.options)) { + if (testSet(this.set[i], version3, this.options)) { return true; } } @@ -20598,13 +20598,13 @@ var require_range = __commonJS({ } return `${from} ${to}`.trim(); }; - var testSet = (set, version4, options) => { + var testSet = (set, version3, options) => { for (let i = 0; i < set.length; i++) { - if (!set[i].test(version4)) { + if (!set[i].test(version3)) { return false; } } - if (version4.prerelease.length && !options.includePrerelease) { + if (version3.prerelease.length && !options.includePrerelease) { for (let i = 0; i < set.length; i++) { debug2(set[i].semver); if (set[i].semver === Comparator.ANY) { @@ -20612,7 +20612,7 @@ var require_range = __commonJS({ } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver; - if (allowed.major === version4.major && allowed.minor === version4.minor && allowed.patch === version4.patch) { + if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) { return true; } } @@ -20673,19 +20673,19 @@ var require_comparator = __commonJS({ toString() { return this.value; } - test(version4) { - debug2("Comparator.test", version4, this.options.loose); - if (this.semver === ANY || version4 === ANY) { + test(version3) { + debug2("Comparator.test", version3, this.options.loose); + if (this.semver === ANY || version3 === ANY) { return true; } - if (typeof version4 === "string") { + if (typeof version3 === "string") { try { - version4 = new SemVer(version4, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } - return cmp(version4, this.operator, this.semver, this.options); + return cmp(version3, this.operator, this.semver, this.options); } intersects(comp26, options) { if (!(comp26 instanceof _Comparator)) { @@ -20742,13 +20742,13 @@ var require_satisfies = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/satisfies.js"(exports2, module2) { "use strict"; var Range = require_range(); - var satisfies4 = (version4, range2, options) => { + var satisfies4 = (version3, range2, options) => { try { range2 = new Range(range2, options); } catch (er) { return false; } - return range2.test(version4); + return range2.test(version3); }; module2.exports = satisfies4; } @@ -20910,8 +20910,8 @@ var require_outside = __commonJS({ var lt = require_lt(); var lte = require_lte(); var gte = require_gte(); - var outside = (version4, range2, hilo, options) => { - version4 = new SemVer(version4, options); + var outside = (version3, range2, hilo, options) => { + version3 = new SemVer(version3, options); range2 = new Range(range2, options); let gtfn, ltefn, ltfn, comp26, ecomp; switch (hilo) { @@ -20932,7 +20932,7 @@ var require_outside = __commonJS({ default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (satisfies4(version4, range2, options)) { + if (satisfies4(version3, range2, options)) { return false; } for (let i = 0; i < range2.set.length; ++i) { @@ -20954,9 +20954,9 @@ var require_outside = __commonJS({ if (high.operator === comp26 || high.operator === ecomp) { return false; } - if ((!low.operator || low.operator === comp26) && ltefn(version4, low.semver)) { + if ((!low.operator || low.operator === comp26) && ltefn(version3, low.semver)) { return false; - } else if (low.operator === ecomp && ltfn(version4, low.semver)) { + } else if (low.operator === ecomp && ltfn(version3, low.semver)) { return false; } } @@ -20971,7 +20971,7 @@ var require_gtr = __commonJS({ "node_modules/@actions/cache/node_modules/semver/ranges/gtr.js"(exports2, module2) { "use strict"; var outside = require_outside(); - var gtr = (version4, range2, options) => outside(version4, range2, ">", options); + var gtr = (version3, range2, options) => outside(version3, range2, ">", options); module2.exports = gtr; } }); @@ -20981,7 +20981,7 @@ var require_ltr = __commonJS({ "node_modules/@actions/cache/node_modules/semver/ranges/ltr.js"(exports2, module2) { "use strict"; var outside = require_outside(); - var ltr = (version4, range2, options) => outside(version4, range2, "<", options); + var ltr = (version3, range2, options) => outside(version3, range2, "<", options); module2.exports = ltr; } }); @@ -21011,12 +21011,12 @@ var require_simplify = __commonJS({ let first = null; let prev = null; const v = versions.sort((a, b) => compare(a, b, options)); - for (const version4 of v) { - const included = satisfies4(version4, range2, options); + for (const version3 of v) { + const included = satisfies4(version3, range2, options); if (included) { - prev = version4; + prev = version3; if (!first) { - first = version4; + first = version3; } } else { if (prev) { @@ -21839,10 +21839,10 @@ var require_supports_color = __commonJS({ return 3; } if ("TERM_PROGRAM" in env) { - const version4 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); + const version3 = parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10); switch (env.TERM_PROGRAM) { case "iTerm.app": - return version4 >= 3 ? 3 : 2; + return version3 >= 3 ? 3 : 2; case "Apple_Terminal": return 2; } @@ -27171,31 +27171,31 @@ var require_semver3 = __commonJS({ var parseOptions = require_parse_options2(); var { compareIdentifiers } = require_identifiers2(); var SemVer = class _SemVer { - constructor(version4, options) { + constructor(version3, options) { options = parseOptions(options); - if (version4 instanceof _SemVer) { - if (version4.loose === !!options.loose && version4.includePrerelease === !!options.includePrerelease) { - return version4; + if (version3 instanceof _SemVer) { + if (version3.loose === !!options.loose && version3.includePrerelease === !!options.includePrerelease) { + return version3; } else { - version4 = version4.version; + version3 = version3.version; } - } else if (typeof version4 !== "string") { - throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version4}".`); + } else if (typeof version3 !== "string") { + throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version3}".`); } - if (version4.length > MAX_LENGTH) { + if (version3.length > MAX_LENGTH) { throw new TypeError( `version is longer than ${MAX_LENGTH} characters` ); } - debug2("SemVer", version4, options); + debug2("SemVer", version3, options); this.options = options; this.loose = !!options.loose; this.includePrerelease = !!options.includePrerelease; - const m = version4.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); + const m = version3.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL]); if (!m) { - throw new TypeError(`Invalid Version: ${version4}`); + throw new TypeError(`Invalid Version: ${version3}`); } - this.raw = version4; + this.raw = version3; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; @@ -27445,12 +27445,12 @@ var require_parse3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/semver/functions/parse.js"(exports2, module2) { "use strict"; var SemVer = require_semver3(); - var parse3 = (version4, options, throwErrors = false) => { - if (version4 instanceof SemVer) { - return version4; + var parse3 = (version3, options, throwErrors = false) => { + if (version3 instanceof SemVer) { + return version3; } try { - return new SemVer(version4, options); + return new SemVer(version3, options); } catch (er) { if (!throwErrors) { return null; @@ -27467,8 +27467,8 @@ var require_valid3 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/semver/functions/valid.js"(exports2, module2) { "use strict"; var parse3 = require_parse3(); - var valid2 = (version4, options) => { - const v = parse3(version4, options); + var valid2 = (version3, options) => { + const v = parse3(version3, options); return v ? v.version : null; }; module2.exports = valid2; @@ -27480,8 +27480,8 @@ var require_clean2 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/semver/functions/clean.js"(exports2, module2) { "use strict"; var parse3 = require_parse3(); - var clean3 = (version4, options) => { - const s = parse3(version4.trim().replace(/^[=v]+/, ""), options); + var clean3 = (version3, options) => { + const s = parse3(version3.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; }; module2.exports = clean3; @@ -27493,7 +27493,7 @@ var require_inc2 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/semver/functions/inc.js"(exports2, module2) { "use strict"; var SemVer = require_semver3(); - var inc = (version4, release, options, identifier, identifierBase) => { + var inc = (version3, release, options, identifier, identifierBase) => { if (typeof options === "string") { identifierBase = identifier; identifier = options; @@ -27501,7 +27501,7 @@ var require_inc2 = __commonJS({ } try { return new SemVer( - version4 instanceof SemVer ? version4.version : version4, + version3 instanceof SemVer ? version3.version : version3, options ).inc(release, identifier, identifierBase).version; } catch (er) { @@ -27591,8 +27591,8 @@ var require_prerelease2 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/semver/functions/prerelease.js"(exports2, module2) { "use strict"; var parse3 = require_parse3(); - var prerelease = (version4, options) => { - const parsed = parse3(version4, options); + var prerelease = (version3, options) => { + const parsed = parse3(version3, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; }; module2.exports = prerelease; @@ -27780,24 +27780,24 @@ var require_coerce2 = __commonJS({ var SemVer = require_semver3(); var parse3 = require_parse3(); var { safeRe: re, t } = require_re2(); - var coerce = (version4, options) => { - if (version4 instanceof SemVer) { - return version4; + var coerce = (version3, options) => { + if (version3 instanceof SemVer) { + return version3; } - if (typeof version4 === "number") { - version4 = String(version4); + if (typeof version3 === "number") { + version3 = String(version3); } - if (typeof version4 !== "string") { + if (typeof version3 !== "string") { return null; } options = options || {}; let match2 = null; if (!options.rtl) { - match2 = version4.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); + match2 = version3.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE]); } else { const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]; let next; - while ((next = coerceRtlRegex.exec(version4)) && (!match2 || match2.index + match2[0].length !== version4.length)) { + while ((next = coerceRtlRegex.exec(version3)) && (!match2 || match2.index + match2[0].length !== version3.length)) { if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) { match2 = next; } @@ -27981,19 +27981,19 @@ var require_range2 = __commonJS({ }); } // if ANY of the sets match ALL of its comparators, then pass - test(version4) { - if (!version4) { + test(version3) { + if (!version3) { return false; } - if (typeof version4 === "string") { + if (typeof version3 === "string") { try { - version4 = new SemVer(version4, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } for (let i = 0; i < this.set.length; i++) { - if (testSet(this.set[i], version4, this.options)) { + if (testSet(this.set[i], version3, this.options)) { return true; } } @@ -28208,13 +28208,13 @@ var require_range2 = __commonJS({ } return `${from} ${to}`.trim(); }; - var testSet = (set, version4, options) => { + var testSet = (set, version3, options) => { for (let i = 0; i < set.length; i++) { - if (!set[i].test(version4)) { + if (!set[i].test(version3)) { return false; } } - if (version4.prerelease.length && !options.includePrerelease) { + if (version3.prerelease.length && !options.includePrerelease) { for (let i = 0; i < set.length; i++) { debug2(set[i].semver); if (set[i].semver === Comparator.ANY) { @@ -28222,7 +28222,7 @@ var require_range2 = __commonJS({ } if (set[i].semver.prerelease.length > 0) { const allowed = set[i].semver; - if (allowed.major === version4.major && allowed.minor === version4.minor && allowed.patch === version4.patch) { + if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) { return true; } } @@ -28283,19 +28283,19 @@ var require_comparator2 = __commonJS({ toString() { return this.value; } - test(version4) { - debug2("Comparator.test", version4, this.options.loose); - if (this.semver === ANY || version4 === ANY) { + test(version3) { + debug2("Comparator.test", version3, this.options.loose); + if (this.semver === ANY || version3 === ANY) { return true; } - if (typeof version4 === "string") { + if (typeof version3 === "string") { try { - version4 = new SemVer(version4, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } - return cmp(version4, this.operator, this.semver, this.options); + return cmp(version3, this.operator, this.semver, this.options); } intersects(comp26, options) { if (!(comp26 instanceof _Comparator)) { @@ -28352,13 +28352,13 @@ var require_satisfies2 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/semver/functions/satisfies.js"(exports2, module2) { "use strict"; var Range = require_range2(); - var satisfies4 = (version4, range2, options) => { + var satisfies4 = (version3, range2, options) => { try { range2 = new Range(range2, options); } catch (er) { return false; } - return range2.test(version4); + return range2.test(version3); }; module2.exports = satisfies4; } @@ -28520,8 +28520,8 @@ var require_outside2 = __commonJS({ var lt = require_lt2(); var lte = require_lte2(); var gte = require_gte2(); - var outside = (version4, range2, hilo, options) => { - version4 = new SemVer(version4, options); + var outside = (version3, range2, hilo, options) => { + version3 = new SemVer(version3, options); range2 = new Range(range2, options); let gtfn, ltefn, ltfn, comp26, ecomp; switch (hilo) { @@ -28542,7 +28542,7 @@ var require_outside2 = __commonJS({ default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (satisfies4(version4, range2, options)) { + if (satisfies4(version3, range2, options)) { return false; } for (let i = 0; i < range2.set.length; ++i) { @@ -28564,9 +28564,9 @@ var require_outside2 = __commonJS({ if (high.operator === comp26 || high.operator === ecomp) { return false; } - if ((!low.operator || low.operator === comp26) && ltefn(version4, low.semver)) { + if ((!low.operator || low.operator === comp26) && ltefn(version3, low.semver)) { return false; - } else if (low.operator === ecomp && ltfn(version4, low.semver)) { + } else if (low.operator === ecomp && ltfn(version3, low.semver)) { return false; } } @@ -28581,7 +28581,7 @@ var require_gtr2 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/semver/ranges/gtr.js"(exports2, module2) { "use strict"; var outside = require_outside2(); - var gtr = (version4, range2, options) => outside(version4, range2, ">", options); + var gtr = (version3, range2, options) => outside(version3, range2, ">", options); module2.exports = gtr; } }); @@ -28591,7 +28591,7 @@ var require_ltr2 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/semver/ranges/ltr.js"(exports2, module2) { "use strict"; var outside = require_outside2(); - var ltr = (version4, range2, options) => outside(version4, range2, "<", options); + var ltr = (version3, range2, options) => outside(version3, range2, "<", options); module2.exports = ltr; } }); @@ -28621,12 +28621,12 @@ var require_simplify2 = __commonJS({ let first = null; let prev = null; const v = versions.sort((a, b) => compare(a, b, options)); - for (const version4 of v) { - const included = satisfies4(version4, range2, options); + for (const version3 of v) { + const included = satisfies4(version3, range2, options); if (included) { - prev = version4; + prev = version3; if (!first) { - first = version4; + first = version3; } } else { if (prev) { @@ -28989,15 +28989,15 @@ var require_version = __commonJS({ stringify: stringify2 }; var validRegex = new RegExp("^" + VERSION_PATTERN + "$", "i"); - function valid2(version4) { - return validRegex.test(version4) ? version4 : null; + function valid2(version3) { + return validRegex.test(version3) ? version3 : null; } var cleanRegex = new RegExp("^\\s*" + VERSION_PATTERN + "\\s*$", "i"); - function clean3(version4) { - return stringify2(parse3(version4, cleanRegex)); + function clean3(version3) { + return stringify2(parse3(version3, cleanRegex)); } - function parse3(version4, regex) { - const { groups } = (regex || validRegex).exec(version4) || {}; + function parse3(version3, regex) { + const { groups } = (regex || validRegex).exec(version3) || {}; if (!groups) { return null; } @@ -29071,8 +29071,8 @@ var require_version = __commonJS({ } return null; } - function explain(version4) { - const parsed = parse3(version4); + function explain(version3) { + const parsed = parse3(version3); if (!parsed) { return parsed; } @@ -29123,36 +29123,36 @@ var require_operator = __commonJS({ ">": gt3, "===": arbitrary }; - function lt(version4, other) { - return compare(version4, other) < 0; + function lt(version3, other) { + return compare(version3, other) < 0; } - function le(version4, other) { - return compare(version4, other) <= 0; + function le(version3, other) { + return compare(version3, other) <= 0; } - function eq(version4, other) { - return compare(version4, other) === 0; + function eq(version3, other) { + return compare(version3, other) === 0; } - function ne(version4, other) { - return compare(version4, other) !== 0; + function ne(version3, other) { + return compare(version3, other) !== 0; } - function ge(version4, other) { - return compare(version4, other) >= 0; + function ge(version3, other) { + return compare(version3, other) >= 0; } - function gt3(version4, other) { - return compare(version4, other) > 0; + function gt3(version3, other) { + return compare(version3, other) > 0; } - function arbitrary(version4, other) { - return version4.toLowerCase() === other.toLowerCase(); + function arbitrary(version3, other) { + return version3.toLowerCase() === other.toLowerCase(); } - function compare(version4, other) { - const parsedVersion = parse3(version4); + function compare(version3, other) { + const parsedVersion = parse3(version3); const parsedOther = parse3(other); const keyVersion = calculateKey(parsedVersion); const keyOther = calculateKey(parsedOther); return pyCompare(keyVersion, keyOther); } - function rcompare(version4, other) { - return -compare(version4, other); + function rcompare(version3, other) { + return -compare(version3, other); } function pyCompare(elemIn, otherIn) { let elem = elemIn; @@ -29246,9 +29246,9 @@ var require_specifier = __commonJS({ return null; } let { ...spec } = groups; - const { operator, version: version4, prefix: prefix2, legacy } = groups; - if (version4) { - spec = { ...spec, ...explainVersion(version4) }; + const { operator, version: version3, prefix: prefix2, legacy } = groups; + if (version3) { + spec = { ...spec, ...explainVersion(version3) }; if (operator === "~=") { if (spec.release.length < 2) { return null; @@ -29293,8 +29293,8 @@ var require_specifier = __commonJS({ if (!parsed) { return []; } - return versions.filter((version4) => { - const explained = explainVersion(version4); + return versions.filter((version3) => { + const explained = explainVersion(version3); if (!parsed.length) { return explained && !(explained.is_prerelease && !options.prereleases); } @@ -29302,12 +29302,12 @@ var require_specifier = __commonJS({ if (!pass) { return false; } - return contains({ ...spec, ...options }, { version: version4, explained }); + return contains({ ...spec, ...options }, { version: version3, explained }); }, true); }); } - function satisfies4(version4, specifier, options = {}) { - const filtered = pick([version4], specifier, options); + function satisfies4(version3, specifier, options = {}) { + const filtered = pick([version3], specifier, options); return filtered.length === 1; } function arrayStartsWith(array, prefix2) { @@ -29323,7 +29323,7 @@ var require_specifier = __commonJS({ } function contains(specifier, input) { const { explained } = input; - let { version: version4 } = input; + let { version: version3 } = input; const { ...spec } = specifier; if (spec.prereleases === void 0) { spec.prereleases = spec.is_prerelease; @@ -29336,7 +29336,7 @@ var require_specifier = __commonJS({ if (spec.epoch) { compatiblePrefix = spec.epoch + "!" + compatiblePrefix; } - return satisfies4(version4, `>=${spec.version}, ==${compatiblePrefix}`, { + return satisfies4(version3, `>=${spec.version}, ==${compatiblePrefix}`, { prereleases: spec.prereleases }); } @@ -29347,7 +29347,7 @@ var require_specifier = __commonJS({ } if (explained) { if (explained.local && spec.version) { - version4 = explained.public; + version3 = explained.public; spec.version = explainVersion(spec.version).public; } } @@ -29357,7 +29357,7 @@ var require_specifier = __commonJS({ } } const op = Operator[spec.operator]; - return op(version4, spec.version || spec.legacy); + return op(version3, spec.version || spec.legacy); } function validRange(specifier) { return Boolean(parse3(specifier)); @@ -29376,36 +29376,36 @@ var require_semantic = __commonJS({ inc }; function major(input) { - const version4 = explain(input); - if (!version4) { + const version3 = explain(input); + if (!version3) { throw new TypeError("Invalid Version: " + input); } - return version4.release[0]; + return version3.release[0]; } function minor(input) { - const version4 = explain(input); - if (!version4) { + const version3 = explain(input); + if (!version3) { throw new TypeError("Invalid Version: " + input); } - if (version4.release.length < 2) { + if (version3.release.length < 2) { return 0; } - return version4.release[1]; + return version3.release[1]; } function patch(input) { - const version4 = explain(input); - if (!version4) { + const version3 = explain(input); + if (!version3) { throw new TypeError("Invalid Version: " + input); } - if (version4.release.length < 3) { + if (version3.release.length < 3) { return 0; } - return version4.release[2]; + return version3.release[2]; } function inc(input, release, preReleaseIdentifier) { let identifier = preReleaseIdentifier || `a`; - const version4 = parse3(input); - if (!version4) { + const version3 = parse3(input); + if (!version3) { return null; } if (!["a", "b", "c", "rc", "alpha", "beta", "pre", "preview"].includes( @@ -29416,103 +29416,103 @@ var require_semantic = __commonJS({ switch (release) { case "premajor": { - const [majorVersion] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion + 1; + const [majorVersion] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion + 1; } - version4.pre = [identifier, 0]; - delete version4.post; - delete version4.dev; - delete version4.local; + version3.pre = [identifier, 0]; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "preminor": { - const [majorVersion, minorVersion = 0] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion; - version4.release[1] = minorVersion + 1; + const [majorVersion, minorVersion = 0] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion; + version3.release[1] = minorVersion + 1; } - version4.pre = [identifier, 0]; - delete version4.post; - delete version4.dev; - delete version4.local; + version3.pre = [identifier, 0]; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "prepatch": { - const [majorVersion, minorVersion = 0, patchVersion = 0] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion; - version4.release[1] = minorVersion; - version4.release[2] = patchVersion + 1; + const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion; + version3.release[1] = minorVersion; + version3.release[2] = patchVersion + 1; } - version4.pre = [identifier, 0]; - delete version4.post; - delete version4.dev; - delete version4.local; + version3.pre = [identifier, 0]; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "prerelease": - if (version4.pre === null) { - const [majorVersion, minorVersion = 0, patchVersion = 0] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion; - version4.release[1] = minorVersion; - version4.release[2] = patchVersion + 1; - version4.pre = [identifier, 0]; + if (version3.pre === null) { + const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion; + version3.release[1] = minorVersion; + version3.release[2] = patchVersion + 1; + version3.pre = [identifier, 0]; } else { - if (preReleaseIdentifier === void 0 && version4.pre !== null) { - [identifier] = version4.pre; + if (preReleaseIdentifier === void 0 && version3.pre !== null) { + [identifier] = version3.pre; } - const [letter, number] = version4.pre; + const [letter, number] = version3.pre; if (letter === identifier) { - version4.pre = [letter, number + 1]; + version3.pre = [letter, number + 1]; } else { - version4.pre = [identifier, 0]; + version3.pre = [identifier, 0]; } } - delete version4.post; - delete version4.dev; - delete version4.local; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "major": - if (version4.release.slice(1).some((value) => value !== 0) || version4.pre === null) { - const [majorVersion] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion + 1; + if (version3.release.slice(1).some((value) => value !== 0) || version3.pre === null) { + const [majorVersion] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion + 1; } - delete version4.pre; - delete version4.post; - delete version4.dev; - delete version4.local; + delete version3.pre; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "minor": - if (version4.release.slice(2).some((value) => value !== 0) || version4.pre === null) { - const [majorVersion, minorVersion = 0] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion; - version4.release[1] = minorVersion + 1; + if (version3.release.slice(2).some((value) => value !== 0) || version3.pre === null) { + const [majorVersion, minorVersion = 0] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion; + version3.release[1] = minorVersion + 1; } - delete version4.pre; - delete version4.post; - delete version4.dev; - delete version4.local; + delete version3.pre; + delete version3.post; + delete version3.dev; + delete version3.local; break; case "patch": - if (version4.release.slice(3).some((value) => value !== 0) || version4.pre === null) { - const [majorVersion, minorVersion = 0, patchVersion = 0] = version4.release; - version4.release.fill(0); - version4.release[0] = majorVersion; - version4.release[1] = minorVersion; - version4.release[2] = patchVersion + 1; + if (version3.release.slice(3).some((value) => value !== 0) || version3.pre === null) { + const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release; + version3.release.fill(0); + version3.release[0] = majorVersion; + version3.release[1] = minorVersion; + version3.release[2] = patchVersion + 1; } - delete version4.pre; - delete version4.post; - delete version4.dev; - delete version4.local; + delete version3.pre; + delete version3.post; + delete version3.dev; + delete version3.local; break; default: return null; } - return stringify2(version4); + return stringify2(version3); } } }); @@ -29703,73 +29703,73 @@ var require_semver5 = __commonJS({ } var i; exports2.parse = parse3; - function parse3(version4, options) { + function parse3(version3, options) { if (!options || typeof options !== "object") { options = { loose: !!options, includePrerelease: false }; } - if (version4 instanceof SemVer) { - return version4; + if (version3 instanceof SemVer) { + return version3; } - if (typeof version4 !== "string") { + if (typeof version3 !== "string") { return null; } - if (version4.length > MAX_LENGTH) { + if (version3.length > MAX_LENGTH) { return null; } var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]; - if (!r.test(version4)) { + if (!r.test(version3)) { return null; } try { - return new SemVer(version4, options); + return new SemVer(version3, options); } catch (er) { return null; } } exports2.valid = valid2; - function valid2(version4, options) { - var v = parse3(version4, options); + function valid2(version3, options) { + var v = parse3(version3, options); return v ? v.version : null; } exports2.clean = clean3; - function clean3(version4, options) { - var s = parse3(version4.trim().replace(/^[=v]+/, ""), options); + function clean3(version3, options) { + var s = parse3(version3.trim().replace(/^[=v]+/, ""), options); return s ? s.version : null; } exports2.SemVer = SemVer; - function SemVer(version4, options) { + function SemVer(version3, options) { if (!options || typeof options !== "object") { options = { loose: !!options, includePrerelease: false }; } - if (version4 instanceof SemVer) { - if (version4.loose === options.loose) { - return version4; + if (version3 instanceof SemVer) { + if (version3.loose === options.loose) { + return version3; } else { - version4 = version4.version; + version3 = version3.version; } - } else if (typeof version4 !== "string") { - throw new TypeError("Invalid Version: " + version4); + } else if (typeof version3 !== "string") { + throw new TypeError("Invalid Version: " + version3); } - if (version4.length > MAX_LENGTH) { + if (version3.length > MAX_LENGTH) { throw new TypeError("version is longer than " + MAX_LENGTH + " characters"); } if (!(this instanceof SemVer)) { - return new SemVer(version4, options); + return new SemVer(version3, options); } - debug2("SemVer", version4, options); + debug2("SemVer", version3, options); this.options = options; this.loose = !!options.loose; - var m = version4.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); + var m = version3.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]); if (!m) { - throw new TypeError("Invalid Version: " + version4); + throw new TypeError("Invalid Version: " + version3); } - this.raw = version4; + this.raw = version3; this.major = +m[1]; this.minor = +m[2]; this.patch = +m[3]; @@ -29956,13 +29956,13 @@ var require_semver5 = __commonJS({ return this; }; exports2.inc = inc; - function inc(version4, release, loose, identifier) { + function inc(version3, release, loose, identifier) { if (typeof loose === "string") { identifier = loose; loose = void 0; } try { - return new SemVer(version4, loose).inc(release, identifier).version; + return new SemVer(version3, loose).inc(release, identifier).version; } catch (er) { return null; } @@ -30153,19 +30153,19 @@ var require_semver5 = __commonJS({ Comparator.prototype.toString = function() { return this.value; }; - Comparator.prototype.test = function(version4) { - debug2("Comparator.test", version4, this.options.loose); - if (this.semver === ANY || version4 === ANY) { + Comparator.prototype.test = function(version3) { + debug2("Comparator.test", version3, this.options.loose); + if (this.semver === ANY || version3 === ANY) { return true; } - if (typeof version4 === "string") { + if (typeof version3 === "string") { try { - version4 = new SemVer(version4, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } - return cmp(version4, this.operator, this.semver, this.options); + return cmp(version3, this.operator, this.semver, this.options); }; Comparator.prototype.intersects = function(comp26, options) { if (!(comp26 instanceof Comparator)) { @@ -30475,31 +30475,31 @@ var require_semver5 = __commonJS({ } return (from + " " + to).trim(); } - Range.prototype.test = function(version4) { - if (!version4) { + Range.prototype.test = function(version3) { + if (!version3) { return false; } - if (typeof version4 === "string") { + if (typeof version3 === "string") { try { - version4 = new SemVer(version4, this.options); + version3 = new SemVer(version3, this.options); } catch (er) { return false; } } for (var i2 = 0; i2 < this.set.length; i2++) { - if (testSet(this.set[i2], version4, this.options)) { + if (testSet(this.set[i2], version3, this.options)) { return true; } } return false; }; - function testSet(set, version4, options) { + function testSet(set, version3, options) { for (var i2 = 0; i2 < set.length; i2++) { - if (!set[i2].test(version4)) { + if (!set[i2].test(version3)) { return false; } } - if (version4.prerelease.length && !options.includePrerelease) { + if (version3.prerelease.length && !options.includePrerelease) { for (i2 = 0; i2 < set.length; i2++) { debug2(set[i2].semver); if (set[i2].semver === ANY) { @@ -30507,7 +30507,7 @@ var require_semver5 = __commonJS({ } if (set[i2].semver.prerelease.length > 0) { var allowed = set[i2].semver; - if (allowed.major === version4.major && allowed.minor === version4.minor && allowed.patch === version4.patch) { + if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) { return true; } } @@ -30517,13 +30517,13 @@ var require_semver5 = __commonJS({ return true; } exports2.satisfies = satisfies4; - function satisfies4(version4, range2, options) { + function satisfies4(version3, range2, options) { try { range2 = new Range(range2, options); } catch (er) { return false; } - return range2.test(version4); + return range2.test(version3); } exports2.maxSatisfying = maxSatisfying3; function maxSatisfying3(versions, range2, options) { @@ -30617,16 +30617,16 @@ var require_semver5 = __commonJS({ } } exports2.ltr = ltr; - function ltr(version4, range2, options) { - return outside(version4, range2, "<", options); + function ltr(version3, range2, options) { + return outside(version3, range2, "<", options); } exports2.gtr = gtr; - function gtr(version4, range2, options) { - return outside(version4, range2, ">", options); + function gtr(version3, range2, options) { + return outside(version3, range2, ">", options); } exports2.outside = outside; - function outside(version4, range2, hilo, options) { - version4 = new SemVer(version4, options); + function outside(version3, range2, hilo, options) { + version3 = new SemVer(version3, options); range2 = new Range(range2, options); var gtfn, ltefn, ltfn, comp26, ecomp; switch (hilo) { @@ -30647,7 +30647,7 @@ var require_semver5 = __commonJS({ default: throw new TypeError('Must provide a hilo val of "<" or ">"'); } - if (satisfies4(version4, range2, options)) { + if (satisfies4(version3, range2, options)) { return false; } for (var i2 = 0; i2 < range2.set.length; ++i2) { @@ -30669,17 +30669,17 @@ var require_semver5 = __commonJS({ if (high.operator === comp26 || high.operator === ecomp) { return false; } - if ((!low.operator || low.operator === comp26) && ltefn(version4, low.semver)) { + if ((!low.operator || low.operator === comp26) && ltefn(version3, low.semver)) { return false; - } else if (low.operator === ecomp && ltfn(version4, low.semver)) { + } else if (low.operator === ecomp && ltfn(version3, low.semver)) { return false; } } return true; } exports2.prerelease = prerelease; - function prerelease(version4, options) { - var parsed = parse3(version4, options); + function prerelease(version3, options) { + var parsed = parse3(version3, options); return parsed && parsed.prerelease.length ? parsed.prerelease : null; } exports2.intersects = intersects; @@ -30689,23 +30689,23 @@ var require_semver5 = __commonJS({ return r1.intersects(r2); } exports2.coerce = coerce; - function coerce(version4, options) { - if (version4 instanceof SemVer) { - return version4; + function coerce(version3, options) { + if (version3 instanceof SemVer) { + return version3; } - if (typeof version4 === "number") { - version4 = String(version4); + if (typeof version3 === "number") { + version3 = String(version3); } - if (typeof version4 !== "string") { + if (typeof version3 !== "string") { return null; } options = options || {}; var match2 = null; if (!options.rtl) { - match2 = version4.match(safeRe[t.COERCE]); + match2 = version3.match(safeRe[t.COERCE]); } else { var next; - while ((next = safeRe[t.COERCERTL].exec(version4)) && (!match2 || match2.index + match2[0].length !== version4.length)) { + while ((next = safeRe[t.COERCERTL].exec(version3)) && (!match2 || match2.index + match2[0].length !== version3.length)) { if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) { match2 = next; } @@ -32600,14 +32600,14 @@ var require_diagnostics2 = __commonJS({ "undici:client:beforeConnect", (evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debugLog( "connecting to %s%s using %s%s", host, port ? `:${port}` : "", protocol, - version4 + version3 ); } ); @@ -32615,14 +32615,14 @@ var require_diagnostics2 = __commonJS({ "undici:client:connected", (evt) => { const { - connectParams: { version: version4, protocol, port, host } + connectParams: { version: version3, protocol, port, host } } = evt; debugLog( "connected to %s%s using %s%s", host, port ? `:${port}` : "", protocol, - version4 + version3 ); } ); @@ -32630,7 +32630,7 @@ var require_diagnostics2 = __commonJS({ "undici:client:connectError", (evt) => { const { - connectParams: { version: version4, protocol, port, host }, + connectParams: { version: version3, protocol, port, host }, error: error2 } = evt; debugLog( @@ -32638,7 +32638,7 @@ var require_diagnostics2 = __commonJS({ host, port ? `:${port}` : "", protocol, - version4, + version3, error2.message ); } @@ -40624,10 +40624,10 @@ var require_socks5_client = __commonJS({ if (this.buffer.length < 2) { return; } - const version4 = this.buffer[0]; + const version3 = this.buffer[0]; const method = this.buffer[1]; - if (version4 !== SOCKS_VERSION) { - throw new Socks5ProxyError(`Invalid SOCKS version: ${version4}`, "UND_ERR_SOCKS5_VERSION"); + if (version3 !== SOCKS_VERSION) { + throw new Socks5ProxyError(`Invalid SOCKS version: ${version3}`, "UND_ERR_SOCKS5_VERSION"); } if (method === AUTH_METHODS.NO_ACCEPTABLE) { throw new Socks5ProxyError("No acceptable authentication method", "UND_ERR_SOCKS5_AUTH_REJECTED"); @@ -40672,10 +40672,10 @@ var require_socks5_client = __commonJS({ if (this.buffer.length < 2) { return; } - const version4 = this.buffer[0]; + const version3 = this.buffer[0]; const status = this.buffer[1]; - if (version4 !== 1) { - throw new Socks5ProxyError(`Invalid auth sub-negotiation version: ${version4}`, "UND_ERR_SOCKS5_AUTH_VERSION"); + if (version3 !== 1) { + throw new Socks5ProxyError(`Invalid auth sub-negotiation version: ${version3}`, "UND_ERR_SOCKS5_AUTH_VERSION"); } if (status !== 0) { throw new Socks5ProxyError("Authentication failed", "UND_ERR_SOCKS5_AUTH_FAILED"); @@ -40719,11 +40719,11 @@ var require_socks5_client = __commonJS({ if (this.buffer.length < 4) { return; } - const version4 = this.buffer[0]; + const version3 = this.buffer[0]; const reply = this.buffer[1]; const addressType = this.buffer[3]; - if (version4 !== SOCKS_VERSION) { - throw new Socks5ProxyError(`Invalid SOCKS version in reply: ${version4}`, "UND_ERR_SOCKS5_REPLY_VERSION"); + if (version3 !== SOCKS_VERSION) { + throw new Socks5ProxyError(`Invalid SOCKS version in reply: ${version3}`, "UND_ERR_SOCKS5_REPLY_VERSION"); } let responseLength = 4; if (addressType === ADDRESS_TYPES.IPV4) { @@ -58339,8 +58339,8 @@ function getVersion(app_1) { function getCompressionMethod() { return __awaiter10(this, void 0, void 0, function* () { const versionOutput = yield getVersion("zstd", ["--quiet"]); - const version4 = semver.clean(versionOutput); - debug(`zstd version: ${version4}`); + const version3 = semver.clean(versionOutput); + debug(`zstd version: ${version3}`); if (versionOutput === "") { return CompressionMethod.Gzip; } else { @@ -82675,8 +82675,8 @@ var SASQueryParameters = class { } return void 0; } - constructor(version4, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2, delegatedUserObjectId) { - this.version = version4; + constructor(version3, signature, permissionsOrOptions, services, resourceTypes, protocol, startsOn, expiresOn2, ipRange, identifier, resource, cacheControl, contentDisposition, contentEncoding, contentLanguage, contentType2, userDelegationKey, preauthorizedAgentObjectId, correlationId, encryptionScope2, delegatedUserObjectId) { + this.version = version3; this.signature = signature; if (permissionsOrOptions !== void 0 && typeof permissionsOrOptions !== "string") { this.permissions = permissionsOrOptions.permissions; @@ -82883,7 +82883,7 @@ function generateBlobSASQueryParameters(blobSASSignatureValues, sharedKeyCredent return generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName).sasQueryParameters; } function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKeyCredentialOrUserDelegationKey, accountName) { - const version4 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; + const version3 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; const sharedKeyCredential = sharedKeyCredentialOrUserDelegationKey instanceof StorageSharedKeyCredential ? sharedKeyCredentialOrUserDelegationKey : void 0; let userDelegationKeyCredential; if (sharedKeyCredential === void 0 && accountName !== void 0) { @@ -82892,29 +82892,29 @@ function generateBlobSASQueryParametersInternal(blobSASSignatureValues, sharedKe if (sharedKeyCredential === void 0 && userDelegationKeyCredential === void 0) { throw TypeError("Invalid sharedKeyCredential, userDelegationKey or accountName."); } - if (version4 >= "2020-12-06") { + if (version3 >= "2020-12-06") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20201206(blobSASSignatureValues, sharedKeyCredential); } else { - if (version4 >= "2025-07-05") { + if (version3 >= "2025-07-05") { return generateBlobSASQueryParametersUDK20250705(blobSASSignatureValues, userDelegationKeyCredential); } else { return generateBlobSASQueryParametersUDK20201206(blobSASSignatureValues, userDelegationKeyCredential); } } } - if (version4 >= "2018-11-09") { + if (version3 >= "2018-11-09") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20181109(blobSASSignatureValues, sharedKeyCredential); } else { - if (version4 >= "2020-02-10") { + if (version3 >= "2020-02-10") { return generateBlobSASQueryParametersUDK20200210(blobSASSignatureValues, userDelegationKeyCredential); } else { return generateBlobSASQueryParametersUDK20181109(blobSASSignatureValues, userDelegationKeyCredential); } } } - if (version4 >= "2015-04-05") { + if (version3 >= "2015-04-05") { if (sharedKeyCredential !== void 0) { return generateBlobSASQueryParameters20150405(blobSASSignatureValues, sharedKeyCredential); } else { @@ -83289,44 +83289,44 @@ function getCanonicalName(accountName, containerName, blobName) { return elements.join(""); } function SASSignatureValuesSanityCheckAndAutofill(blobSASSignatureValues) { - const version4 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; - if (blobSASSignatureValues.snapshotTime && version4 < "2018-11-09") { + const version3 = blobSASSignatureValues.version ? blobSASSignatureValues.version : SERVICE_VERSION; + if (blobSASSignatureValues.snapshotTime && version3 < "2018-11-09") { throw RangeError("'version' must be >= '2018-11-09' when providing 'snapshotTime'."); } if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.snapshotTime) { throw RangeError("Must provide 'blobName' when providing 'snapshotTime'."); } - if (blobSASSignatureValues.versionId && version4 < "2019-10-10") { + if (blobSASSignatureValues.versionId && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'versionId'."); } if (blobSASSignatureValues.blobName === void 0 && blobSASSignatureValues.versionId) { throw RangeError("Must provide 'blobName' when providing 'versionId'."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version4 < "2020-08-04") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.setImmutabilityPolicy && version3 < "2020-08-04") { throw RangeError("'version' must be >= '2020-08-04' when provided 'i' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version4 < "2019-10-10") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.deleteVersion && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'x' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version4 < "2019-10-10") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.permanentDelete && version3 < "2019-10-10") { throw RangeError("'version' must be >= '2019-10-10' when providing 'y' permission."); } - if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version4 < "2019-12-12") { + if (blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.tag && version3 < "2019-12-12") { throw RangeError("'version' must be >= '2019-12-12' when providing 't' permission."); } - if (version4 < "2020-02-10" && blobSASSignatureValues.permissions && (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { + if (version3 < "2020-02-10" && blobSASSignatureValues.permissions && (blobSASSignatureValues.permissions.move || blobSASSignatureValues.permissions.execute)) { throw RangeError("'version' must be >= '2020-02-10' when providing the 'm' or 'e' permission."); } - if (version4 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { + if (version3 < "2021-04-10" && blobSASSignatureValues.permissions && blobSASSignatureValues.permissions.filterByTags) { throw RangeError("'version' must be >= '2021-04-10' when providing the 'f' permission."); } - if (version4 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { + if (version3 < "2020-02-10" && (blobSASSignatureValues.preauthorizedAgentObjectId || blobSASSignatureValues.correlationId)) { throw RangeError("'version' must be >= '2020-02-10' when providing 'preauthorizedAgentObjectId' or 'correlationId'."); } - if (blobSASSignatureValues.encryptionScope && version4 < "2020-12-06") { + if (blobSASSignatureValues.encryptionScope && version3 < "2020-12-06") { throw RangeError("'version' must be >= '2020-12-06' when provided 'encryptionScope' in SAS."); } - blobSASSignatureValues.version = version4; + blobSASSignatureValues.version = version3; return blobSASSignatureValues; } @@ -88912,14 +88912,14 @@ function getCacheServiceVersion() { return process.env["ACTIONS_CACHE_SERVICE_V2"] ? "v2" : "v1"; } function getCacheServiceURL() { - const version4 = getCacheServiceVersion(); - switch (version4) { + const version3 = getCacheServiceVersion(); + switch (version3) { case "v1": return process.env["ACTIONS_CACHE_URL"] || process.env["ACTIONS_RESULTS_URL"] || ""; case "v2": return process.env["ACTIONS_RESULTS_URL"] || ""; default: - throw new Error(`Unsupported cache service version: ${version4}`); + throw new Error(`Unsupported cache service version: ${version3}`); } } @@ -88985,14 +88985,14 @@ function createHttpClient() { function getCacheEntry(keys, paths, options) { return __awaiter13(this, void 0, void 0, function* () { const httpClient = createHttpClient(); - const version4 = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); - const resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version4}`; + const version3 = getCacheVersion(paths, options === null || options === void 0 ? void 0 : options.compressionMethod, options === null || options === void 0 ? void 0 : options.enableCrossOsArchive); + const resource = `cache?keys=${encodeURIComponent(keys.join(","))}&version=${version3}`; const response = yield retryTypedResponse("getCacheEntry", () => __awaiter13(this, void 0, void 0, function* () { return httpClient.getJson(getCacheApiUrl(resource)); })); if (response.statusCode === 204) { if (isDebug()) { - yield printCachesListForDiagnostics(keys[0], httpClient, version4); + yield printCachesListForDiagnostics(keys[0], httpClient, version3); } return null; } @@ -89010,7 +89010,7 @@ function getCacheEntry(keys, paths, options) { return cacheResult; }); } -function printCachesListForDiagnostics(key, httpClient, version4) { +function printCachesListForDiagnostics(key, httpClient, version3) { return __awaiter13(this, void 0, void 0, function* () { const resource = `caches?key=${encodeURIComponent(key)}`; const response = yield retryTypedResponse("listCache", () => __awaiter13(this, void 0, void 0, function* () { @@ -89020,7 +89020,7 @@ function printCachesListForDiagnostics(key, httpClient, version4) { const cacheListResult = response.result; const totalCount = cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.totalCount; if (totalCount && totalCount > 0) { - debug(`No matching cache found for cache key '${key}', version '${version4} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key + debug(`No matching cache found for cache key '${key}', version '${version3} and scope ${process.env["GITHUB_REF"]}. There exist one or more cache(s) with similar key but they have different version or scope. See more info on cache matching here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#matching-a-cache-key Other caches with similar key:`); for (const cacheEntry of (cacheListResult === null || cacheListResult === void 0 ? void 0 : cacheListResult.artifactCaches) || []) { debug(`Cache Key: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheKey}, Cache Version: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.cacheVersion}, Cache Scope: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.scope}, Cache Created: ${cacheEntry === null || cacheEntry === void 0 ? void 0 : cacheEntry.creationTime}`); @@ -89964,14 +89964,14 @@ function getTarArgs(tarPath_1, compressionMethod_1, type_1) { const args = [`"${tarPath.path}"`]; const cacheFileName = getCacheFileName(compressionMethod); const tarFile = "cache.tar"; - const workingDirectory2 = getWorkingDirectory(); + const workingDirectory = getWorkingDirectory(); const BSD_TAR_ZSTD = tarPath.type === ArchiveToolType.BSD && compressionMethod !== CompressionMethod.Gzip && IS_WINDOWS8; switch (type) { case "create": - args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path10.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path10.sep}`, "g"), "/"), "-P", "-C", workingDirectory2.replace(new RegExp(`\\${path10.sep}`, "g"), "/"), "--files-from", ManifestFilename); + args.push("--posix", "-cf", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path10.sep}`, "g"), "/"), "--exclude", BSD_TAR_ZSTD ? tarFile : cacheFileName.replace(new RegExp(`\\${path10.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path10.sep}`, "g"), "/"), "--files-from", ManifestFilename); break; case "extract": - args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path10.sep}`, "g"), "/"), "-P", "-C", workingDirectory2.replace(new RegExp(`\\${path10.sep}`, "g"), "/")); + args.push("-xf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path10.sep}`, "g"), "/"), "-P", "-C", workingDirectory.replace(new RegExp(`\\${path10.sep}`, "g"), "/")); break; case "list": args.push("-tf", BSD_TAR_ZSTD ? tarFile : archivePath.replace(new RegExp(`\\${path10.sep}`, "g"), "/"), "-P"); @@ -90083,8 +90083,8 @@ function listTar(archivePath, compressionMethod) { } function extractTar(archivePath, compressionMethod) { return __awaiter15(this, void 0, void 0, function* () { - const workingDirectory2 = getWorkingDirectory(); - yield mkdirP(workingDirectory2); + const workingDirectory = getWorkingDirectory(); + yield mkdirP(workingDirectory); const commands = yield getCommands(compressionMethod, "extract", archivePath); yield execCommands(commands); }); @@ -90319,926 +90319,8 @@ async function hashFiles2(pattern, verbose = false) { return ""; } -// src/utils/inputs.ts -var import_node_path = __toESM(require("node:path"), 1); - -// src/utils/config-file.ts -var import_node_fs2 = __toESM(require("node:fs"), 1); - -// node_modules/smol-toml/dist/error.js -function getLineColFromPtr(string, ptr) { - let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g); - return [lines.length, lines.pop().length + 1]; -} -function makeCodeBlock(string, line, column) { - let lines = string.split(/\r\n|\n|\r/g); - let codeblock = ""; - let numberLen = (Math.log10(line + 1) | 0) + 1; - for (let i = line - 1; i <= line + 1; i++) { - let l = lines[i - 1]; - if (!l) - continue; - codeblock += i.toString().padEnd(numberLen, " "); - codeblock += ": "; - codeblock += l; - codeblock += "\n"; - if (i === line) { - codeblock += " ".repeat(numberLen + column + 2); - codeblock += "^\n"; - } - } - return codeblock; -} -var TomlError = class extends Error { - line; - column; - codeblock; - constructor(message, options) { - const [line, column] = getLineColFromPtr(options.toml, options.ptr); - const codeblock = makeCodeBlock(options.toml, line, column); - super(`Invalid TOML document: ${message} - -${codeblock}`, options); - this.line = line; - this.column = column; - this.codeblock = codeblock; - } -}; - -// node_modules/smol-toml/dist/util.js -function isEscaped(str, ptr) { - let i = 0; - while (str[ptr - ++i] === "\\") - ; - return --i && i % 2; -} -function indexOfNewline(str, start = 0, end = str.length) { - let idx = str.indexOf("\n", start); - if (str[idx - 1] === "\r") - idx--; - return idx <= end ? idx : -1; -} -function skipComment(str, ptr) { - for (let i = ptr; i < str.length; i++) { - let c = str[i]; - if (c === "\n") - return i; - if (c === "\r" && str[i + 1] === "\n") - return i + 1; - if (c < " " && c !== " " || c === "\x7F") { - throw new TomlError("control characters are not allowed in comments", { - toml: str, - ptr - }); - } - } - return str.length; -} -function skipVoid(str, ptr, banNewLines, banComments) { - let c; - while ((c = str[ptr]) === " " || c === " " || !banNewLines && (c === "\n" || c === "\r" && str[ptr + 1] === "\n")) - ptr++; - return banComments || c !== "#" ? ptr : skipVoid(str, skipComment(str, ptr), banNewLines); -} -function skipUntil(str, ptr, sep8, end, banNewLines = false) { - if (!end) { - ptr = indexOfNewline(str, ptr); - return ptr < 0 ? str.length : ptr; - } - for (let i = ptr; i < str.length; i++) { - let c = str[i]; - if (c === "#") { - i = indexOfNewline(str, i); - } else if (c === sep8) { - return i + 1; - } else if (c === end || banNewLines && (c === "\n" || c === "\r" && str[i + 1] === "\n")) { - return i; - } - } - throw new TomlError("cannot find end of structure", { - toml: str, - ptr - }); -} -function getStringEnd(str, seek) { - let first = str[seek]; - let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first; - seek += target.length - 1; - do - seek = str.indexOf(target, ++seek); - while (seek > -1 && first !== "'" && isEscaped(str, seek)); - if (seek > -1) { - seek += target.length; - if (target.length > 1) { - if (str[seek] === first) - seek++; - if (str[seek] === first) - seek++; - } - } - return seek; -} - -// node_modules/smol-toml/dist/date.js -var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i; -var TomlDate = class _TomlDate extends Date { - #hasDate = false; - #hasTime = false; - #offset = null; - constructor(date) { - let hasDate = true; - let hasTime = true; - let offset = "Z"; - if (typeof date === "string") { - let match2 = date.match(DATE_TIME_RE); - if (match2) { - if (!match2[1]) { - hasDate = false; - date = `0000-01-01T${date}`; - } - hasTime = !!match2[2]; - hasTime && date[10] === " " && (date = date.replace(" ", "T")); - if (match2[2] && +match2[2] > 23) { - date = ""; - } else { - offset = match2[3] || null; - date = date.toUpperCase(); - if (!offset && hasTime) - date += "Z"; - } - } else { - date = ""; - } - } - super(date); - if (!isNaN(this.getTime())) { - this.#hasDate = hasDate; - this.#hasTime = hasTime; - this.#offset = offset; - } - } - isDateTime() { - return this.#hasDate && this.#hasTime; - } - isLocal() { - return !this.#hasDate || !this.#hasTime || !this.#offset; - } - isDate() { - return this.#hasDate && !this.#hasTime; - } - isTime() { - return this.#hasTime && !this.#hasDate; - } - isValid() { - return this.#hasDate || this.#hasTime; - } - toISOString() { - let iso = super.toISOString(); - if (this.isDate()) - return iso.slice(0, 10); - if (this.isTime()) - return iso.slice(11, 23); - if (this.#offset === null) - return iso.slice(0, -1); - if (this.#offset === "Z") - return iso; - let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6); - offset = this.#offset[0] === "-" ? offset : -offset; - let offsetDate = new Date(this.getTime() - offset * 6e4); - return offsetDate.toISOString().slice(0, -1) + this.#offset; - } - static wrapAsOffsetDateTime(jsDate, offset = "Z") { - let date = new _TomlDate(jsDate); - date.#offset = offset; - return date; - } - static wrapAsLocalDateTime(jsDate) { - let date = new _TomlDate(jsDate); - date.#offset = null; - return date; - } - static wrapAsLocalDate(jsDate) { - let date = new _TomlDate(jsDate); - date.#hasTime = false; - date.#offset = null; - return date; - } - static wrapAsLocalTime(jsDate) { - let date = new _TomlDate(jsDate); - date.#hasDate = false; - date.#offset = null; - return date; - } -}; - -// node_modules/smol-toml/dist/primitive.js -var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/; -var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/; -var LEADING_ZERO = /^[+-]?0[0-9_]/; -var ESCAPE_REGEX = /^[0-9a-f]{2,8}$/i; -var ESC_MAP = { - b: "\b", - t: " ", - n: "\n", - f: "\f", - r: "\r", - e: "\x1B", - '"': '"', - "\\": "\\" -}; -function parseString(str, ptr = 0, endPtr = str.length) { - let isLiteral = str[ptr] === "'"; - let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1]; - if (isMultiline) { - endPtr -= 2; - if (str[ptr += 2] === "\r") - ptr++; - if (str[ptr] === "\n") - ptr++; - } - let tmp = 0; - let isEscape; - let parsed = ""; - let sliceStart = ptr; - while (ptr < endPtr - 1) { - let c = str[ptr++]; - if (c === "\n" || c === "\r" && str[ptr] === "\n") { - if (!isMultiline) { - throw new TomlError("newlines are not allowed in strings", { - toml: str, - ptr: ptr - 1 - }); - } - } else if (c < " " && c !== " " || c === "\x7F") { - throw new TomlError("control characters are not allowed in strings", { - toml: str, - ptr: ptr - 1 - }); - } - if (isEscape) { - isEscape = false; - if (c === "x" || c === "u" || c === "U") { - let code = str.slice(ptr, ptr += c === "x" ? 2 : c === "u" ? 4 : 8); - if (!ESCAPE_REGEX.test(code)) { - throw new TomlError("invalid unicode escape", { - toml: str, - ptr: tmp - }); - } - try { - parsed += String.fromCodePoint(parseInt(code, 16)); - } catch { - throw new TomlError("invalid unicode escape", { - toml: str, - ptr: tmp - }); - } - } else if (isMultiline && (c === "\n" || c === " " || c === " " || c === "\r")) { - ptr = skipVoid(str, ptr - 1, true); - if (str[ptr] !== "\n" && str[ptr] !== "\r") { - throw new TomlError("invalid escape: only line-ending whitespace may be escaped", { - toml: str, - ptr: tmp - }); - } - ptr = skipVoid(str, ptr); - } else if (c in ESC_MAP) { - parsed += ESC_MAP[c]; - } else { - throw new TomlError("unrecognized escape sequence", { - toml: str, - ptr: tmp - }); - } - sliceStart = ptr; - } else if (!isLiteral && c === "\\") { - tmp = ptr - 1; - isEscape = true; - parsed += str.slice(sliceStart, tmp); - } - } - return parsed + str.slice(sliceStart, endPtr - 1); -} -function parseValue2(value, toml, ptr, integersAsBigInt) { - if (value === "true") - return true; - if (value === "false") - return false; - if (value === "-inf") - return -Infinity; - if (value === "inf" || value === "+inf") - return Infinity; - if (value === "nan" || value === "+nan" || value === "-nan") - return NaN; - if (value === "-0") - return integersAsBigInt ? 0n : 0; - let isInt = INT_REGEX.test(value); - if (isInt || FLOAT_REGEX.test(value)) { - if (LEADING_ZERO.test(value)) { - throw new TomlError("leading zeroes are not allowed", { - toml, - ptr - }); - } - value = value.replace(/_/g, ""); - let numeric = +value; - if (isNaN(numeric)) { - throw new TomlError("invalid number", { - toml, - ptr - }); - } - if (isInt) { - if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) { - throw new TomlError("integer value cannot be represented losslessly", { - toml, - ptr - }); - } - if (isInt || integersAsBigInt === true) - numeric = BigInt(value); - } - return numeric; - } - const date = new TomlDate(value); - if (!date.isValid()) { - throw new TomlError("invalid value", { - toml, - ptr - }); - } - return date; -} - -// node_modules/smol-toml/dist/extract.js -function sliceAndTrimEndOf(str, startPtr, endPtr) { - let value = str.slice(startPtr, endPtr); - let commentIdx = value.indexOf("#"); - if (commentIdx > -1) { - skipComment(str, commentIdx); - value = value.slice(0, commentIdx); - } - return [value.trimEnd(), commentIdx]; -} -function extractValue(str, ptr, end, depth, integersAsBigInt) { - if (depth === 0) { - throw new TomlError("document contains excessively nested structures. aborting.", { - toml: str, - ptr - }); - } - let c = str[ptr]; - if (c === "[" || c === "{") { - let [value, endPtr2] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt); - if (end) { - endPtr2 = skipVoid(str, endPtr2); - if (str[endPtr2] === ",") - endPtr2++; - else if (str[endPtr2] !== end) { - throw new TomlError("expected comma or end of structure", { - toml: str, - ptr: endPtr2 - }); - } - } - return [value, endPtr2]; - } - let endPtr; - if (c === '"' || c === "'") { - endPtr = getStringEnd(str, ptr); - let parsed = parseString(str, ptr, endPtr); - if (end) { - endPtr = skipVoid(str, endPtr); - if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== "\n" && str[endPtr] !== "\r") { - throw new TomlError("unexpected character encountered", { - toml: str, - ptr: endPtr - }); - } - endPtr += +(str[endPtr] === ","); - } - return [parsed, endPtr]; - } - endPtr = skipUntil(str, ptr, ",", end); - let slice = sliceAndTrimEndOf(str, ptr, endPtr - +(str[endPtr - 1] === ",")); - if (!slice[0]) { - throw new TomlError("incomplete key-value declaration: no value specified", { - toml: str, - ptr - }); - } - if (end && slice[1] > -1) { - endPtr = skipVoid(str, ptr + slice[1]); - endPtr += +(str[endPtr] === ","); - } - return [ - parseValue2(slice[0], str, ptr, integersAsBigInt), - endPtr - ]; -} - -// node_modules/smol-toml/dist/struct.js -var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/; -function parseKey(str, ptr, end = "=") { - let dot = ptr - 1; - let parsed = []; - let endPtr = str.indexOf(end, ptr); - if (endPtr < 0) { - throw new TomlError("incomplete key-value: cannot find end of key", { - toml: str, - ptr - }); - } - do { - let c = str[ptr = ++dot]; - if (c !== " " && c !== " ") { - if (c === '"' || c === "'") { - if (c === str[ptr + 1] && c === str[ptr + 2]) { - throw new TomlError("multiline strings are not allowed in keys", { - toml: str, - ptr - }); - } - let eos = getStringEnd(str, ptr); - if (eos < 0) { - throw new TomlError("unfinished string encountered", { - toml: str, - ptr - }); - } - dot = str.indexOf(".", eos); - let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot); - let newLine = indexOfNewline(strEnd); - if (newLine > -1) { - throw new TomlError("newlines are not allowed in keys", { - toml: str, - ptr: ptr + dot + newLine - }); - } - if (strEnd.trimStart()) { - throw new TomlError("found extra tokens after the string part", { - toml: str, - ptr: eos - }); - } - if (endPtr < eos) { - endPtr = str.indexOf(end, eos); - if (endPtr < 0) { - throw new TomlError("incomplete key-value: cannot find end of key", { - toml: str, - ptr - }); - } - } - parsed.push(parseString(str, ptr, eos)); - } else { - dot = str.indexOf(".", ptr); - let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot); - if (!KEY_PART_RE.test(part)) { - throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", { - toml: str, - ptr - }); - } - parsed.push(part.trimEnd()); - } - } - } while (dot + 1 && dot < endPtr); - return [parsed, skipVoid(str, endPtr + 1, true, true)]; -} -function parseInlineTable(str, ptr, depth, integersAsBigInt) { - let res = {}; - let seen = /* @__PURE__ */ new Set(); - let c; - ptr++; - while ((c = str[ptr++]) !== "}" && c) { - if (c === ",") { - throw new TomlError("expected value, found comma", { - toml: str, - ptr: ptr - 1 - }); - } else if (c === "#") - ptr = skipComment(str, ptr); - else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { - let k; - let t = res; - let hasOwn = false; - let [key, keyEndPtr] = parseKey(str, ptr - 1); - for (let i = 0; i < key.length; i++) { - if (i) - t = hasOwn ? t[k] : t[k] = {}; - k = key[i]; - if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) { - throw new TomlError("trying to redefine an already defined value", { - toml: str, - ptr - }); - } - if (!hasOwn && k === "__proto__") { - Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); - } - } - if (hasOwn) { - throw new TomlError("trying to redefine an already defined value", { - toml: str, - ptr - }); - } - let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt); - seen.add(value); - t[k] = value; - ptr = valueEndPtr; - } - } - if (!c) { - throw new TomlError("unfinished table encountered", { - toml: str, - ptr - }); - } - return [res, ptr]; -} -function parseArray(str, ptr, depth, integersAsBigInt) { - let res = []; - let c; - ptr++; - while ((c = str[ptr++]) !== "]" && c) { - if (c === ",") { - throw new TomlError("expected value, found comma", { - toml: str, - ptr: ptr - 1 - }); - } else if (c === "#") - ptr = skipComment(str, ptr); - else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { - let e = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt); - res.push(e[0]); - ptr = e[1]; - } - } - if (!c) { - throw new TomlError("unfinished array encountered", { - toml: str, - ptr - }); - } - return [res, ptr]; -} - -// node_modules/smol-toml/dist/parse.js -function peekTable(key, table, meta, type) { - let t = table; - let m = meta; - let k; - let hasOwn = false; - let state3; - for (let i = 0; i < key.length; i++) { - if (i) { - t = hasOwn ? t[k] : t[k] = {}; - m = (state3 = m[k]).c; - if (type === 0 && (state3.t === 1 || state3.t === 2)) { - return null; - } - if (state3.t === 2) { - let l = t.length - 1; - t = t[l]; - m = m[l].c; - } - } - k = key[i]; - if ((hasOwn = Object.hasOwn(t, k)) && m[k]?.t === 0 && m[k]?.d) { - return null; - } - if (!hasOwn) { - if (k === "__proto__") { - Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); - Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true }); - } - m[k] = { - t: i < key.length - 1 && type === 2 ? 3 : type, - d: false, - i: 0, - c: {} - }; - } - } - state3 = m[k]; - if (state3.t !== type && !(type === 1 && state3.t === 3)) { - return null; - } - if (type === 2) { - if (!state3.d) { - state3.d = true; - t[k] = []; - } - t[k].push(t = {}); - state3.c[state3.i++] = state3 = { t: 1, d: false, i: 0, c: {} }; - } - if (state3.d) { - return null; - } - state3.d = true; - if (type === 1) { - t = hasOwn ? t[k] : t[k] = {}; - } else if (type === 0 && hasOwn) { - return null; - } - return [k, t, state3.c]; -} -function parse2(toml, { maxDepth = 1e3, integersAsBigInt } = {}) { - let res = {}; - let meta = {}; - let tbl = res; - let m = meta; - for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) { - if (toml[ptr] === "[") { - let isTableArray = toml[++ptr] === "["; - let k = parseKey(toml, ptr += +isTableArray, "]"); - if (isTableArray) { - if (toml[k[1] - 1] !== "]") { - throw new TomlError("expected end of table declaration", { - toml, - ptr: k[1] - 1 - }); - } - k[1]++; - } - let p = peekTable( - k[0], - res, - meta, - isTableArray ? 2 : 1 - /* Type.EXPLICIT */ - ); - if (!p) { - throw new TomlError("trying to redefine an already defined table or value", { - toml, - ptr - }); - } - m = p[2]; - tbl = p[1]; - ptr = k[1]; - } else { - let k = parseKey(toml, ptr); - let p = peekTable( - k[0], - tbl, - m, - 0 - /* Type.DOTTED */ - ); - if (!p) { - throw new TomlError("trying to redefine an already defined table or value", { - toml, - ptr - }); - } - let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt); - p[1][p[0]] = v[0]; - ptr = v[1]; - } - ptr = skipVoid(toml, ptr, true); - if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") { - throw new TomlError("each key-value declaration must be followed by an end-of-line", { - toml, - ptr - }); - } - ptr = skipVoid(toml, ptr); - } - return res; -} - -// src/utils/config-file.ts -function getConfigValueFromTomlFile(filePath, key) { - if (!import_node_fs2.default.existsSync(filePath) || !filePath.endsWith(".toml")) { - return void 0; - } - const fileContent = import_node_fs2.default.readFileSync(filePath, "utf-8"); - if (filePath.endsWith("pyproject.toml")) { - const tomlContent2 = parse2(fileContent); - return tomlContent2?.tool?.uv?.[key]; - } - const tomlContent = parse2(fileContent); - return tomlContent[key]; -} - -// src/utils/inputs.ts -var workingDirectory = getInput("working-directory"); -var version3 = getInput("version"); -var versionFile = getVersionFile(); -var pythonVersion = getInput("python-version"); -var activateEnvironment = getBooleanInput("activate-environment"); -var venvPath = getVenvPath(); -var checkSum = getInput("checksum"); -var enableCache = getEnableCache(); -var restoreCache2 = getInput("restore-cache") === "true"; -var saveCache2 = getInput("save-cache") === "true"; -var cacheSuffix = getInput("cache-suffix") || ""; -var cacheLocalPath = getCacheLocalPath(); -var cacheDependencyGlob = getCacheDependencyGlob(); -var pruneCache = getInput("prune-cache") === "true"; -var cachePython = getInput("cache-python") === "true"; -var ignoreNothingToCache = getInput("ignore-nothing-to-cache") === "true"; -var ignoreEmptyWorkdir = getInput("ignore-empty-workdir") === "true"; -var toolBinDir = getToolBinDir(); -var toolDir = getToolDir(); -var pythonDir = getUvPythonDir(); -var githubToken = getInput("github-token"); -var manifestFile = getManifestFile(); -var addProblemMatchers = getInput("add-problem-matchers") === "true"; -var resolutionStrategy = getResolutionStrategy(); -function getVersionFile() { - const versionFileInput = getInput("version-file"); - if (versionFileInput !== "") { - const tildeExpanded = expandTilde(versionFileInput); - return resolveRelativePath(tildeExpanded); - } - return versionFileInput; -} -function getVenvPath() { - const venvPathInput = getInput("venv-path"); - if (venvPathInput !== "") { - if (!activateEnvironment) { - warning("venv-path is only used when activate-environment is true"); - } - const tildeExpanded = expandTilde(venvPathInput); - return normalizePath(resolveRelativePath(tildeExpanded)); - } - return normalizePath(resolveRelativePath(".venv")); -} -function getEnableCache() { - const enableCacheInput = getInput("enable-cache"); - if (enableCacheInput === "auto") { - return process.env.RUNNER_ENVIRONMENT === "github-hosted"; - } - return enableCacheInput === "true"; -} -function getToolBinDir() { - const toolBinDirInput = getInput("tool-bin-dir"); - if (toolBinDirInput !== "") { - const tildeExpanded = expandTilde(toolBinDirInput); - return resolveRelativePath(tildeExpanded); - } - if (process.platform === "win32") { - if (process.env.RUNNER_TEMP !== void 0) { - return `${process.env.RUNNER_TEMP}${import_node_path.default.sep}uv-tool-bin-dir`; - } - throw Error( - "Could not determine UV_TOOL_BIN_DIR. Please make sure RUNNER_TEMP is set or provide the tool-bin-dir input" - ); - } - return void 0; -} -function getToolDir() { - const toolDirInput = getInput("tool-dir"); - if (toolDirInput !== "") { - const tildeExpanded = expandTilde(toolDirInput); - return resolveRelativePath(tildeExpanded); - } - if (process.platform === "win32") { - if (process.env.RUNNER_TEMP !== void 0) { - return `${process.env.RUNNER_TEMP}${import_node_path.default.sep}uv-tool-dir`; - } - throw Error( - "Could not determine UV_TOOL_DIR. Please make sure RUNNER_TEMP is set or provide the tool-dir input" - ); - } - return void 0; -} -function getCacheLocalPath() { - const cacheLocalPathInput = getInput("cache-local-path"); - if (cacheLocalPathInput !== "") { - const tildeExpanded = expandTilde(cacheLocalPathInput); - return { - path: resolveRelativePath(tildeExpanded), - source: 0 /* Input */ - }; - } - const cacheDirFromConfig = getCacheDirFromConfig(); - if (cacheDirFromConfig !== void 0) { - return { path: cacheDirFromConfig, source: 1 /* Config */ }; - } - if (process.env.UV_CACHE_DIR !== void 0) { - info(`UV_CACHE_DIR is already set to ${process.env.UV_CACHE_DIR}`); - return { path: process.env.UV_CACHE_DIR, source: 2 /* Env */ }; - } - if (getEnableCache()) { - if (process.env.RUNNER_ENVIRONMENT === "github-hosted") { - if (process.env.RUNNER_TEMP !== void 0) { - return { - path: `${process.env.RUNNER_TEMP}${import_node_path.default.sep}setup-uv-cache`, - source: 3 /* Default */ - }; - } - throw Error( - "Could not determine UV_CACHE_DIR. Please make sure RUNNER_TEMP is set or provide the cache-local-path input" - ); - } - if (process.platform === "win32") { - return { - path: `${process.env.APPDATA}${import_node_path.default.sep}uv${import_node_path.default.sep}cache`, - source: 3 /* Default */ - }; - } - return { - path: `${process.env.HOME}${import_node_path.default.sep}.cache${import_node_path.default.sep}uv`, - source: 3 /* Default */ - }; - } -} -function getCacheDirFromConfig() { - for (const filePath of [versionFile, "uv.toml", "pyproject.toml"]) { - const resolvedPath = resolveRelativePath(filePath); - try { - const cacheDir2 = getConfigValueFromTomlFile(resolvedPath, "cache-dir"); - if (cacheDir2 !== void 0) { - info(`Found cache-dir in ${resolvedPath}: ${cacheDir2}`); - return cacheDir2; - } - } catch (err) { - const message = err.message; - warning(`Error while parsing ${filePath}: ${message}`); - return void 0; - } - } - return void 0; -} -function getUvPythonDir() { - if (process.env.UV_PYTHON_INSTALL_DIR !== void 0) { - info( - `UV_PYTHON_INSTALL_DIR is already set to ${process.env.UV_PYTHON_INSTALL_DIR}` - ); - return process.env.UV_PYTHON_INSTALL_DIR; - } - if (process.env.RUNNER_ENVIRONMENT !== "github-hosted") { - if (process.platform === "win32") { - return `${process.env.APPDATA}${import_node_path.default.sep}uv${import_node_path.default.sep}python`; - } else { - return `${process.env.HOME}${import_node_path.default.sep}.local${import_node_path.default.sep}share${import_node_path.default.sep}uv${import_node_path.default.sep}python`; - } - } - if (process.env.RUNNER_TEMP !== void 0) { - return `${process.env.RUNNER_TEMP}${import_node_path.default.sep}uv-python-dir`; - } - throw Error( - "Could not determine UV_PYTHON_INSTALL_DIR. Please make sure RUNNER_TEMP is set or provide the UV_PYTHON_INSTALL_DIR environment variable" - ); -} -function getCacheDependencyGlob() { - const cacheDependencyGlobInput = getInput("cache-dependency-glob"); - if (cacheDependencyGlobInput !== "") { - return cacheDependencyGlobInput.split("\n").map((part) => part.trim()).map((part) => expandTilde(part)).map((part) => resolveRelativePath(part)).join("\n"); - } - return cacheDependencyGlobInput; -} -function expandTilde(input) { - if (input.startsWith("~")) { - return `${process.env.HOME}${input.substring(1)}`; - } - return input; -} -function normalizePath(inputPath) { - const normalized = import_node_path.default.normalize(inputPath); - const root = import_node_path.default.parse(normalized).root; - let trimmed = normalized; - while (trimmed.length > root.length && trimmed.endsWith(import_node_path.default.sep)) { - trimmed = trimmed.slice(0, -1); - } - return trimmed; -} -function resolveRelativePath(inputPath) { - const hasNegation = inputPath.startsWith("!"); - const pathWithoutNegation = hasNegation ? inputPath.substring(1) : inputPath; - const resolvedPath = import_node_path.default.resolve(workingDirectory, pathWithoutNegation); - debug( - `Resolving relative path ${inputPath} to ${hasNegation ? "!" : ""}${resolvedPath}` - ); - return hasNegation ? `!${resolvedPath}` : resolvedPath; -} -function getManifestFile() { - const manifestFileInput = getInput("manifest-file"); - if (manifestFileInput !== "") { - return manifestFileInput; - } - return void 0; -} -function getResolutionStrategy() { - const resolutionStrategyInput = getInput("resolution-strategy"); - if (resolutionStrategyInput === "lowest") { - return "lowest"; - } - if (resolutionStrategyInput === "highest" || resolutionStrategyInput === "") { - return "highest"; - } - throw new Error( - `Invalid resolution-strategy: ${resolutionStrategyInput}. Must be 'highest' or 'lowest'.` - ); -} - // src/utils/platforms.ts -var import_node_fs3 = __toESM(require("node:fs"), 1); +var import_node_fs2 = __toESM(require("node:fs"), 1); var import_node_os3 = __toESM(require("node:os"), 1); function getArch() { const arch3 = process.arch; @@ -91314,7 +90396,7 @@ function getLinuxOSNameVersion() { const files = ["/etc/os-release", "/usr/lib/os-release"]; for (const file of files) { try { - const content = import_node_fs3.default.readFileSync(file, "utf8"); + const content = import_node_fs2.default.readFileSync(file, "utf8"); const id = parseOsReleaseValue(content, "ID"); const versionId2 = parseOsReleaseValue(content, "VERSION_ID"); const versionCodename = parseOsReleaseValue(content, "VERSION_CODENAME"); @@ -91345,10 +90427,10 @@ function getMacOSNameVersion() { return `macos-${macosVersion}`; } function getWindowsNameVersion() { - const version4 = import_node_os3.default.version(); - const match2 = version4.match(/Windows(?: Server)? (\d+)/); + const version3 = import_node_os3.default.version(); + const match2 = version3.match(/Windows(?: Server)? (\d+)/); if (!match2) { - throw new Error(`Failed to parse Windows version from: ${version4}`); + throw new Error(`Failed to parse Windows version from: ${version3}`); } return `windows-${match2[1]}`; } @@ -91358,30 +90440,30 @@ var STATE_CACHE_KEY = "cache-key"; var STATE_CACHE_MATCHED_KEY = "cache-matched-key"; var STATE_PYTHON_CACHE_MATCHED_KEY = "python-cache-matched-key"; var CACHE_VERSION = "2"; -async function restoreCache3(pythonVersion2) { - const cacheKey = await computeKeys(pythonVersion2); +async function restoreCache2(inputs, pythonVersion) { + const cacheKey = await computeKeys(inputs, pythonVersion); saveState(STATE_CACHE_KEY, cacheKey); setOutput("cache-key", cacheKey); - if (!restoreCache2) { + if (!inputs.restoreCache) { info("restore-cache is false. Skipping restore cache step."); setOutput("python-cache-hit", false); return; } - if (cacheLocalPath === void 0) { + if (inputs.cacheLocalPath === void 0) { throw new Error( "cache-local-path is not set. Cannot restore cache without a valid cache path." ); } await restoreCacheFromKey( cacheKey, - cacheLocalPath.path, + inputs.cacheLocalPath.path, STATE_CACHE_MATCHED_KEY, "cache-hit" ); - if (cachePython) { + if (inputs.cachePython) { await restoreCacheFromKey( `${cacheKey}-python`, - pythonDir, + inputs.pythonDir, STATE_PYTHON_CACHE_MATCHED_KEY, "python-cache-hit" ); @@ -91404,29 +90486,32 @@ async function restoreCacheFromKey(cacheKey, cachePath, stateKey, outputKey) { } handleMatchResult(matchedKey, cacheKey, stateKey, outputKey); } -async function computeKeys(pythonVersion2) { +async function computeKeys(inputs, pythonVersion) { let cacheDependencyPathHash = "-"; - if (cacheDependencyGlob !== "") { + if (inputs.cacheDependencyGlob !== "") { info( - `Searching files using cache dependency glob: ${cacheDependencyGlob.split("\n").join(",")}` + `Searching files using cache dependency glob: ${inputs.cacheDependencyGlob.split("\n").join(",")}` + ); + cacheDependencyPathHash += await hashFiles2( + inputs.cacheDependencyGlob, + true ); - cacheDependencyPathHash += await hashFiles2(cacheDependencyGlob, true); if (cacheDependencyPathHash === "-") { warning( - `No file matched to [${cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.` + `No file matched to [${inputs.cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.` ); } } if (cacheDependencyPathHash === "-") { cacheDependencyPathHash = "-no-dependency-glob"; } - const suffix = cacheSuffix ? `-${cacheSuffix}` : ""; - const version4 = pythonVersion2 ?? "unknown"; + const suffix = inputs.cacheSuffix ? `-${inputs.cacheSuffix}` : ""; + const version3 = pythonVersion ?? "unknown"; const platform2 = await getPlatform(); const osNameVersion = getOSNameVersion(); - const pruned = pruneCache ? "-pruned" : ""; - const python = cachePython ? "-py" : ""; - return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform2}-${osNameVersion}-${version4}${pruned}${python}${cacheDependencyPathHash}${suffix}`; + const pruned = inputs.pruneCache ? "-pruned" : ""; + const python = inputs.cachePython ? "-py" : ""; + return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform2}-${osNameVersion}-${version3}${pruned}${python}${cacheDependencyPathHash}${suffix}`; } function handleMatchResult(matchedKey, primaryKey, stateKey, outputKey) { if (!matchedKey) { @@ -91440,19 +90525,19 @@ function handleMatchResult(matchedKey, primaryKey, stateKey, outputKey) { } // src/download/download-version.ts -var import_node_fs4 = require("node:fs"); -var path14 = __toESM(require("node:path"), 1); +var import_node_fs3 = require("node:fs"); +var path13 = __toESM(require("node:path"), 1); // node_modules/@actions/tool-cache/lib/tool-cache.js var crypto5 = __toESM(require("crypto"), 1); -var fs10 = __toESM(require("fs"), 1); +var fs9 = __toESM(require("fs"), 1); // node_modules/@actions/tool-cache/lib/manifest.js var semver2 = __toESM(require_semver4(), 1); // node_modules/@actions/tool-cache/lib/tool-cache.js var os9 = __toESM(require("os"), 1); -var path13 = __toESM(require("path"), 1); +var path12 = __toESM(require("path"), 1); var semver3 = __toESM(require_semver4(), 1); var stream3 = __toESM(require("stream"), 1); var util6 = __toESM(require("util"), 1); @@ -91568,8 +90653,8 @@ var IS_MAC = process.platform === "darwin"; var userAgent = "actions/tool-cache"; function downloadTool(url2, dest, auth, headers) { return __awaiter18(this, void 0, void 0, function* () { - dest = dest || path13.join(_getTempDirectory(), crypto5.randomUUID()); - yield mkdirP(path13.dirname(dest)); + dest = dest || path12.join(_getTempDirectory(), crypto5.randomUUID()); + yield mkdirP(path12.dirname(dest)); debug(`Downloading ${url2}`); debug(`Destination ${dest}`); const maxAttempts = 3; @@ -91590,7 +90675,7 @@ function downloadTool(url2, dest, auth, headers) { } function downloadToolAttempt(url2, dest, auth, headers) { return __awaiter18(this, void 0, void 0, function* () { - if (fs10.existsSync(dest)) { + if (fs9.existsSync(dest)) { throw new Error(`Destination file path ${dest} already exists`); } const http3 = new HttpClient(userAgent, [], { @@ -91614,7 +90699,7 @@ function downloadToolAttempt(url2, dest, auth, headers) { const readStream = responseMessageFactory(); let succeeded = false; try { - yield pipeline4(readStream, fs10.createWriteStream(dest)); + yield pipeline4(readStream, fs9.createWriteStream(dest)); debug("download complete"); succeeded = true; return dest; @@ -91744,21 +90829,21 @@ function extractZipNix(file, dest) { yield exec(`"${unzipPath}"`, args, { cwd: dest }); }); } -function cacheDir(sourceDir2, tool, version4, arch3) { +function cacheDir(sourceDir2, tool, version3, arch3) { return __awaiter18(this, void 0, void 0, function* () { - version4 = semver3.clean(version4) || version4; + version3 = semver3.clean(version3) || version3; arch3 = arch3 || os9.arch(); - debug(`Caching tool ${tool} ${version4} ${arch3}`); + debug(`Caching tool ${tool} ${version3} ${arch3}`); debug(`source dir: ${sourceDir2}`); - if (!fs10.statSync(sourceDir2).isDirectory()) { + if (!fs9.statSync(sourceDir2).isDirectory()) { throw new Error("sourceDir is not a directory"); } - const destPath = yield _createToolPath(tool, version4, arch3); - for (const itemName of fs10.readdirSync(sourceDir2)) { - const s = path13.join(sourceDir2, itemName); + const destPath = yield _createToolPath(tool, version3, arch3); + for (const itemName of fs9.readdirSync(sourceDir2)) { + const s = path12.join(sourceDir2, itemName); yield cp(s, destPath, { recursive: true }); } - _completeToolPath(tool, version4, arch3); + _completeToolPath(tool, version3, arch3); return destPath; }); } @@ -91778,9 +90863,9 @@ function find(toolName, versionSpec, arch3) { let toolPath = ""; if (versionSpec) { versionSpec = semver3.clean(versionSpec) || ""; - const cachePath = path13.join(_getCacheDirectory(), toolName, versionSpec, arch3); + const cachePath = path12.join(_getCacheDirectory(), toolName, versionSpec, arch3); debug(`checking cache: ${cachePath}`); - if (fs10.existsSync(cachePath) && fs10.existsSync(`${cachePath}.complete`)) { + if (fs9.existsSync(cachePath) && fs9.existsSync(`${cachePath}.complete`)) { debug(`Found tool in cache ${toolName} ${versionSpec} ${arch3}`); toolPath = cachePath; } else { @@ -91792,13 +90877,13 @@ function find(toolName, versionSpec, arch3) { function findAllVersions(toolName, arch3) { const versions = []; arch3 = arch3 || os9.arch(); - const toolPath = path13.join(_getCacheDirectory(), toolName); - if (fs10.existsSync(toolPath)) { - const children = fs10.readdirSync(toolPath); + const toolPath = path12.join(_getCacheDirectory(), toolName); + if (fs9.existsSync(toolPath)) { + const children = fs9.readdirSync(toolPath); for (const child2 of children) { if (isExplicitVersion(child2)) { - const fullPath = path13.join(toolPath, child2, arch3 || ""); - if (fs10.existsSync(fullPath) && fs10.existsSync(`${fullPath}.complete`)) { + const fullPath = path12.join(toolPath, child2, arch3 || ""); + if (fs9.existsSync(fullPath) && fs9.existsSync(`${fullPath}.complete`)) { versions.push(child2); } } @@ -91809,15 +90894,15 @@ function findAllVersions(toolName, arch3) { function _createExtractFolder(dest) { return __awaiter18(this, void 0, void 0, function* () { if (!dest) { - dest = path13.join(_getTempDirectory(), crypto5.randomUUID()); + dest = path12.join(_getTempDirectory(), crypto5.randomUUID()); } yield mkdirP(dest); return dest; }); } -function _createToolPath(tool, version4, arch3) { +function _createToolPath(tool, version3, arch3) { return __awaiter18(this, void 0, void 0, function* () { - const folderPath = path13.join(_getCacheDirectory(), tool, semver3.clean(version4) || version4, arch3 || ""); + const folderPath = path12.join(_getCacheDirectory(), tool, semver3.clean(version3) || version3, arch3 || ""); debug(`destination ${folderPath}`); const markerPath = `${folderPath}.complete`; yield rmRF(folderPath); @@ -91826,10 +90911,10 @@ function _createToolPath(tool, version4, arch3) { return folderPath; }); } -function _completeToolPath(tool, version4, arch3) { - const folderPath = path13.join(_getCacheDirectory(), tool, semver3.clean(version4) || version4, arch3 || ""); +function _completeToolPath(tool, version3, arch3) { + const folderPath = path12.join(_getCacheDirectory(), tool, semver3.clean(version3) || version3, arch3 || ""); const markerPath = `${folderPath}.complete`; - fs10.writeFileSync(markerPath, ""); + fs9.writeFileSync(markerPath, ""); debug("finished caching tool"); } function isExplicitVersion(versionSpec) { @@ -91840,7 +90925,7 @@ function isExplicitVersion(versionSpec) { return valid2; } function evaluateVersions(versions, versionSpec) { - let version4 = ""; + let version3 = ""; debug(`evaluating ${versions.length} versions`); versions = versions.sort((a, b) => { if (semver3.gt(a, b)) { @@ -91852,16 +90937,16 @@ function evaluateVersions(versions, versionSpec) { const potential = versions[i]; const satisfied = semver3.satisfies(potential, versionSpec); if (satisfied) { - version4 = potential; + version3 = potential; break; } } - if (version4) { - debug(`matched: ${version4}`); + if (version3) { + debug(`matched: ${version3}`); } else { debug("match not found"); } - return version4; + return version3; } function _getCacheDirectory() { const cacheDirectory = process.env["RUNNER_TOOL_CACHE"] || ""; @@ -91892,7 +90977,7 @@ var ASTRAL_MIRROR_PREFIX = "https://releases.astral.sh/github/uv/releases/downlo // src/download/checksum/checksum.ts var crypto6 = __toESM(require("node:crypto"), 1); -var fs11 = __toESM(require("node:fs"), 1); +var fs10 = __toESM(require("node:fs"), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { @@ -96395,8 +95480,8 @@ var KNOWN_CHECKSUMS = { }; // src/download/checksum/checksum.ts -async function validateChecksum(checksum, downloadPath, arch3, platform2, version4) { - const key = `${arch3}-${platform2}-${version4}`; +async function validateChecksum(checksum, downloadPath, arch3, platform2, version3) { + const key = `${arch3}-${platform2}-${version3}`; const hasProvidedChecksum = checksum !== void 0 && checksum !== ""; const checksumToUse = hasProvidedChecksum ? checksum : KNOWN_CHECKSUMS[key]; if (checksumToUse === void 0) { @@ -96416,7 +95501,7 @@ async function validateChecksum(checksum, downloadPath, arch3, platform2, versio async function validateFileCheckSum(filePath, expected) { return new Promise((resolve3, reject) => { const hash = crypto6.createHash("sha256"); - const stream4 = fs11.createReadStream(filePath); + const stream4 = fs10.createReadStream(filePath); stream4.on("error", (err) => reject(err)); stream4.on("data", (chunk) => hash.update(chunk)); stream4.on("end", () => { @@ -96548,13 +95633,13 @@ async function getAllVersions(manifestUrl = VERSIONS_MANIFEST_URL) { const versions = await fetchManifest(manifestUrl); return versions.map((versionData) => versionData.version); } -async function getArtifact(version4, arch3, platform2, manifestUrl = VERSIONS_MANIFEST_URL) { +async function getArtifact(version3, arch3, platform2, manifestUrl = VERSIONS_MANIFEST_URL) { const versions = await fetchManifest(manifestUrl); const versionData = versions.find( - (candidate) => candidate.version === version4 + (candidate) => candidate.version === version3 ); if (!versionData) { - debug(`Version ${version4} not found in manifest ${manifestUrl}`); + debug(`Version ${version3} not found in manifest ${manifestUrl}`); return void 0; } const targetPlatform = `${arch3}-${platform2}`; @@ -96563,13 +95648,13 @@ async function getArtifact(version4, arch3, platform2, manifestUrl = VERSIONS_MA ); if (matchingArtifacts.length === 0) { debug( - `Artifact for ${targetPlatform} not found in version ${version4}. Available platforms: ${versionData.artifacts.map((candidate) => candidate.platform).join(", ")}` + `Artifact for ${targetPlatform} not found in version ${version3}. Available platforms: ${versionData.artifacts.map((candidate) => candidate.platform).join(", ")}` ); return void 0; } const artifact = selectDefaultVariant( matchingArtifacts, - `Multiple artifacts found for ${targetPlatform} in version ${version4}` + `Multiple artifacts found for ${targetPlatform} in version ${version3}` ); return { archiveFormat: artifact.archive_format, @@ -96598,36 +95683,36 @@ function isRecord(value) { } // src/download/download-version.ts -function tryGetFromToolCache(arch3, version4) { - debug(`Trying to get uv from tool cache for ${version4}...`); +function tryGetFromToolCache(arch3, version3) { + debug(`Trying to get uv from tool cache for ${version3}...`); const cachedVersions = findAllVersions(TOOL_CACHE_NAME, arch3); debug(`Cached versions: ${cachedVersions}`); - let resolvedVersion = evaluateVersions(cachedVersions, version4); + let resolvedVersion = evaluateVersions(cachedVersions, version3); if (resolvedVersion === "") { - resolvedVersion = version4; + resolvedVersion = version3; } const installedPath = find(TOOL_CACHE_NAME, resolvedVersion, arch3); return { installedPath, version: resolvedVersion }; } -async function downloadVersion(platform2, arch3, version4, checkSum2, githubToken2, manifestUrl) { - const artifact = await getArtifact(version4, arch3, platform2, manifestUrl); +async function downloadVersion(platform2, arch3, version3, checksum, githubToken, manifestUrl) { + const artifact = await getArtifact(version3, arch3, platform2, manifestUrl); if (!artifact) { throw new Error( - getMissingArtifactMessage(version4, arch3, platform2, manifestUrl) + getMissingArtifactMessage(version3, arch3, platform2, manifestUrl) ); } - const checksum = manifestUrl === void 0 ? checkSum2 : resolveChecksum(checkSum2, artifact.checksum); + const resolvedChecksum = manifestUrl === void 0 ? checksum : resolveChecksum(checksum, artifact.checksum); const mirrorUrl = rewriteToMirror(artifact.downloadUrl); const downloadUrl = mirrorUrl ?? artifact.downloadUrl; - const downloadToken = mirrorUrl !== void 0 ? void 0 : githubToken2; + const downloadToken = mirrorUrl !== void 0 ? void 0 : githubToken; try { return await downloadArtifact( downloadUrl, `uv-${arch3}-${platform2}`, platform2, arch3, - version4, - checksum, + version3, + resolvedChecksum, downloadToken ); } catch (err) { @@ -96642,9 +95727,9 @@ async function downloadVersion(platform2, arch3, version4, checkSum2, githubToke `uv-${arch3}-${platform2}`, platform2, arch3, - version4, - checksum, - githubToken2 + version3, + resolvedChecksum, + githubToken ); } } @@ -96654,14 +95739,14 @@ function rewriteToMirror(url2) { } return ASTRAL_MIRROR_PREFIX + url2.slice(GITHUB_RELEASES_PREFIX.length); } -async function downloadArtifact(downloadUrl, artifactName, platform2, arch3, version4, checksum, githubToken2) { +async function downloadArtifact(downloadUrl, artifactName, platform2, arch3, version3, checksum, githubToken) { info(`Downloading uv from "${downloadUrl}" ...`); const downloadPath = await downloadTool( downloadUrl, void 0, - githubToken2 + githubToken ); - await validateChecksum(checksum, downloadPath, arch3, platform2, version4); + await validateChecksum(checksum, downloadPath, arch3, platform2, version3); let uvDir; if (platform2 === "pc-windows-msvc") { try { @@ -96672,53 +95757,53 @@ async function downloadArtifact(downloadUrl, artifactName, platform2, arch3, ver ); const extension = getExtension(platform2); const fullPathWithExtension = `${downloadPath}${extension}`; - await import_node_fs4.promises.copyFile(downloadPath, fullPathWithExtension); + await import_node_fs3.promises.copyFile(downloadPath, fullPathWithExtension); uvDir = await extractZip(fullPathWithExtension); } } else { const extractedDir = await extractTar2(downloadPath); - uvDir = path14.join(extractedDir, artifactName); + uvDir = path13.join(extractedDir, artifactName); } const cachedToolDir = await cacheDir( uvDir, TOOL_CACHE_NAME, - version4, + version3, arch3 ); - return { cachedToolDir, version: version4 }; + return { cachedToolDir, version: version3 }; } -function getMissingArtifactMessage(version4, arch3, platform2, manifestUrl) { +function getMissingArtifactMessage(version3, arch3, platform2, manifestUrl) { if (manifestUrl === void 0) { - return `Could not find artifact for version ${version4}, arch ${arch3}, platform ${platform2} in ${VERSIONS_MANIFEST_URL} .`; + return `Could not find artifact for version ${version3}, arch ${arch3}, platform ${platform2} in ${VERSIONS_MANIFEST_URL} .`; } - return `manifest-file does not contain version ${version4}, arch ${arch3}, platform ${platform2}.`; + return `manifest-file does not contain version ${version3}, arch ${arch3}, platform ${platform2}.`; } -function resolveChecksum(checkSum2, manifestChecksum) { - return checkSum2 !== void 0 && checkSum2 !== "" ? checkSum2 : manifestChecksum; +function resolveChecksum(checksum, manifestChecksum) { + return checksum !== void 0 && checksum !== "" ? checksum : manifestChecksum; } function getExtension(platform2) { return platform2 === "pc-windows-msvc" ? ".zip" : ".tar.gz"; } -async function resolveVersion(versionInput, manifestUrl, resolutionStrategy2 = "highest") { +async function resolveVersion(versionInput, manifestUrl, resolutionStrategy = "highest") { debug(`Resolving version: ${versionInput}`); const isSimpleMinimumVersionSpecifier = versionInput.includes(">") && !versionInput.includes(","); - const resolveVersionSpecifierToLatest = isSimpleMinimumVersionSpecifier && resolutionStrategy2 === "highest"; + const resolveVersionSpecifierToLatest = isSimpleMinimumVersionSpecifier && resolutionStrategy === "highest"; if (resolveVersionSpecifierToLatest) { info("Found minimum version specifier, using latest version"); } - const version4 = versionInput === "latest" || resolveVersionSpecifierToLatest ? await getLatestVersion(manifestUrl) : versionInput; - if (isExplicitVersion(version4)) { - debug(`Version ${version4} is an explicit version.`); - if (resolveVersionSpecifierToLatest && !pep440.satisfies(version4, versionInput)) { + const version3 = versionInput === "latest" || resolveVersionSpecifierToLatest ? await getLatestVersion(manifestUrl) : versionInput; + if (isExplicitVersion(version3)) { + debug(`Version ${version3} is an explicit version.`); + if (resolveVersionSpecifierToLatest && !pep440.satisfies(version3, versionInput)) { throw new Error(`No version found for ${versionInput}`); } - return version4; + return version3; } const availableVersions = await getAvailableVersions(manifestUrl); debug(`Available versions: ${availableVersions}`); - const resolvedVersion = resolutionStrategy2 === "lowest" ? minSatisfying3(availableVersions, version4) : maxSatisfying2(availableVersions, version4); + const resolvedVersion = resolutionStrategy === "lowest" ? minSatisfying3(availableVersions, version3) : maxSatisfying2(availableVersions, version3); if (resolvedVersion === void 0) { - throw new Error(`No version found for ${version4}`); + throw new Error(`No version found for ${version3}`); } return resolvedVersion; } @@ -96732,13 +95817,13 @@ async function getAvailableVersions(manifestUrl) { } return await getAllVersions(manifestUrl); } -function maxSatisfying2(versions, version4) { - const maxSemver = evaluateVersions(versions, version4); +function maxSatisfying2(versions, version3) { + const maxSemver = evaluateVersions(versions, version3); if (maxSemver !== "") { debug(`Found a version that satisfies the semver range: ${maxSemver}`); return maxSemver; } - const maxPep440 = pep440.maxSatisfying(versions, version4); + const maxPep440 = pep440.maxSatisfying(versions, version3); if (maxPep440 !== null) { debug( `Found a version that satisfies the pep440 specifier: ${maxPep440}` @@ -96747,13 +95832,13 @@ function maxSatisfying2(versions, version4) { } return void 0; } -function minSatisfying3(versions, version4) { - const minSemver = semver5.minSatisfying(versions, version4); +function minSatisfying3(versions, version3) { + const minSemver = semver5.minSatisfying(versions, version3); if (minSemver !== null) { debug(`Found a version that satisfies the semver range: ${minSemver}`); return minSemver; } - const minPep440 = pep440.minSatisfying(versions, version4); + const minPep440 = pep440.minSatisfying(versions, version3); if (minPep440 !== null) { debug( `Found a version that satisfies the pep440 specifier: ${minPep440}` @@ -96763,6 +95848,965 @@ function minSatisfying3(versions, version4) { return void 0; } +// src/utils/inputs.ts +var import_node_path = __toESM(require("node:path"), 1); + +// src/utils/config-file.ts +var import_node_fs4 = __toESM(require("node:fs"), 1); + +// node_modules/smol-toml/dist/error.js +function getLineColFromPtr(string, ptr) { + let lines = string.slice(0, ptr).split(/\r\n|\n|\r/g); + return [lines.length, lines.pop().length + 1]; +} +function makeCodeBlock(string, line, column) { + let lines = string.split(/\r\n|\n|\r/g); + let codeblock = ""; + let numberLen = (Math.log10(line + 1) | 0) + 1; + for (let i = line - 1; i <= line + 1; i++) { + let l = lines[i - 1]; + if (!l) + continue; + codeblock += i.toString().padEnd(numberLen, " "); + codeblock += ": "; + codeblock += l; + codeblock += "\n"; + if (i === line) { + codeblock += " ".repeat(numberLen + column + 2); + codeblock += "^\n"; + } + } + return codeblock; +} +var TomlError = class extends Error { + line; + column; + codeblock; + constructor(message, options) { + const [line, column] = getLineColFromPtr(options.toml, options.ptr); + const codeblock = makeCodeBlock(options.toml, line, column); + super(`Invalid TOML document: ${message} + +${codeblock}`, options); + this.line = line; + this.column = column; + this.codeblock = codeblock; + } +}; + +// node_modules/smol-toml/dist/util.js +function isEscaped(str, ptr) { + let i = 0; + while (str[ptr - ++i] === "\\") + ; + return --i && i % 2; +} +function indexOfNewline(str, start = 0, end = str.length) { + let idx = str.indexOf("\n", start); + if (str[idx - 1] === "\r") + idx--; + return idx <= end ? idx : -1; +} +function skipComment(str, ptr) { + for (let i = ptr; i < str.length; i++) { + let c = str[i]; + if (c === "\n") + return i; + if (c === "\r" && str[i + 1] === "\n") + return i + 1; + if (c < " " && c !== " " || c === "\x7F") { + throw new TomlError("control characters are not allowed in comments", { + toml: str, + ptr + }); + } + } + return str.length; +} +function skipVoid(str, ptr, banNewLines, banComments) { + let c; + while ((c = str[ptr]) === " " || c === " " || !banNewLines && (c === "\n" || c === "\r" && str[ptr + 1] === "\n")) + ptr++; + return banComments || c !== "#" ? ptr : skipVoid(str, skipComment(str, ptr), banNewLines); +} +function skipUntil(str, ptr, sep8, end, banNewLines = false) { + if (!end) { + ptr = indexOfNewline(str, ptr); + return ptr < 0 ? str.length : ptr; + } + for (let i = ptr; i < str.length; i++) { + let c = str[i]; + if (c === "#") { + i = indexOfNewline(str, i); + } else if (c === sep8) { + return i + 1; + } else if (c === end || banNewLines && (c === "\n" || c === "\r" && str[i + 1] === "\n")) { + return i; + } + } + throw new TomlError("cannot find end of structure", { + toml: str, + ptr + }); +} +function getStringEnd(str, seek) { + let first = str[seek]; + let target = first === str[seek + 1] && str[seek + 1] === str[seek + 2] ? str.slice(seek, seek + 3) : first; + seek += target.length - 1; + do + seek = str.indexOf(target, ++seek); + while (seek > -1 && first !== "'" && isEscaped(str, seek)); + if (seek > -1) { + seek += target.length; + if (target.length > 1) { + if (str[seek] === first) + seek++; + if (str[seek] === first) + seek++; + } + } + return seek; +} + +// node_modules/smol-toml/dist/date.js +var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i; +var TomlDate = class _TomlDate extends Date { + #hasDate = false; + #hasTime = false; + #offset = null; + constructor(date) { + let hasDate = true; + let hasTime = true; + let offset = "Z"; + if (typeof date === "string") { + let match2 = date.match(DATE_TIME_RE); + if (match2) { + if (!match2[1]) { + hasDate = false; + date = `0000-01-01T${date}`; + } + hasTime = !!match2[2]; + hasTime && date[10] === " " && (date = date.replace(" ", "T")); + if (match2[2] && +match2[2] > 23) { + date = ""; + } else { + offset = match2[3] || null; + date = date.toUpperCase(); + if (!offset && hasTime) + date += "Z"; + } + } else { + date = ""; + } + } + super(date); + if (!isNaN(this.getTime())) { + this.#hasDate = hasDate; + this.#hasTime = hasTime; + this.#offset = offset; + } + } + isDateTime() { + return this.#hasDate && this.#hasTime; + } + isLocal() { + return !this.#hasDate || !this.#hasTime || !this.#offset; + } + isDate() { + return this.#hasDate && !this.#hasTime; + } + isTime() { + return this.#hasTime && !this.#hasDate; + } + isValid() { + return this.#hasDate || this.#hasTime; + } + toISOString() { + let iso = super.toISOString(); + if (this.isDate()) + return iso.slice(0, 10); + if (this.isTime()) + return iso.slice(11, 23); + if (this.#offset === null) + return iso.slice(0, -1); + if (this.#offset === "Z") + return iso; + let offset = +this.#offset.slice(1, 3) * 60 + +this.#offset.slice(4, 6); + offset = this.#offset[0] === "-" ? offset : -offset; + let offsetDate = new Date(this.getTime() - offset * 6e4); + return offsetDate.toISOString().slice(0, -1) + this.#offset; + } + static wrapAsOffsetDateTime(jsDate, offset = "Z") { + let date = new _TomlDate(jsDate); + date.#offset = offset; + return date; + } + static wrapAsLocalDateTime(jsDate) { + let date = new _TomlDate(jsDate); + date.#offset = null; + return date; + } + static wrapAsLocalDate(jsDate) { + let date = new _TomlDate(jsDate); + date.#hasTime = false; + date.#offset = null; + return date; + } + static wrapAsLocalTime(jsDate) { + let date = new _TomlDate(jsDate); + date.#hasDate = false; + date.#offset = null; + return date; + } +}; + +// node_modules/smol-toml/dist/primitive.js +var INT_REGEX = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/; +var FLOAT_REGEX = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/; +var LEADING_ZERO = /^[+-]?0[0-9_]/; +var ESCAPE_REGEX = /^[0-9a-f]{2,8}$/i; +var ESC_MAP = { + b: "\b", + t: " ", + n: "\n", + f: "\f", + r: "\r", + e: "\x1B", + '"': '"', + "\\": "\\" +}; +function parseString(str, ptr = 0, endPtr = str.length) { + let isLiteral = str[ptr] === "'"; + let isMultiline = str[ptr++] === str[ptr] && str[ptr] === str[ptr + 1]; + if (isMultiline) { + endPtr -= 2; + if (str[ptr += 2] === "\r") + ptr++; + if (str[ptr] === "\n") + ptr++; + } + let tmp = 0; + let isEscape; + let parsed = ""; + let sliceStart = ptr; + while (ptr < endPtr - 1) { + let c = str[ptr++]; + if (c === "\n" || c === "\r" && str[ptr] === "\n") { + if (!isMultiline) { + throw new TomlError("newlines are not allowed in strings", { + toml: str, + ptr: ptr - 1 + }); + } + } else if (c < " " && c !== " " || c === "\x7F") { + throw new TomlError("control characters are not allowed in strings", { + toml: str, + ptr: ptr - 1 + }); + } + if (isEscape) { + isEscape = false; + if (c === "x" || c === "u" || c === "U") { + let code = str.slice(ptr, ptr += c === "x" ? 2 : c === "u" ? 4 : 8); + if (!ESCAPE_REGEX.test(code)) { + throw new TomlError("invalid unicode escape", { + toml: str, + ptr: tmp + }); + } + try { + parsed += String.fromCodePoint(parseInt(code, 16)); + } catch { + throw new TomlError("invalid unicode escape", { + toml: str, + ptr: tmp + }); + } + } else if (isMultiline && (c === "\n" || c === " " || c === " " || c === "\r")) { + ptr = skipVoid(str, ptr - 1, true); + if (str[ptr] !== "\n" && str[ptr] !== "\r") { + throw new TomlError("invalid escape: only line-ending whitespace may be escaped", { + toml: str, + ptr: tmp + }); + } + ptr = skipVoid(str, ptr); + } else if (c in ESC_MAP) { + parsed += ESC_MAP[c]; + } else { + throw new TomlError("unrecognized escape sequence", { + toml: str, + ptr: tmp + }); + } + sliceStart = ptr; + } else if (!isLiteral && c === "\\") { + tmp = ptr - 1; + isEscape = true; + parsed += str.slice(sliceStart, tmp); + } + } + return parsed + str.slice(sliceStart, endPtr - 1); +} +function parseValue2(value, toml, ptr, integersAsBigInt) { + if (value === "true") + return true; + if (value === "false") + return false; + if (value === "-inf") + return -Infinity; + if (value === "inf" || value === "+inf") + return Infinity; + if (value === "nan" || value === "+nan" || value === "-nan") + return NaN; + if (value === "-0") + return integersAsBigInt ? 0n : 0; + let isInt = INT_REGEX.test(value); + if (isInt || FLOAT_REGEX.test(value)) { + if (LEADING_ZERO.test(value)) { + throw new TomlError("leading zeroes are not allowed", { + toml, + ptr + }); + } + value = value.replace(/_/g, ""); + let numeric = +value; + if (isNaN(numeric)) { + throw new TomlError("invalid number", { + toml, + ptr + }); + } + if (isInt) { + if ((isInt = !Number.isSafeInteger(numeric)) && !integersAsBigInt) { + throw new TomlError("integer value cannot be represented losslessly", { + toml, + ptr + }); + } + if (isInt || integersAsBigInt === true) + numeric = BigInt(value); + } + return numeric; + } + const date = new TomlDate(value); + if (!date.isValid()) { + throw new TomlError("invalid value", { + toml, + ptr + }); + } + return date; +} + +// node_modules/smol-toml/dist/extract.js +function sliceAndTrimEndOf(str, startPtr, endPtr) { + let value = str.slice(startPtr, endPtr); + let commentIdx = value.indexOf("#"); + if (commentIdx > -1) { + skipComment(str, commentIdx); + value = value.slice(0, commentIdx); + } + return [value.trimEnd(), commentIdx]; +} +function extractValue(str, ptr, end, depth, integersAsBigInt) { + if (depth === 0) { + throw new TomlError("document contains excessively nested structures. aborting.", { + toml: str, + ptr + }); + } + let c = str[ptr]; + if (c === "[" || c === "{") { + let [value, endPtr2] = c === "[" ? parseArray(str, ptr, depth, integersAsBigInt) : parseInlineTable(str, ptr, depth, integersAsBigInt); + if (end) { + endPtr2 = skipVoid(str, endPtr2); + if (str[endPtr2] === ",") + endPtr2++; + else if (str[endPtr2] !== end) { + throw new TomlError("expected comma or end of structure", { + toml: str, + ptr: endPtr2 + }); + } + } + return [value, endPtr2]; + } + let endPtr; + if (c === '"' || c === "'") { + endPtr = getStringEnd(str, ptr); + let parsed = parseString(str, ptr, endPtr); + if (end) { + endPtr = skipVoid(str, endPtr); + if (str[endPtr] && str[endPtr] !== "," && str[endPtr] !== end && str[endPtr] !== "\n" && str[endPtr] !== "\r") { + throw new TomlError("unexpected character encountered", { + toml: str, + ptr: endPtr + }); + } + endPtr += +(str[endPtr] === ","); + } + return [parsed, endPtr]; + } + endPtr = skipUntil(str, ptr, ",", end); + let slice = sliceAndTrimEndOf(str, ptr, endPtr - +(str[endPtr - 1] === ",")); + if (!slice[0]) { + throw new TomlError("incomplete key-value declaration: no value specified", { + toml: str, + ptr + }); + } + if (end && slice[1] > -1) { + endPtr = skipVoid(str, ptr + slice[1]); + endPtr += +(str[endPtr] === ","); + } + return [ + parseValue2(slice[0], str, ptr, integersAsBigInt), + endPtr + ]; +} + +// node_modules/smol-toml/dist/struct.js +var KEY_PART_RE = /^[a-zA-Z0-9-_]+[ \t]*$/; +function parseKey(str, ptr, end = "=") { + let dot = ptr - 1; + let parsed = []; + let endPtr = str.indexOf(end, ptr); + if (endPtr < 0) { + throw new TomlError("incomplete key-value: cannot find end of key", { + toml: str, + ptr + }); + } + do { + let c = str[ptr = ++dot]; + if (c !== " " && c !== " ") { + if (c === '"' || c === "'") { + if (c === str[ptr + 1] && c === str[ptr + 2]) { + throw new TomlError("multiline strings are not allowed in keys", { + toml: str, + ptr + }); + } + let eos = getStringEnd(str, ptr); + if (eos < 0) { + throw new TomlError("unfinished string encountered", { + toml: str, + ptr + }); + } + dot = str.indexOf(".", eos); + let strEnd = str.slice(eos, dot < 0 || dot > endPtr ? endPtr : dot); + let newLine = indexOfNewline(strEnd); + if (newLine > -1) { + throw new TomlError("newlines are not allowed in keys", { + toml: str, + ptr: ptr + dot + newLine + }); + } + if (strEnd.trimStart()) { + throw new TomlError("found extra tokens after the string part", { + toml: str, + ptr: eos + }); + } + if (endPtr < eos) { + endPtr = str.indexOf(end, eos); + if (endPtr < 0) { + throw new TomlError("incomplete key-value: cannot find end of key", { + toml: str, + ptr + }); + } + } + parsed.push(parseString(str, ptr, eos)); + } else { + dot = str.indexOf(".", ptr); + let part = str.slice(ptr, dot < 0 || dot > endPtr ? endPtr : dot); + if (!KEY_PART_RE.test(part)) { + throw new TomlError("only letter, numbers, dashes and underscores are allowed in keys", { + toml: str, + ptr + }); + } + parsed.push(part.trimEnd()); + } + } + } while (dot + 1 && dot < endPtr); + return [parsed, skipVoid(str, endPtr + 1, true, true)]; +} +function parseInlineTable(str, ptr, depth, integersAsBigInt) { + let res = {}; + let seen = /* @__PURE__ */ new Set(); + let c; + ptr++; + while ((c = str[ptr++]) !== "}" && c) { + if (c === ",") { + throw new TomlError("expected value, found comma", { + toml: str, + ptr: ptr - 1 + }); + } else if (c === "#") + ptr = skipComment(str, ptr); + else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { + let k; + let t = res; + let hasOwn = false; + let [key, keyEndPtr] = parseKey(str, ptr - 1); + for (let i = 0; i < key.length; i++) { + if (i) + t = hasOwn ? t[k] : t[k] = {}; + k = key[i]; + if ((hasOwn = Object.hasOwn(t, k)) && (typeof t[k] !== "object" || seen.has(t[k]))) { + throw new TomlError("trying to redefine an already defined value", { + toml: str, + ptr + }); + } + if (!hasOwn && k === "__proto__") { + Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); + } + } + if (hasOwn) { + throw new TomlError("trying to redefine an already defined value", { + toml: str, + ptr + }); + } + let [value, valueEndPtr] = extractValue(str, keyEndPtr, "}", depth - 1, integersAsBigInt); + seen.add(value); + t[k] = value; + ptr = valueEndPtr; + } + } + if (!c) { + throw new TomlError("unfinished table encountered", { + toml: str, + ptr + }); + } + return [res, ptr]; +} +function parseArray(str, ptr, depth, integersAsBigInt) { + let res = []; + let c; + ptr++; + while ((c = str[ptr++]) !== "]" && c) { + if (c === ",") { + throw new TomlError("expected value, found comma", { + toml: str, + ptr: ptr - 1 + }); + } else if (c === "#") + ptr = skipComment(str, ptr); + else if (c !== " " && c !== " " && c !== "\n" && c !== "\r") { + let e = extractValue(str, ptr - 1, "]", depth - 1, integersAsBigInt); + res.push(e[0]); + ptr = e[1]; + } + } + if (!c) { + throw new TomlError("unfinished array encountered", { + toml: str, + ptr + }); + } + return [res, ptr]; +} + +// node_modules/smol-toml/dist/parse.js +function peekTable(key, table, meta, type) { + let t = table; + let m = meta; + let k; + let hasOwn = false; + let state3; + for (let i = 0; i < key.length; i++) { + if (i) { + t = hasOwn ? t[k] : t[k] = {}; + m = (state3 = m[k]).c; + if (type === 0 && (state3.t === 1 || state3.t === 2)) { + return null; + } + if (state3.t === 2) { + let l = t.length - 1; + t = t[l]; + m = m[l].c; + } + } + k = key[i]; + if ((hasOwn = Object.hasOwn(t, k)) && m[k]?.t === 0 && m[k]?.d) { + return null; + } + if (!hasOwn) { + if (k === "__proto__") { + Object.defineProperty(t, k, { enumerable: true, configurable: true, writable: true }); + Object.defineProperty(m, k, { enumerable: true, configurable: true, writable: true }); + } + m[k] = { + t: i < key.length - 1 && type === 2 ? 3 : type, + d: false, + i: 0, + c: {} + }; + } + } + state3 = m[k]; + if (state3.t !== type && !(type === 1 && state3.t === 3)) { + return null; + } + if (type === 2) { + if (!state3.d) { + state3.d = true; + t[k] = []; + } + t[k].push(t = {}); + state3.c[state3.i++] = state3 = { t: 1, d: false, i: 0, c: {} }; + } + if (state3.d) { + return null; + } + state3.d = true; + if (type === 1) { + t = hasOwn ? t[k] : t[k] = {}; + } else if (type === 0 && hasOwn) { + return null; + } + return [k, t, state3.c]; +} +function parse2(toml, { maxDepth = 1e3, integersAsBigInt } = {}) { + let res = {}; + let meta = {}; + let tbl = res; + let m = meta; + for (let ptr = skipVoid(toml, 0); ptr < toml.length; ) { + if (toml[ptr] === "[") { + let isTableArray = toml[++ptr] === "["; + let k = parseKey(toml, ptr += +isTableArray, "]"); + if (isTableArray) { + if (toml[k[1] - 1] !== "]") { + throw new TomlError("expected end of table declaration", { + toml, + ptr: k[1] - 1 + }); + } + k[1]++; + } + let p = peekTable( + k[0], + res, + meta, + isTableArray ? 2 : 1 + /* Type.EXPLICIT */ + ); + if (!p) { + throw new TomlError("trying to redefine an already defined table or value", { + toml, + ptr + }); + } + m = p[2]; + tbl = p[1]; + ptr = k[1]; + } else { + let k = parseKey(toml, ptr); + let p = peekTable( + k[0], + tbl, + m, + 0 + /* Type.DOTTED */ + ); + if (!p) { + throw new TomlError("trying to redefine an already defined table or value", { + toml, + ptr + }); + } + let v = extractValue(toml, k[1], void 0, maxDepth, integersAsBigInt); + p[1][p[0]] = v[0]; + ptr = v[1]; + } + ptr = skipVoid(toml, ptr, true); + if (toml[ptr] && toml[ptr] !== "\n" && toml[ptr] !== "\r") { + throw new TomlError("each key-value declaration must be followed by an end-of-line", { + toml, + ptr + }); + } + ptr = skipVoid(toml, ptr); + } + return res; +} + +// src/utils/config-file.ts +function getConfigValueFromTomlFile(filePath, key) { + if (!import_node_fs4.default.existsSync(filePath) || !filePath.endsWith(".toml")) { + return void 0; + } + const fileContent = import_node_fs4.default.readFileSync(filePath, "utf-8"); + if (filePath.endsWith("pyproject.toml")) { + const tomlContent2 = parse2(fileContent); + return tomlContent2?.tool?.uv?.[key]; + } + const tomlContent = parse2(fileContent); + return tomlContent[key]; +} + +// src/utils/inputs.ts +function loadInputs() { + const workingDirectory = getInput("working-directory"); + const version3 = getInput("version"); + const versionFile = getVersionFile( + workingDirectory, + getInput("version-file") + ); + const pythonVersion = getInput("python-version"); + const activateEnvironment2 = getBooleanInput("activate-environment"); + const venvPath = getVenvPath( + workingDirectory, + getInput("venv-path"), + activateEnvironment2 + ); + const checksum = getInput("checksum"); + const enableCache = getEnableCache(getInput("enable-cache")); + const restoreCache3 = getInput("restore-cache") === "true"; + const saveCache2 = getInput("save-cache") === "true"; + const cacheSuffix = getInput("cache-suffix") || ""; + const cacheLocalPath = getCacheLocalPath( + workingDirectory, + versionFile, + enableCache + ); + const cacheDependencyGlob = getCacheDependencyGlob( + workingDirectory, + getInput("cache-dependency-glob") + ); + const pruneCache = getInput("prune-cache") === "true"; + const cachePython = getInput("cache-python") === "true"; + const ignoreNothingToCache = getInput("ignore-nothing-to-cache") === "true"; + const ignoreEmptyWorkdir = getInput("ignore-empty-workdir") === "true"; + const toolBinDir = getToolBinDir( + workingDirectory, + getInput("tool-bin-dir") + ); + const toolDir = getToolDir(workingDirectory, getInput("tool-dir")); + const pythonDir = getUvPythonDir(); + const githubToken = getInput("github-token"); + const manifestFile = getManifestFile(getInput("manifest-file")); + const addProblemMatchers = getInput("add-problem-matchers") === "true"; + const resolutionStrategy = getResolutionStrategy( + getInput("resolution-strategy") + ); + return { + activateEnvironment: activateEnvironment2, + addProblemMatchers, + cacheDependencyGlob, + cacheLocalPath, + cachePython, + cacheSuffix, + checksum, + enableCache, + githubToken, + ignoreEmptyWorkdir, + ignoreNothingToCache, + manifestFile, + pruneCache, + pythonDir, + pythonVersion, + resolutionStrategy, + restoreCache: restoreCache3, + saveCache: saveCache2, + toolBinDir, + toolDir, + venvPath, + version: version3, + versionFile, + workingDirectory + }; +} +function getVersionFile(workingDirectory, versionFileInput) { + if (versionFileInput !== "") { + const tildeExpanded = expandTilde(versionFileInput); + return resolveRelativePath(workingDirectory, tildeExpanded); + } + return versionFileInput; +} +function getVenvPath(workingDirectory, venvPathInput, activateEnvironment2) { + if (venvPathInput !== "") { + if (!activateEnvironment2) { + warning("venv-path is only used when activate-environment is true"); + } + const tildeExpanded = expandTilde(venvPathInput); + return normalizePath(resolveRelativePath(workingDirectory, tildeExpanded)); + } + return normalizePath(resolveRelativePath(workingDirectory, ".venv")); +} +function getEnableCache(enableCacheInput) { + if (enableCacheInput === "auto") { + return process.env.RUNNER_ENVIRONMENT === "github-hosted"; + } + return enableCacheInput === "true"; +} +function getToolBinDir(workingDirectory, toolBinDirInput) { + if (toolBinDirInput !== "") { + const tildeExpanded = expandTilde(toolBinDirInput); + return resolveRelativePath(workingDirectory, tildeExpanded); + } + if (process.platform === "win32") { + if (process.env.RUNNER_TEMP !== void 0) { + return `${process.env.RUNNER_TEMP}${import_node_path.default.sep}uv-tool-bin-dir`; + } + throw Error( + "Could not determine UV_TOOL_BIN_DIR. Please make sure RUNNER_TEMP is set or provide the tool-bin-dir input" + ); + } + return void 0; +} +function getToolDir(workingDirectory, toolDirInput) { + if (toolDirInput !== "") { + const tildeExpanded = expandTilde(toolDirInput); + return resolveRelativePath(workingDirectory, tildeExpanded); + } + if (process.platform === "win32") { + if (process.env.RUNNER_TEMP !== void 0) { + return `${process.env.RUNNER_TEMP}${import_node_path.default.sep}uv-tool-dir`; + } + throw Error( + "Could not determine UV_TOOL_DIR. Please make sure RUNNER_TEMP is set or provide the tool-dir input" + ); + } + return void 0; +} +function getCacheLocalPath(workingDirectory, versionFile, enableCache) { + const cacheLocalPathInput = getInput("cache-local-path"); + if (cacheLocalPathInput !== "") { + const tildeExpanded = expandTilde(cacheLocalPathInput); + return { + path: resolveRelativePath(workingDirectory, tildeExpanded), + source: 0 /* Input */ + }; + } + const cacheDirFromConfig = getCacheDirFromConfig( + workingDirectory, + versionFile + ); + if (cacheDirFromConfig !== void 0) { + return { path: cacheDirFromConfig, source: 1 /* Config */ }; + } + if (process.env.UV_CACHE_DIR !== void 0) { + info(`UV_CACHE_DIR is already set to ${process.env.UV_CACHE_DIR}`); + return { path: process.env.UV_CACHE_DIR, source: 2 /* Env */ }; + } + if (enableCache) { + if (process.env.RUNNER_ENVIRONMENT === "github-hosted") { + if (process.env.RUNNER_TEMP !== void 0) { + return { + path: `${process.env.RUNNER_TEMP}${import_node_path.default.sep}setup-uv-cache`, + source: 3 /* Default */ + }; + } + throw Error( + "Could not determine UV_CACHE_DIR. Please make sure RUNNER_TEMP is set or provide the cache-local-path input" + ); + } + if (process.platform === "win32") { + return { + path: `${process.env.APPDATA}${import_node_path.default.sep}uv${import_node_path.default.sep}cache`, + source: 3 /* Default */ + }; + } + return { + path: `${process.env.HOME}${import_node_path.default.sep}.cache${import_node_path.default.sep}uv`, + source: 3 /* Default */ + }; + } +} +function getCacheDirFromConfig(workingDirectory, versionFile) { + for (const filePath of [versionFile, "uv.toml", "pyproject.toml"]) { + const resolvedPath = resolveRelativePath(workingDirectory, filePath); + try { + const cacheDir2 = getConfigValueFromTomlFile(resolvedPath, "cache-dir"); + if (cacheDir2 !== void 0) { + info(`Found cache-dir in ${resolvedPath}: ${cacheDir2}`); + return cacheDir2; + } + } catch (err) { + const message = err.message; + warning(`Error while parsing ${filePath}: ${message}`); + return void 0; + } + } + return void 0; +} +function getUvPythonDir() { + if (process.env.UV_PYTHON_INSTALL_DIR !== void 0) { + info( + `UV_PYTHON_INSTALL_DIR is already set to ${process.env.UV_PYTHON_INSTALL_DIR}` + ); + return process.env.UV_PYTHON_INSTALL_DIR; + } + if (process.env.RUNNER_ENVIRONMENT !== "github-hosted") { + if (process.platform === "win32") { + return `${process.env.APPDATA}${import_node_path.default.sep}uv${import_node_path.default.sep}python`; + } + return `${process.env.HOME}${import_node_path.default.sep}.local${import_node_path.default.sep}share${import_node_path.default.sep}uv${import_node_path.default.sep}python`; + } + if (process.env.RUNNER_TEMP !== void 0) { + return `${process.env.RUNNER_TEMP}${import_node_path.default.sep}uv-python-dir`; + } + throw Error( + "Could not determine UV_PYTHON_INSTALL_DIR. Please make sure RUNNER_TEMP is set or provide the UV_PYTHON_INSTALL_DIR environment variable" + ); +} +function getCacheDependencyGlob(workingDirectory, cacheDependencyGlobInput) { + if (cacheDependencyGlobInput !== "") { + return cacheDependencyGlobInput.split("\n").map((part) => part.trim()).map((part) => expandTilde(part)).map((part) => resolveRelativePath(workingDirectory, part)).join("\n"); + } + return cacheDependencyGlobInput; +} +function expandTilde(input) { + if (input.startsWith("~")) { + return `${process.env.HOME}${input.substring(1)}`; + } + return input; +} +function normalizePath(inputPath) { + const normalized = import_node_path.default.normalize(inputPath); + const root = import_node_path.default.parse(normalized).root; + let trimmed = normalized; + while (trimmed.length > root.length && trimmed.endsWith(import_node_path.default.sep)) { + trimmed = trimmed.slice(0, -1); + } + return trimmed; +} +function resolveRelativePath(workingDirectory, inputPath) { + const hasNegation = inputPath.startsWith("!"); + const pathWithoutNegation = hasNegation ? inputPath.substring(1) : inputPath; + const resolvedPath = import_node_path.default.resolve(workingDirectory, pathWithoutNegation); + debug( + `Resolving relative path ${inputPath} to ${hasNegation ? "!" : ""}${resolvedPath}` + ); + return hasNegation ? `!${resolvedPath}` : resolvedPath; +} +function getManifestFile(manifestFileInput) { + if (manifestFileInput !== "") { + return manifestFileInput; + } + return void 0; +} +function getResolutionStrategy(resolutionStrategyInput) { + if (resolutionStrategyInput === "lowest") { + return "lowest"; + } + if (resolutionStrategyInput === "highest" || resolutionStrategyInput === "") { + return "highest"; + } + throw new Error( + `Invalid resolution-strategy: ${resolutionStrategyInput}. Must be 'highest' or 'lowest'.` + ); +} + // src/version/resolve.ts var import_node_fs7 = __toESM(require("node:fs"), 1); @@ -96850,9 +96894,9 @@ function getUvVersionFromFile(filePath) { // src/setup-uv.ts var sourceDir = __dirname; -async function getPythonVersion() { - if (pythonVersion !== "") { - return pythonVersion; +async function getPythonVersion(inputs) { + if (inputs.pythonVersion !== "") { + return inputs.pythonVersion; } let output = ""; const options = { @@ -96864,7 +96908,7 @@ async function getPythonVersion() { silent: !isDebug() }; try { - const execArgs = ["python", "find", "--directory", workingDirectory]; + const execArgs = ["python", "find", "--directory", inputs.workingDirectory]; await exec("uv", execArgs, options); const pythonPath = output.trim(); output = ""; @@ -96877,32 +96921,33 @@ async function getPythonVersion() { } } async function run() { - detectEmptyWorkdir(); - const platform2 = await getPlatform(); - const arch3 = getArch(); try { + const inputs = loadInputs(); + detectEmptyWorkdir(inputs); + const platform2 = await getPlatform(); + const arch3 = getArch(); if (platform2 === void 0) { throw new Error(`Unsupported platform: ${process.platform}`); } if (arch3 === void 0) { throw new Error(`Unsupported architecture: ${process.arch}`); } - const setupResult = await setupUv(platform2, arch3, checkSum, githubToken); - addToolBinToPath(); + const setupResult = await setupUv(inputs, platform2, arch3); + addToolBinToPath(inputs); addUvToPathAndOutput(setupResult.uvDir); - setToolDir(); - addPythonDirToPath(); - setupPython(); - await activateEnvironment2(); - addMatchers(); - setCacheDir(); + setToolDir(inputs); + addPythonDirToPath(inputs); + setupPython(inputs); + await activateEnvironment(inputs); + addMatchers(inputs); + setCacheDir(inputs); setOutput("uv-version", setupResult.version); saveState(STATE_UV_VERSION, setupResult.version); info(`Successfully installed uv version ${setupResult.version}`); - const pythonVersion2 = await getPythonVersion(); - setOutput("python-version", pythonVersion2); - if (enableCache) { - await restoreCache3(pythonVersion2); + const detectedPythonVersion = await getPythonVersion(inputs); + setOutput("python-version", detectedPythonVersion); + if (inputs.enableCache) { + await restoreCache2(inputs, detectedPythonVersion); } await new Promise((resolve3) => setTimeout(resolve3, 50)); process.exit(0); @@ -96910,9 +96955,9 @@ async function run() { setFailed(err.message); } } -function detectEmptyWorkdir() { - if (import_node_fs8.default.readdirSync(workingDirectory).length === 0) { - if (ignoreEmptyWorkdir) { +function detectEmptyWorkdir(inputs) { + if (import_node_fs8.default.readdirSync(inputs.workingDirectory).length === 0) { + if (inputs.ignoreEmptyWorkdir) { info( "Empty workdir detected. Ignoring because ignore-empty-workdir is enabled" ); @@ -96923,8 +96968,8 @@ function detectEmptyWorkdir() { } } } -async function setupUv(platform2, arch3, checkSum2, githubToken2) { - const resolvedVersion = await determineVersion(); +async function setupUv(inputs, platform2, arch3) { + const resolvedVersion = await determineVersion(inputs); const toolCacheResult = tryGetFromToolCache(arch3, resolvedVersion); if (toolCacheResult.installedPath) { info(`Found uv in tool-cache for ${toolCacheResult.version}`); @@ -96937,40 +96982,40 @@ async function setupUv(platform2, arch3, checkSum2, githubToken2) { platform2, arch3, resolvedVersion, - checkSum2, - githubToken2, - manifestFile + inputs.checksum, + inputs.githubToken, + inputs.manifestFile ); return { uvDir: downloadResult.cachedToolDir, version: downloadResult.version }; } -async function determineVersion() { +async function determineVersion(inputs) { return await resolveVersion( - getRequestedVersion(), - manifestFile, - resolutionStrategy + getRequestedVersion(inputs), + inputs.manifestFile, + inputs.resolutionStrategy ); } -function getRequestedVersion() { - if (version3 !== "") { - return version3; +function getRequestedVersion(inputs) { + if (inputs.version !== "") { + return inputs.version; } - if (versionFile !== "") { - const versionFromFile = getUvVersionFromFile(versionFile); + if (inputs.versionFile !== "") { + const versionFromFile = getUvVersionFromFile(inputs.versionFile); if (versionFromFile === void 0) { throw new Error( - `Could not determine uv version from file: ${versionFile}` + `Could not determine uv version from file: ${inputs.versionFile}` ); } return versionFromFile; } const versionFromUvToml = getUvVersionFromFile( - `${workingDirectory}${path15.sep}uv.toml` + `${inputs.workingDirectory}${path15.sep}uv.toml` ); const versionFromPyproject = getUvVersionFromFile( - `${workingDirectory}${path15.sep}pyproject.toml` + `${inputs.workingDirectory}${path15.sep}pyproject.toml` ); if (versionFromUvToml === void 0 && versionFromPyproject === void 0) { info( @@ -96990,15 +97035,17 @@ function addUvToPathAndOutput(cachedPath) { info(`Added ${cachedPath} to the path`); } } -function addToolBinToPath() { - if (toolBinDir !== void 0) { - exportVariable("UV_TOOL_BIN_DIR", toolBinDir); - info(`Set UV_TOOL_BIN_DIR to ${toolBinDir}`); +function addToolBinToPath(inputs) { + if (inputs.toolBinDir !== void 0) { + exportVariable("UV_TOOL_BIN_DIR", inputs.toolBinDir); + info(`Set UV_TOOL_BIN_DIR to ${inputs.toolBinDir}`); if (process.env.UV_NO_MODIFY_PATH !== void 0) { - info(`UV_NO_MODIFY_PATH is set, not adding ${toolBinDir} to path`); + info( + `UV_NO_MODIFY_PATH is set, not adding ${inputs.toolBinDir} to path` + ); } else { - addPath(toolBinDir); - info(`Added ${toolBinDir} to the path`); + addPath(inputs.toolBinDir); + info(`Added ${inputs.toolBinDir} to the path`); } } else { if (process.env.UV_NO_MODIFY_PATH !== void 0) { @@ -97017,66 +97064,66 @@ function addToolBinToPath() { } } } -function setToolDir() { - if (toolDir !== void 0) { - exportVariable("UV_TOOL_DIR", toolDir); - info(`Set UV_TOOL_DIR to ${toolDir}`); +function setToolDir(inputs) { + if (inputs.toolDir !== void 0) { + exportVariable("UV_TOOL_DIR", inputs.toolDir); + info(`Set UV_TOOL_DIR to ${inputs.toolDir}`); } } -function addPythonDirToPath() { - exportVariable("UV_PYTHON_INSTALL_DIR", pythonDir); - info(`Set UV_PYTHON_INSTALL_DIR to ${pythonDir}`); +function addPythonDirToPath(inputs) { + exportVariable("UV_PYTHON_INSTALL_DIR", inputs.pythonDir); + info(`Set UV_PYTHON_INSTALL_DIR to ${inputs.pythonDir}`); if (process.env.UV_NO_MODIFY_PATH !== void 0) { info("UV_NO_MODIFY_PATH is set, not adding python dir to path"); } else { - addPath(pythonDir); - info(`Added ${pythonDir} to the path`); + addPath(inputs.pythonDir); + info(`Added ${inputs.pythonDir} to the path`); } } -function setupPython() { - if (pythonVersion !== "") { - exportVariable("UV_PYTHON", pythonVersion); - info(`Set UV_PYTHON to ${pythonVersion}`); +function setupPython(inputs) { + if (inputs.pythonVersion !== "") { + exportVariable("UV_PYTHON", inputs.pythonVersion); + info(`Set UV_PYTHON to ${inputs.pythonVersion}`); } } -async function activateEnvironment2() { - if (activateEnvironment) { +async function activateEnvironment(inputs) { + if (inputs.activateEnvironment) { if (process.env.UV_NO_MODIFY_PATH !== void 0) { throw new Error( "UV_NO_MODIFY_PATH and activate-environment cannot be used together." ); } - info(`Creating and activating python venv at ${venvPath}...`); + info(`Creating and activating python venv at ${inputs.venvPath}...`); await exec("uv", [ "venv", - venvPath, + inputs.venvPath, "--directory", - workingDirectory, + inputs.workingDirectory, "--clear" ]); - let venvBinPath = `${venvPath}${path15.sep}bin`; + let venvBinPath = `${inputs.venvPath}${path15.sep}bin`; if (process.platform === "win32") { - venvBinPath = `${venvPath}${path15.sep}Scripts`; + venvBinPath = `${inputs.venvPath}${path15.sep}Scripts`; } addPath(path15.resolve(venvBinPath)); - exportVariable("VIRTUAL_ENV", venvPath); - setOutput("venv", venvPath); + exportVariable("VIRTUAL_ENV", inputs.venvPath); + setOutput("venv", inputs.venvPath); } } -function setCacheDir() { - if (cacheLocalPath !== void 0) { - if (cacheLocalPath.source === 1 /* Config */) { +function setCacheDir(inputs) { + if (inputs.cacheLocalPath !== void 0) { + if (inputs.cacheLocalPath.source === 1 /* Config */) { info( "Using cache-dir from uv config file, not modifying UV_CACHE_DIR" ); return; } - exportVariable("UV_CACHE_DIR", cacheLocalPath.path); - info(`Set UV_CACHE_DIR to ${cacheLocalPath.path}`); + exportVariable("UV_CACHE_DIR", inputs.cacheLocalPath.path); + info(`Set UV_CACHE_DIR to ${inputs.cacheLocalPath.path}`); } } -function addMatchers() { - if (addProblemMatchers) { +function addMatchers(inputs) { + if (inputs.addProblemMatchers) { const matchersPath = path15.join(sourceDir, "..", "..", ".github"); info(`##[add-matcher]${path15.join(matchersPath, "python.json")}`); } diff --git a/src/cache/restore-cache.ts b/src/cache/restore-cache.ts index a099aad..f2ef11c 100644 --- a/src/cache/restore-cache.ts +++ b/src/cache/restore-cache.ts @@ -1,15 +1,7 @@ import * as cache from "@actions/cache"; import * as core from "@actions/core"; import { hashFiles } from "../hash/hash-files"; -import { - cacheDependencyGlob, - cacheLocalPath, - cachePython, - cacheSuffix, - pruneCache, - pythonDir, - restoreCache as shouldRestoreCache, -} from "../utils/inputs"; +import type { SetupInputs } from "../utils/inputs"; import { getArch, getOSNameVersion, getPlatform } from "../utils/platforms"; export const STATE_CACHE_KEY = "cache-key"; @@ -18,18 +10,21 @@ export const STATE_PYTHON_CACHE_MATCHED_KEY = "python-cache-matched-key"; const CACHE_VERSION = "2"; -export async function restoreCache(pythonVersion?: string): Promise { - const cacheKey = await computeKeys(pythonVersion); +export async function restoreCache( + inputs: SetupInputs, + pythonVersion?: string, +): Promise { + const cacheKey = await computeKeys(inputs, pythonVersion); core.saveState(STATE_CACHE_KEY, cacheKey); core.setOutput("cache-key", cacheKey); - if (!shouldRestoreCache) { + if (!inputs.restoreCache) { core.info("restore-cache is false. Skipping restore cache step."); core.setOutput("python-cache-hit", false); return; } - if (cacheLocalPath === undefined) { + if (inputs.cacheLocalPath === undefined) { throw new Error( "cache-local-path is not set. Cannot restore cache without a valid cache path.", ); @@ -37,15 +32,15 @@ export async function restoreCache(pythonVersion?: string): Promise { await restoreCacheFromKey( cacheKey, - cacheLocalPath.path, + inputs.cacheLocalPath.path, STATE_CACHE_MATCHED_KEY, "cache-hit", ); - if (cachePython) { + if (inputs.cachePython) { await restoreCacheFromKey( `${cacheKey}-python`, - pythonDir, + inputs.pythonDir, STATE_PYTHON_CACHE_MATCHED_KEY, "python-cache-hit", ); @@ -76,28 +71,34 @@ async function restoreCacheFromKey( handleMatchResult(matchedKey, cacheKey, stateKey, outputKey); } -async function computeKeys(pythonVersion?: string): Promise { +async function computeKeys( + inputs: SetupInputs, + pythonVersion?: string, +): Promise { let cacheDependencyPathHash = "-"; - if (cacheDependencyGlob !== "") { + if (inputs.cacheDependencyGlob !== "") { core.info( - `Searching files using cache dependency glob: ${cacheDependencyGlob.split("\n").join(",")}`, + `Searching files using cache dependency glob: ${inputs.cacheDependencyGlob.split("\n").join(",")}`, + ); + cacheDependencyPathHash += await hashFiles( + inputs.cacheDependencyGlob, + true, ); - cacheDependencyPathHash += await hashFiles(cacheDependencyGlob, true); if (cacheDependencyPathHash === "-") { core.warning( - `No file matched to [${cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`, + `No file matched to [${inputs.cacheDependencyGlob.split("\n").join(",")}]. The cache will never get invalidated. Make sure you have checked out the target repository and configured the cache-dependency-glob input correctly.`, ); } } if (cacheDependencyPathHash === "-") { cacheDependencyPathHash = "-no-dependency-glob"; } - const suffix = cacheSuffix ? `-${cacheSuffix}` : ""; + const suffix = inputs.cacheSuffix ? `-${inputs.cacheSuffix}` : ""; const version = pythonVersion ?? "unknown"; const platform = await getPlatform(); const osNameVersion = getOSNameVersion(); - const pruned = pruneCache ? "-pruned" : ""; - const python = cachePython ? "-py" : ""; + const pruned = inputs.pruneCache ? "-pruned" : ""; + const python = inputs.cachePython ? "-py" : ""; return `setup-uv-${CACHE_VERSION}-${getArch()}-${platform}-${osNameVersion}-${version}${pruned}${python}${cacheDependencyPathHash}${suffix}`; } diff --git a/src/download/download-version.ts b/src/download/download-version.ts index 38a60dd..29f40d3 100644 --- a/src/download/download-version.ts +++ b/src/download/download-version.ts @@ -33,7 +33,7 @@ export async function downloadVersion( platform: Platform, arch: Architecture, version: string, - checkSum: string | undefined, + checksum: string | undefined, githubToken: string, manifestUrl?: string, ): Promise<{ version: string; cachedToolDir: string }> { @@ -47,10 +47,10 @@ export async function downloadVersion( // For the default astral-sh/versions source, checksum validation relies on // user input or the built-in KNOWN_CHECKSUMS table, not manifest sha256 values. - const checksum = + const resolvedChecksum = manifestUrl === undefined - ? checkSum - : resolveChecksum(checkSum, artifact.checksum); + ? checksum + : resolveChecksum(checksum, artifact.checksum); const mirrorUrl = rewriteToMirror(artifact.downloadUrl); const downloadUrl = mirrorUrl ?? artifact.downloadUrl; @@ -64,7 +64,7 @@ export async function downloadVersion( platform, arch, version, - checksum, + resolvedChecksum, downloadToken, ); } catch (err) { @@ -82,7 +82,7 @@ export async function downloadVersion( platform, arch, version, - checksum, + resolvedChecksum, githubToken, ); } @@ -161,11 +161,11 @@ function getMissingArtifactMessage( } function resolveChecksum( - checkSum: string | undefined, + checksum: string | undefined, manifestChecksum: string, ): string { - return checkSum !== undefined && checkSum !== "" - ? checkSum + return checksum !== undefined && checksum !== "" + ? checksum : manifestChecksum; } diff --git a/src/save-cache.ts b/src/save-cache.ts index 3872ae9..5921b72 100644 --- a/src/save-cache.ts +++ b/src/save-cache.ts @@ -9,21 +9,14 @@ import { STATE_PYTHON_CACHE_MATCHED_KEY, } from "./cache/restore-cache"; import { STATE_UV_PATH, STATE_UV_VERSION } from "./utils/constants"; -import { - cacheLocalPath, - cachePython, - enableCache, - ignoreNothingToCache, - pythonDir, - pruneCache as shouldPruneCache, - saveCache as shouldSaveCache, -} from "./utils/inputs"; +import { loadInputs, type SetupInputs } from "./utils/inputs"; export async function run(): Promise { try { - if (enableCache) { - if (shouldSaveCache) { - await saveCache(); + const inputs = loadInputs(); + if (inputs.enableCache) { + if (inputs.saveCache) { + await saveCache(inputs); } else { core.info("save-cache is false. Skipping save cache step."); } @@ -43,7 +36,7 @@ export async function run(): Promise { } } -async function saveCache(): Promise { +async function saveCache(inputs: SetupInputs): Promise { const cacheKey = core.getState(STATE_CACHE_KEY); const matchedKey = core.getState(STATE_CACHE_MATCHED_KEY); @@ -54,13 +47,13 @@ async function saveCache(): Promise { if (matchedKey === cacheKey) { core.info(`Cache hit occurred on key ${cacheKey}, not saving cache.`); } else { - if (shouldPruneCache) { + if (inputs.pruneCache) { await pruneCache(); } - const actualCachePath = getUvCachePath(); + const actualCachePath = getUvCachePath(inputs); if (!fs.existsSync(actualCachePath)) { - if (ignoreNothingToCache) { + if (inputs.ignoreNothingToCache) { core.info( "No cacheable uv cache paths were found. Ignoring because ignore-nothing-to-cache is enabled.", ); @@ -79,10 +72,10 @@ async function saveCache(): Promise { } } - if (cachePython) { - if (!fs.existsSync(pythonDir)) { + if (inputs.cachePython) { + if (!fs.existsSync(inputs.pythonDir)) { core.warning( - `Python cache path ${pythonDir} does not exist on disk. Skipping Python cache save because no managed Python installation was found. If you want uv to install managed Python instead of using a system interpreter, set UV_PYTHON_PREFERENCE=only-managed.`, + `Python cache path ${inputs.pythonDir} does not exist on disk. Skipping Python cache save because no managed Python installation was found. If you want uv to install managed Python instead of using a system interpreter, set UV_PYTHON_PREFERENCE=only-managed.`, ); return; } @@ -90,7 +83,7 @@ async function saveCache(): Promise { const pythonCacheKey = `${cacheKey}-python`; await saveCacheToKey( pythonCacheKey, - pythonDir, + inputs.pythonDir, STATE_PYTHON_CACHE_MATCHED_KEY, "Python cache", ); @@ -113,22 +106,22 @@ async function pruneCache(): Promise { await exec.exec(uvPath, execArgs, options); } -function getUvCachePath(): string { - if (cacheLocalPath === undefined) { +function getUvCachePath(inputs: SetupInputs): string { + if (inputs.cacheLocalPath === undefined) { throw new Error( "cache-local-path is not set. Cannot save cache without a valid cache path.", ); } if ( process.env.UV_CACHE_DIR && - process.env.UV_CACHE_DIR !== cacheLocalPath.path + process.env.UV_CACHE_DIR !== inputs.cacheLocalPath.path ) { core.warning( - `The environment variable UV_CACHE_DIR has been changed to "${process.env.UV_CACHE_DIR}", by an action or step running after astral-sh/setup-uv. This can lead to unexpected behavior. If you expected this to happen set the cache-local-path input to "${process.env.UV_CACHE_DIR}" instead of "${cacheLocalPath.path}".`, + `The environment variable UV_CACHE_DIR has been changed to "${process.env.UV_CACHE_DIR}", by an action or step running after astral-sh/setup-uv. This can lead to unexpected behavior. If you expected this to happen set the cache-local-path input to "${process.env.UV_CACHE_DIR}" instead of "${inputs.cacheLocalPath.path}".`, ); return process.env.UV_CACHE_DIR; } - return cacheLocalPath.path; + return inputs.cacheLocalPath.path; } async function saveCacheToKey( diff --git a/src/setup-uv.ts b/src/setup-uv.ts index 60ddec4..e1d40c2 100644 --- a/src/setup-uv.ts +++ b/src/setup-uv.ts @@ -9,26 +9,7 @@ import { tryGetFromToolCache, } from "./download/download-version"; import { STATE_UV_PATH, STATE_UV_VERSION } from "./utils/constants"; -import { - activateEnvironment as activateEnvironmentInput, - addProblemMatchers, - CacheLocalSource, - cacheLocalPath, - checkSum, - enableCache, - githubToken, - ignoreEmptyWorkdir, - manifestFile, - pythonDir, - pythonVersion, - resolutionStrategy, - toolBinDir, - toolDir, - venvPath, - versionFile as versionFileInput, - version as versionInput, - workingDirectory, -} from "./utils/inputs"; +import { CacheLocalSource, loadInputs, type SetupInputs } from "./utils/inputs"; import { type Architecture, getArch, @@ -39,9 +20,9 @@ import { getUvVersionFromFile } from "./version/resolve"; const sourceDir = __dirname; -async function getPythonVersion(): Promise { - if (pythonVersion !== "") { - return pythonVersion; +async function getPythonVersion(inputs: SetupInputs): Promise { + if (inputs.pythonVersion !== "") { + return inputs.pythonVersion; } let output = ""; @@ -55,7 +36,7 @@ async function getPythonVersion(): Promise { }; try { - const execArgs = ["python", "find", "--directory", workingDirectory]; + const execArgs = ["python", "find", "--directory", inputs.workingDirectory]; await exec.exec("uv", execArgs, options); const pythonPath = output.trim(); @@ -71,37 +52,38 @@ async function getPythonVersion(): Promise { } async function run(): Promise { - detectEmptyWorkdir(); - const platform = await getPlatform(); - const arch = getArch(); - try { + const inputs = loadInputs(); + detectEmptyWorkdir(inputs); + const platform = await getPlatform(); + const arch = getArch(); + if (platform === undefined) { throw new Error(`Unsupported platform: ${process.platform}`); } if (arch === undefined) { throw new Error(`Unsupported architecture: ${process.arch}`); } - const setupResult = await setupUv(platform, arch, checkSum, githubToken); + const setupResult = await setupUv(inputs, platform, arch); - addToolBinToPath(); + addToolBinToPath(inputs); addUvToPathAndOutput(setupResult.uvDir); - setToolDir(); - addPythonDirToPath(); - setupPython(); - await activateEnvironment(); - addMatchers(); - setCacheDir(); + setToolDir(inputs); + addPythonDirToPath(inputs); + setupPython(inputs); + await activateEnvironment(inputs); + addMatchers(inputs); + setCacheDir(inputs); core.setOutput("uv-version", setupResult.version); core.saveState(STATE_UV_VERSION, setupResult.version); core.info(`Successfully installed uv version ${setupResult.version}`); - const pythonVersion = await getPythonVersion(); - core.setOutput("python-version", pythonVersion); + const detectedPythonVersion = await getPythonVersion(inputs); + core.setOutput("python-version", detectedPythonVersion); - if (enableCache) { - await restoreCache(pythonVersion); + if (inputs.enableCache) { + await restoreCache(inputs, detectedPythonVersion); } // https://github.com/nodejs/node/issues/56645#issuecomment-3077594952 await new Promise((resolve) => setTimeout(resolve, 50)); @@ -111,9 +93,9 @@ async function run(): Promise { } } -function detectEmptyWorkdir(): void { - if (fs.readdirSync(workingDirectory).length === 0) { - if (ignoreEmptyWorkdir) { +function detectEmptyWorkdir(inputs: SetupInputs): void { + if (fs.readdirSync(inputs.workingDirectory).length === 0) { + if (inputs.ignoreEmptyWorkdir) { core.info( "Empty workdir detected. Ignoring because ignore-empty-workdir is enabled", ); @@ -126,12 +108,11 @@ function detectEmptyWorkdir(): void { } async function setupUv( + inputs: SetupInputs, platform: Platform, arch: Architecture, - checkSum: string | undefined, - githubToken: string, ): Promise<{ uvDir: string; version: string }> { - const resolvedVersion = await determineVersion(); + const resolvedVersion = await determineVersion(inputs); const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion); if (toolCacheResult.installedPath) { core.info(`Found uv in tool-cache for ${toolCacheResult.version}`); @@ -145,9 +126,9 @@ async function setupUv( platform, arch, resolvedVersion, - checkSum, - githubToken, - manifestFile, + inputs.checksum, + inputs.githubToken, + inputs.manifestFile, ); return { @@ -156,34 +137,34 @@ async function setupUv( }; } -async function determineVersion(): Promise { +async function determineVersion(inputs: SetupInputs): Promise { return await resolveVersion( - getRequestedVersion(), - manifestFile, - resolutionStrategy, + getRequestedVersion(inputs), + inputs.manifestFile, + inputs.resolutionStrategy, ); } -function getRequestedVersion(): string { - if (versionInput !== "") { - return versionInput; +function getRequestedVersion(inputs: SetupInputs): string { + if (inputs.version !== "") { + return inputs.version; } - if (versionFileInput !== "") { - const versionFromFile = getUvVersionFromFile(versionFileInput); + if (inputs.versionFile !== "") { + const versionFromFile = getUvVersionFromFile(inputs.versionFile); if (versionFromFile === undefined) { throw new Error( - `Could not determine uv version from file: ${versionFileInput}`, + `Could not determine uv version from file: ${inputs.versionFile}`, ); } return versionFromFile; } const versionFromUvToml = getUvVersionFromFile( - `${workingDirectory}${path.sep}uv.toml`, + `${inputs.workingDirectory}${path.sep}uv.toml`, ); const versionFromPyproject = getUvVersionFromFile( - `${workingDirectory}${path.sep}pyproject.toml`, + `${inputs.workingDirectory}${path.sep}pyproject.toml`, ); if (versionFromUvToml === undefined && versionFromPyproject === undefined) { @@ -207,15 +188,17 @@ function addUvToPathAndOutput(cachedPath: string): void { } } -function addToolBinToPath(): void { - if (toolBinDir !== undefined) { - core.exportVariable("UV_TOOL_BIN_DIR", toolBinDir); - core.info(`Set UV_TOOL_BIN_DIR to ${toolBinDir}`); +function addToolBinToPath(inputs: SetupInputs): void { + if (inputs.toolBinDir !== undefined) { + core.exportVariable("UV_TOOL_BIN_DIR", inputs.toolBinDir); + core.info(`Set UV_TOOL_BIN_DIR to ${inputs.toolBinDir}`); if (process.env.UV_NO_MODIFY_PATH !== undefined) { - core.info(`UV_NO_MODIFY_PATH is set, not adding ${toolBinDir} to path`); + core.info( + `UV_NO_MODIFY_PATH is set, not adding ${inputs.toolBinDir} to path`, + ); } else { - core.addPath(toolBinDir); - core.info(`Added ${toolBinDir} to the path`); + core.addPath(inputs.toolBinDir); + core.info(`Added ${inputs.toolBinDir} to the path`); } } else { if (process.env.UV_NO_MODIFY_PATH !== undefined) { @@ -235,73 +218,73 @@ function addToolBinToPath(): void { } } -function setToolDir(): void { - if (toolDir !== undefined) { - core.exportVariable("UV_TOOL_DIR", toolDir); - core.info(`Set UV_TOOL_DIR to ${toolDir}`); +function setToolDir(inputs: SetupInputs): void { + if (inputs.toolDir !== undefined) { + core.exportVariable("UV_TOOL_DIR", inputs.toolDir); + core.info(`Set UV_TOOL_DIR to ${inputs.toolDir}`); } } -function addPythonDirToPath(): void { - core.exportVariable("UV_PYTHON_INSTALL_DIR", pythonDir); - core.info(`Set UV_PYTHON_INSTALL_DIR to ${pythonDir}`); +function addPythonDirToPath(inputs: SetupInputs): void { + core.exportVariable("UV_PYTHON_INSTALL_DIR", inputs.pythonDir); + core.info(`Set UV_PYTHON_INSTALL_DIR to ${inputs.pythonDir}`); if (process.env.UV_NO_MODIFY_PATH !== undefined) { core.info("UV_NO_MODIFY_PATH is set, not adding python dir to path"); } else { - core.addPath(pythonDir); - core.info(`Added ${pythonDir} to the path`); + core.addPath(inputs.pythonDir); + core.info(`Added ${inputs.pythonDir} to the path`); } } -function setupPython(): void { - if (pythonVersion !== "") { - core.exportVariable("UV_PYTHON", pythonVersion); - core.info(`Set UV_PYTHON to ${pythonVersion}`); +function setupPython(inputs: SetupInputs): void { + if (inputs.pythonVersion !== "") { + core.exportVariable("UV_PYTHON", inputs.pythonVersion); + core.info(`Set UV_PYTHON to ${inputs.pythonVersion}`); } } -async function activateEnvironment(): Promise { - if (activateEnvironmentInput) { +async function activateEnvironment(inputs: SetupInputs): Promise { + if (inputs.activateEnvironment) { if (process.env.UV_NO_MODIFY_PATH !== undefined) { throw new Error( "UV_NO_MODIFY_PATH and activate-environment cannot be used together.", ); } - core.info(`Creating and activating python venv at ${venvPath}...`); + core.info(`Creating and activating python venv at ${inputs.venvPath}...`); await exec.exec("uv", [ "venv", - venvPath, + inputs.venvPath, "--directory", - workingDirectory, + inputs.workingDirectory, "--clear", ]); - let venvBinPath = `${venvPath}${path.sep}bin`; + let venvBinPath = `${inputs.venvPath}${path.sep}bin`; if (process.platform === "win32") { - venvBinPath = `${venvPath}${path.sep}Scripts`; + venvBinPath = `${inputs.venvPath}${path.sep}Scripts`; } core.addPath(path.resolve(venvBinPath)); - core.exportVariable("VIRTUAL_ENV", venvPath); - core.setOutput("venv", venvPath); + core.exportVariable("VIRTUAL_ENV", inputs.venvPath); + core.setOutput("venv", inputs.venvPath); } } -function setCacheDir(): void { - if (cacheLocalPath !== undefined) { - if (cacheLocalPath.source === CacheLocalSource.Config) { +function setCacheDir(inputs: SetupInputs): void { + if (inputs.cacheLocalPath !== undefined) { + if (inputs.cacheLocalPath.source === CacheLocalSource.Config) { core.info( "Using cache-dir from uv config file, not modifying UV_CACHE_DIR", ); return; } - core.exportVariable("UV_CACHE_DIR", cacheLocalPath.path); - core.info(`Set UV_CACHE_DIR to ${cacheLocalPath.path}`); + core.exportVariable("UV_CACHE_DIR", inputs.cacheLocalPath.path); + core.info(`Set UV_CACHE_DIR to ${inputs.cacheLocalPath.path}`); } } -function addMatchers(): void { - if (addProblemMatchers) { +function addMatchers(inputs: SetupInputs): void { + if (inputs.addProblemMatchers) { const matchersPath = path.join(sourceDir, "..", "..", ".github"); core.info(`##[add-matcher]${path.join(matchersPath, "python.json")}`); } diff --git a/src/utils/inputs.ts b/src/utils/inputs.ts index 4c189d6..7fc49b3 100644 --- a/src/utils/inputs.ts +++ b/src/utils/inputs.ts @@ -9,68 +9,152 @@ export enum CacheLocalSource { Default, } -export const workingDirectory = core.getInput("working-directory"); -export const version = core.getInput("version"); -export const versionFile = getVersionFile(); -export const pythonVersion = core.getInput("python-version"); -export const activateEnvironment = core.getBooleanInput("activate-environment"); -export const venvPath = getVenvPath(); -export const checkSum = core.getInput("checksum"); -export const enableCache = getEnableCache(); -export const restoreCache = core.getInput("restore-cache") === "true"; -export const saveCache = core.getInput("save-cache") === "true"; -export const cacheSuffix = core.getInput("cache-suffix") || ""; -export const cacheLocalPath = getCacheLocalPath(); -export const cacheDependencyGlob = getCacheDependencyGlob(); -export const pruneCache = core.getInput("prune-cache") === "true"; -export const cachePython = core.getInput("cache-python") === "true"; -export const ignoreNothingToCache = - core.getInput("ignore-nothing-to-cache") === "true"; -export const ignoreEmptyWorkdir = - core.getInput("ignore-empty-workdir") === "true"; -export const toolBinDir = getToolBinDir(); -export const toolDir = getToolDir(); -export const pythonDir = getUvPythonDir(); -export const githubToken = core.getInput("github-token"); -export const manifestFile = getManifestFile(); -export const addProblemMatchers = - core.getInput("add-problem-matchers") === "true"; -export const resolutionStrategy = getResolutionStrategy(); +export interface CacheLocalPath { + path: string; + source: CacheLocalSource; +} -function getVersionFile(): string { - const versionFileInput = core.getInput("version-file"); +export interface SetupInputs { + workingDirectory: string; + version: string; + versionFile: string; + pythonVersion: string; + activateEnvironment: boolean; + venvPath: string; + checksum: string; + enableCache: boolean; + restoreCache: boolean; + saveCache: boolean; + cacheSuffix: string; + cacheLocalPath?: CacheLocalPath; + cacheDependencyGlob: string; + pruneCache: boolean; + cachePython: boolean; + ignoreNothingToCache: boolean; + ignoreEmptyWorkdir: boolean; + toolBinDir?: string; + toolDir?: string; + pythonDir: string; + githubToken: string; + manifestFile?: string; + addProblemMatchers: boolean; + resolutionStrategy: "highest" | "lowest"; +} + +export function loadInputs(): SetupInputs { + const workingDirectory = core.getInput("working-directory"); + const version = core.getInput("version"); + const versionFile = getVersionFile( + workingDirectory, + core.getInput("version-file"), + ); + const pythonVersion = core.getInput("python-version"); + const activateEnvironment = core.getBooleanInput("activate-environment"); + const venvPath = getVenvPath( + workingDirectory, + core.getInput("venv-path"), + activateEnvironment, + ); + const checksum = core.getInput("checksum"); + const enableCache = getEnableCache(core.getInput("enable-cache")); + const restoreCache = core.getInput("restore-cache") === "true"; + const saveCache = core.getInput("save-cache") === "true"; + const cacheSuffix = core.getInput("cache-suffix") || ""; + const cacheLocalPath = getCacheLocalPath( + workingDirectory, + versionFile, + enableCache, + ); + const cacheDependencyGlob = getCacheDependencyGlob( + workingDirectory, + core.getInput("cache-dependency-glob"), + ); + const pruneCache = core.getInput("prune-cache") === "true"; + const cachePython = core.getInput("cache-python") === "true"; + const ignoreNothingToCache = + core.getInput("ignore-nothing-to-cache") === "true"; + const ignoreEmptyWorkdir = core.getInput("ignore-empty-workdir") === "true"; + const toolBinDir = getToolBinDir( + workingDirectory, + core.getInput("tool-bin-dir"), + ); + const toolDir = getToolDir(workingDirectory, core.getInput("tool-dir")); + const pythonDir = getUvPythonDir(); + const githubToken = core.getInput("github-token"); + const manifestFile = getManifestFile(core.getInput("manifest-file")); + const addProblemMatchers = core.getInput("add-problem-matchers") === "true"; + const resolutionStrategy = getResolutionStrategy( + core.getInput("resolution-strategy"), + ); + + return { + activateEnvironment, + addProblemMatchers, + cacheDependencyGlob, + cacheLocalPath, + cachePython, + cacheSuffix, + checksum, + enableCache, + githubToken, + ignoreEmptyWorkdir, + ignoreNothingToCache, + manifestFile, + pruneCache, + pythonDir, + pythonVersion, + resolutionStrategy, + restoreCache, + saveCache, + toolBinDir, + toolDir, + venvPath, + version, + versionFile, + workingDirectory, + }; +} + +function getVersionFile( + workingDirectory: string, + versionFileInput: string, +): string { if (versionFileInput !== "") { const tildeExpanded = expandTilde(versionFileInput); - return resolveRelativePath(tildeExpanded); + return resolveRelativePath(workingDirectory, tildeExpanded); } return versionFileInput; } -function getVenvPath(): string { - const venvPathInput = core.getInput("venv-path"); +function getVenvPath( + workingDirectory: string, + venvPathInput: string, + activateEnvironment: boolean, +): string { if (venvPathInput !== "") { if (!activateEnvironment) { core.warning("venv-path is only used when activate-environment is true"); } const tildeExpanded = expandTilde(venvPathInput); - return normalizePath(resolveRelativePath(tildeExpanded)); + return normalizePath(resolveRelativePath(workingDirectory, tildeExpanded)); } - return normalizePath(resolveRelativePath(".venv")); + return normalizePath(resolveRelativePath(workingDirectory, ".venv")); } -function getEnableCache(): boolean { - const enableCacheInput = core.getInput("enable-cache"); +function getEnableCache(enableCacheInput: string): boolean { if (enableCacheInput === "auto") { return process.env.RUNNER_ENVIRONMENT === "github-hosted"; } return enableCacheInput === "true"; } -function getToolBinDir(): string | undefined { - const toolBinDirInput = core.getInput("tool-bin-dir"); +function getToolBinDir( + workingDirectory: string, + toolBinDirInput: string, +): string | undefined { if (toolBinDirInput !== "") { const tildeExpanded = expandTilde(toolBinDirInput); - return resolveRelativePath(tildeExpanded); + return resolveRelativePath(workingDirectory, tildeExpanded); } if (process.platform === "win32") { if (process.env.RUNNER_TEMP !== undefined) { @@ -83,11 +167,13 @@ function getToolBinDir(): string | undefined { return undefined; } -function getToolDir(): string | undefined { - const toolDirInput = core.getInput("tool-dir"); +function getToolDir( + workingDirectory: string, + toolDirInput: string, +): string | undefined { if (toolDirInput !== "") { const tildeExpanded = expandTilde(toolDirInput); - return resolveRelativePath(tildeExpanded); + return resolveRelativePath(workingDirectory, tildeExpanded); } if (process.platform === "win32") { if (process.env.RUNNER_TEMP !== undefined) { @@ -100,21 +186,23 @@ function getToolDir(): string | undefined { return undefined; } -function getCacheLocalPath(): - | { - path: string; - source: CacheLocalSource; - } - | undefined { +function getCacheLocalPath( + workingDirectory: string, + versionFile: string, + enableCache: boolean, +): CacheLocalPath | undefined { const cacheLocalPathInput = core.getInput("cache-local-path"); if (cacheLocalPathInput !== "") { const tildeExpanded = expandTilde(cacheLocalPathInput); return { - path: resolveRelativePath(tildeExpanded), + path: resolveRelativePath(workingDirectory, tildeExpanded), source: CacheLocalSource.Input, }; } - const cacheDirFromConfig = getCacheDirFromConfig(); + const cacheDirFromConfig = getCacheDirFromConfig( + workingDirectory, + versionFile, + ); if (cacheDirFromConfig !== undefined) { return { path: cacheDirFromConfig, source: CacheLocalSource.Config }; } @@ -122,7 +210,7 @@ function getCacheLocalPath(): core.info(`UV_CACHE_DIR is already set to ${process.env.UV_CACHE_DIR}`); return { path: process.env.UV_CACHE_DIR, source: CacheLocalSource.Env }; } - if (getEnableCache()) { + if (enableCache) { if (process.env.RUNNER_ENVIRONMENT === "github-hosted") { if (process.env.RUNNER_TEMP !== undefined) { return { @@ -147,9 +235,12 @@ function getCacheLocalPath(): } } -function getCacheDirFromConfig(): string | undefined { +function getCacheDirFromConfig( + workingDirectory: string, + versionFile: string, +): string | undefined { for (const filePath of [versionFile, "uv.toml", "pyproject.toml"]) { - const resolvedPath = resolveRelativePath(filePath); + const resolvedPath = resolveRelativePath(workingDirectory, filePath); try { const cacheDir = getConfigValueFromTomlFile(resolvedPath, "cache-dir"); if (cacheDir !== undefined) { @@ -175,9 +266,8 @@ export function getUvPythonDir(): string { if (process.env.RUNNER_ENVIRONMENT !== "github-hosted") { if (process.platform === "win32") { return `${process.env.APPDATA}${path.sep}uv${path.sep}python`; - } else { - return `${process.env.HOME}${path.sep}.local${path.sep}share${path.sep}uv${path.sep}python`; } + return `${process.env.HOME}${path.sep}.local${path.sep}share${path.sep}uv${path.sep}python`; } if (process.env.RUNNER_TEMP !== undefined) { return `${process.env.RUNNER_TEMP}${path.sep}uv-python-dir`; @@ -187,14 +277,16 @@ export function getUvPythonDir(): string { ); } -function getCacheDependencyGlob(): string { - const cacheDependencyGlobInput = core.getInput("cache-dependency-glob"); +function getCacheDependencyGlob( + workingDirectory: string, + cacheDependencyGlobInput: string, +): string { if (cacheDependencyGlobInput !== "") { return cacheDependencyGlobInput .split("\n") .map((part) => part.trim()) .map((part) => expandTilde(part)) - .map((part) => resolveRelativePath(part)) + .map((part) => resolveRelativePath(workingDirectory, part)) .join("\n"); } return cacheDependencyGlobInput; @@ -220,7 +312,10 @@ function normalizePath(inputPath: string): string { return trimmed; } -function resolveRelativePath(inputPath: string): string { +function resolveRelativePath( + workingDirectory: string, + inputPath: string, +): string { const hasNegation = inputPath.startsWith("!"); const pathWithoutNegation = hasNegation ? inputPath.substring(1) : inputPath; @@ -232,16 +327,16 @@ function resolveRelativePath(inputPath: string): string { return hasNegation ? `!${resolvedPath}` : resolvedPath; } -function getManifestFile(): string | undefined { - const manifestFileInput = core.getInput("manifest-file"); +function getManifestFile(manifestFileInput: string): string | undefined { if (manifestFileInput !== "") { return manifestFileInput; } return undefined; } -function getResolutionStrategy(): "highest" | "lowest" { - const resolutionStrategyInput = core.getInput("resolution-strategy"); +function getResolutionStrategy( + resolutionStrategyInput: string, +): "highest" | "lowest" { if (resolutionStrategyInput === "lowest") { return "lowest"; } From 485abd05e5c74a247f0a309e333d2433ab9a353a Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sat, 28 Mar 2026 16:25:54 +0100 Subject: [PATCH 09/20] Bump release-drafter to v7.1.1 (#825) --- .github/workflows/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index 1669920..ca41495 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -19,6 +19,6 @@ jobs: pull-requests: read steps: - name: 🚀 Run Release Drafter - uses: release-drafter/release-drafter@6db134d15f3909ccc9eefd369f02bd1e9cffdf97 # v6.2.0 + uses: release-drafter/release-drafter@139054aeaa9adc52ab36ddf67437541f039b88e2 # v7.1.1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 7fdbe7cf0c8ef50cfd0878eed7b5180abc6b53c7 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sat, 28 Mar 2026 16:29:52 +0100 Subject: [PATCH 10/20] Remove update-major-minor-tags workflow (#826) --- .github/workflows/update-major-minor-tags.yml | 51 ------------------- 1 file changed, 51 deletions(-) delete mode 100644 .github/workflows/update-major-minor-tags.yml diff --git a/.github/workflows/update-major-minor-tags.yml b/.github/workflows/update-major-minor-tags.yml deleted file mode 100644 index 4107fb1..0000000 --- a/.github/workflows/update-major-minor-tags.yml +++ /dev/null @@ -1,51 +0,0 @@ ---- -name: Update Major Minor Tags - -on: - push: - branches-ignore: - - "**" - tags: - - "v*.*.*" - -permissions: {} - -jobs: - update_major_minor_tags: - name: Make sure major and minor tags are up to date on a patch release - runs-on: ubuntu-24.04-arm - permissions: - contents: write - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: true # needed for git push below - - name: Update Major Minor Tags - run: | - set -x - - cd "${GITHUB_WORKSPACE}" || exit - - # Set up variables. - TAG="${GITHUB_REF#refs/tags/}" # v1.2.3 - MINOR="${TAG%.*}" # v1.2 - MAJOR="${MINOR%.*}" # v1 - - if [ "${GITHUB_REF}" = "${TAG}" ]; then - echo "This workflow is not triggered by tag push: GITHUB_REF=${GITHUB_REF}" - exit 1 - fi - - MESSAGE="Release ${TAG}" - - # Set up Git. - git config user.name "${GITHUB_ACTOR}" - git config user.email "${GITHUB_ACTOR}@users.noreply.github.com" - - # Update MAJOR/MINOR tag - git tag -fa "${MAJOR}" -m "${MESSAGE}" - git tag -fa "${MINOR}" -m "${MESSAGE}" - - # Push - git push --force origin "${MINOR}" - git push --force origin "${MAJOR}" From 4dd8ab45206a76f8c1dfe399fa88df10a7264f27 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sat, 28 Mar 2026 17:38:30 +0100 Subject: [PATCH 11/20] Simplify inputs.ts (#827) Do not pass around inputs. Its okay to freely work with core.getInput in this file --- __tests__/utils/inputs.test.ts | 20 +++------- dist/save-cache/index.cjs | 55 ++++++++++++-------------- dist/setup/index.cjs | 55 ++++++++++++-------------- src/utils/inputs.ts | 72 ++++++++++++---------------------- 4 files changed, 80 insertions(+), 122 deletions(-) diff --git a/__tests__/utils/inputs.test.ts b/__tests__/utils/inputs.test.ts index a066833..e16ffa6 100644 --- a/__tests__/utils/inputs.test.ts +++ b/__tests__/utils/inputs.test.ts @@ -36,7 +36,7 @@ jest.unstable_mockModule("@actions/core", () => ({ const { CacheLocalSource, loadInputs } = await import("../../src/utils/inputs"); -function createTempProject(files: Record): string { +function createTempProject(files: Record = {}): string { const dir = fs.mkdtempSync(path.join(os.tmpdir(), "setup-uv-inputs-test-")); tempDirs.push(dir); @@ -60,11 +60,8 @@ function resetEnvironment(): void { } function restoreEnvironment(): void { - while (tempDirs.length > 0) { - const dir = tempDirs.pop(); - if (dir !== undefined) { - fs.rmSync(dir, { force: true, recursive: true }); - } + for (const dir of tempDirs.splice(0)) { + fs.rmSync(dir, { force: true, recursive: true }); } process.env.HOME = ORIGINAL_HOME; @@ -74,13 +71,8 @@ function restoreEnvironment(): void { process.env.UV_PYTHON_INSTALL_DIR = ORIGINAL_UV_PYTHON_INSTALL_DIR; } -beforeEach(() => { - resetEnvironment(); -}); - -afterEach(() => { - restoreEnvironment(); -}); +beforeEach(resetEnvironment); +afterEach(restoreEnvironment); describe("loadInputs", () => { it("loads defaults for a github-hosted runner", () => { @@ -125,7 +117,7 @@ cache-dir = "/tmp/pyproject-toml-defined-cache-path" }); it("uses UV_CACHE_DIR from the environment", () => { - mockInputs["working-directory"] = createTempProject({}); + mockInputs["working-directory"] = createTempProject(); process.env.UV_CACHE_DIR = "/env/cache-dir"; const inputs = loadInputs(); diff --git a/dist/save-cache/index.cjs b/dist/save-cache/index.cjs index 42f3ae7..ecbfbbb 100644 --- a/dist/save-cache/index.cjs +++ b/dist/save-cache/index.cjs @@ -62959,19 +62959,12 @@ function getConfigValueFromTomlFile(filePath, key) { function loadInputs() { const workingDirectory = getInput("working-directory"); const version3 = getInput("version"); - const versionFile = getVersionFile( - workingDirectory, - getInput("version-file") - ); + const versionFile = getVersionFile(workingDirectory); const pythonVersion = getInput("python-version"); const activateEnvironment = getBooleanInput("activate-environment"); - const venvPath = getVenvPath( - workingDirectory, - getInput("venv-path"), - activateEnvironment - ); + const venvPath = getVenvPath(workingDirectory, activateEnvironment); const checksum = getInput("checksum"); - const enableCache = getEnableCache(getInput("enable-cache")); + const enableCache = getEnableCache(); const restoreCache2 = getInput("restore-cache") === "true"; const saveCache4 = getInput("save-cache") === "true"; const cacheSuffix = getInput("cache-suffix") || ""; @@ -62980,26 +62973,18 @@ function loadInputs() { versionFile, enableCache ); - const cacheDependencyGlob = getCacheDependencyGlob( - workingDirectory, - getInput("cache-dependency-glob") - ); + const cacheDependencyGlob = getCacheDependencyGlob(workingDirectory); const pruneCache2 = getInput("prune-cache") === "true"; const cachePython = getInput("cache-python") === "true"; const ignoreNothingToCache = getInput("ignore-nothing-to-cache") === "true"; const ignoreEmptyWorkdir = getInput("ignore-empty-workdir") === "true"; - const toolBinDir = getToolBinDir( - workingDirectory, - getInput("tool-bin-dir") - ); - const toolDir = getToolDir(workingDirectory, getInput("tool-dir")); + const toolBinDir = getToolBinDir(workingDirectory); + const toolDir = getToolDir(workingDirectory); const pythonDir = getUvPythonDir(); const githubToken = getInput("github-token"); - const manifestFile = getManifestFile(getInput("manifest-file")); + const manifestFile = getManifestFile(); const addProblemMatchers = getInput("add-problem-matchers") === "true"; - const resolutionStrategy = getResolutionStrategy( - getInput("resolution-strategy") - ); + const resolutionStrategy = getResolutionStrategy(); return { activateEnvironment, addProblemMatchers, @@ -63027,14 +63012,16 @@ function loadInputs() { workingDirectory }; } -function getVersionFile(workingDirectory, versionFileInput) { +function getVersionFile(workingDirectory) { + const versionFileInput = getInput("version-file"); if (versionFileInput !== "") { const tildeExpanded = expandTilde(versionFileInput); return resolveRelativePath(workingDirectory, tildeExpanded); } return versionFileInput; } -function getVenvPath(workingDirectory, venvPathInput, activateEnvironment) { +function getVenvPath(workingDirectory, activateEnvironment) { + const venvPathInput = getInput("venv-path"); if (venvPathInput !== "") { if (!activateEnvironment) { warning("venv-path is only used when activate-environment is true"); @@ -63044,13 +63031,15 @@ function getVenvPath(workingDirectory, venvPathInput, activateEnvironment) { } return normalizePath(resolveRelativePath(workingDirectory, ".venv")); } -function getEnableCache(enableCacheInput) { +function getEnableCache() { + const enableCacheInput = getInput("enable-cache"); if (enableCacheInput === "auto") { return process.env.RUNNER_ENVIRONMENT === "github-hosted"; } return enableCacheInput === "true"; } -function getToolBinDir(workingDirectory, toolBinDirInput) { +function getToolBinDir(workingDirectory) { + const toolBinDirInput = getInput("tool-bin-dir"); if (toolBinDirInput !== "") { const tildeExpanded = expandTilde(toolBinDirInput); return resolveRelativePath(workingDirectory, tildeExpanded); @@ -63065,7 +63054,8 @@ function getToolBinDir(workingDirectory, toolBinDirInput) { } return void 0; } -function getToolDir(workingDirectory, toolDirInput) { +function getToolDir(workingDirectory) { + const toolDirInput = getInput("tool-dir"); if (toolDirInput !== "") { const tildeExpanded = expandTilde(toolDirInput); return resolveRelativePath(workingDirectory, tildeExpanded); @@ -63161,7 +63151,8 @@ function getUvPythonDir() { "Could not determine UV_PYTHON_INSTALL_DIR. Please make sure RUNNER_TEMP is set or provide the UV_PYTHON_INSTALL_DIR environment variable" ); } -function getCacheDependencyGlob(workingDirectory, cacheDependencyGlobInput) { +function getCacheDependencyGlob(workingDirectory) { + const cacheDependencyGlobInput = getInput("cache-dependency-glob"); if (cacheDependencyGlobInput !== "") { return cacheDependencyGlobInput.split("\n").map((part) => part.trim()).map((part) => expandTilde(part)).map((part) => resolveRelativePath(workingDirectory, part)).join("\n"); } @@ -63191,13 +63182,15 @@ function resolveRelativePath(workingDirectory, inputPath) { ); return hasNegation ? `!${resolvedPath}` : resolvedPath; } -function getManifestFile(manifestFileInput) { +function getManifestFile() { + const manifestFileInput = getInput("manifest-file"); if (manifestFileInput !== "") { return manifestFileInput; } return void 0; } -function getResolutionStrategy(resolutionStrategyInput) { +function getResolutionStrategy() { + const resolutionStrategyInput = getInput("resolution-strategy"); if (resolutionStrategyInput === "lowest") { return "lowest"; } diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index fad1f29..2b2496f 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -96557,19 +96557,12 @@ function getConfigValueFromTomlFile(filePath, key) { function loadInputs() { const workingDirectory = getInput("working-directory"); const version3 = getInput("version"); - const versionFile = getVersionFile( - workingDirectory, - getInput("version-file") - ); + const versionFile = getVersionFile(workingDirectory); const pythonVersion = getInput("python-version"); const activateEnvironment2 = getBooleanInput("activate-environment"); - const venvPath = getVenvPath( - workingDirectory, - getInput("venv-path"), - activateEnvironment2 - ); + const venvPath = getVenvPath(workingDirectory, activateEnvironment2); const checksum = getInput("checksum"); - const enableCache = getEnableCache(getInput("enable-cache")); + const enableCache = getEnableCache(); const restoreCache3 = getInput("restore-cache") === "true"; const saveCache2 = getInput("save-cache") === "true"; const cacheSuffix = getInput("cache-suffix") || ""; @@ -96578,26 +96571,18 @@ function loadInputs() { versionFile, enableCache ); - const cacheDependencyGlob = getCacheDependencyGlob( - workingDirectory, - getInput("cache-dependency-glob") - ); + const cacheDependencyGlob = getCacheDependencyGlob(workingDirectory); const pruneCache = getInput("prune-cache") === "true"; const cachePython = getInput("cache-python") === "true"; const ignoreNothingToCache = getInput("ignore-nothing-to-cache") === "true"; const ignoreEmptyWorkdir = getInput("ignore-empty-workdir") === "true"; - const toolBinDir = getToolBinDir( - workingDirectory, - getInput("tool-bin-dir") - ); - const toolDir = getToolDir(workingDirectory, getInput("tool-dir")); + const toolBinDir = getToolBinDir(workingDirectory); + const toolDir = getToolDir(workingDirectory); const pythonDir = getUvPythonDir(); const githubToken = getInput("github-token"); - const manifestFile = getManifestFile(getInput("manifest-file")); + const manifestFile = getManifestFile(); const addProblemMatchers = getInput("add-problem-matchers") === "true"; - const resolutionStrategy = getResolutionStrategy( - getInput("resolution-strategy") - ); + const resolutionStrategy = getResolutionStrategy(); return { activateEnvironment: activateEnvironment2, addProblemMatchers, @@ -96625,14 +96610,16 @@ function loadInputs() { workingDirectory }; } -function getVersionFile(workingDirectory, versionFileInput) { +function getVersionFile(workingDirectory) { + const versionFileInput = getInput("version-file"); if (versionFileInput !== "") { const tildeExpanded = expandTilde(versionFileInput); return resolveRelativePath(workingDirectory, tildeExpanded); } return versionFileInput; } -function getVenvPath(workingDirectory, venvPathInput, activateEnvironment2) { +function getVenvPath(workingDirectory, activateEnvironment2) { + const venvPathInput = getInput("venv-path"); if (venvPathInput !== "") { if (!activateEnvironment2) { warning("venv-path is only used when activate-environment is true"); @@ -96642,13 +96629,15 @@ function getVenvPath(workingDirectory, venvPathInput, activateEnvironment2) { } return normalizePath(resolveRelativePath(workingDirectory, ".venv")); } -function getEnableCache(enableCacheInput) { +function getEnableCache() { + const enableCacheInput = getInput("enable-cache"); if (enableCacheInput === "auto") { return process.env.RUNNER_ENVIRONMENT === "github-hosted"; } return enableCacheInput === "true"; } -function getToolBinDir(workingDirectory, toolBinDirInput) { +function getToolBinDir(workingDirectory) { + const toolBinDirInput = getInput("tool-bin-dir"); if (toolBinDirInput !== "") { const tildeExpanded = expandTilde(toolBinDirInput); return resolveRelativePath(workingDirectory, tildeExpanded); @@ -96663,7 +96652,8 @@ function getToolBinDir(workingDirectory, toolBinDirInput) { } return void 0; } -function getToolDir(workingDirectory, toolDirInput) { +function getToolDir(workingDirectory) { + const toolDirInput = getInput("tool-dir"); if (toolDirInput !== "") { const tildeExpanded = expandTilde(toolDirInput); return resolveRelativePath(workingDirectory, tildeExpanded); @@ -96759,7 +96749,8 @@ function getUvPythonDir() { "Could not determine UV_PYTHON_INSTALL_DIR. Please make sure RUNNER_TEMP is set or provide the UV_PYTHON_INSTALL_DIR environment variable" ); } -function getCacheDependencyGlob(workingDirectory, cacheDependencyGlobInput) { +function getCacheDependencyGlob(workingDirectory) { + const cacheDependencyGlobInput = getInput("cache-dependency-glob"); if (cacheDependencyGlobInput !== "") { return cacheDependencyGlobInput.split("\n").map((part) => part.trim()).map((part) => expandTilde(part)).map((part) => resolveRelativePath(workingDirectory, part)).join("\n"); } @@ -96789,13 +96780,15 @@ function resolveRelativePath(workingDirectory, inputPath) { ); return hasNegation ? `!${resolvedPath}` : resolvedPath; } -function getManifestFile(manifestFileInput) { +function getManifestFile() { + const manifestFileInput = getInput("manifest-file"); if (manifestFileInput !== "") { return manifestFileInput; } return void 0; } -function getResolutionStrategy(resolutionStrategyInput) { +function getResolutionStrategy() { + const resolutionStrategyInput = getInput("resolution-strategy"); if (resolutionStrategyInput === "lowest") { return "lowest"; } diff --git a/src/utils/inputs.ts b/src/utils/inputs.ts index 7fc49b3..be8ce83 100644 --- a/src/utils/inputs.ts +++ b/src/utils/inputs.ts @@ -14,6 +14,8 @@ export interface CacheLocalPath { source: CacheLocalSource; } +export type ResolutionStrategy = "highest" | "lowest"; + export interface SetupInputs { workingDirectory: string; version: string; @@ -38,25 +40,18 @@ export interface SetupInputs { githubToken: string; manifestFile?: string; addProblemMatchers: boolean; - resolutionStrategy: "highest" | "lowest"; + resolutionStrategy: ResolutionStrategy; } export function loadInputs(): SetupInputs { const workingDirectory = core.getInput("working-directory"); const version = core.getInput("version"); - const versionFile = getVersionFile( - workingDirectory, - core.getInput("version-file"), - ); + const versionFile = getVersionFile(workingDirectory); const pythonVersion = core.getInput("python-version"); const activateEnvironment = core.getBooleanInput("activate-environment"); - const venvPath = getVenvPath( - workingDirectory, - core.getInput("venv-path"), - activateEnvironment, - ); + const venvPath = getVenvPath(workingDirectory, activateEnvironment); const checksum = core.getInput("checksum"); - const enableCache = getEnableCache(core.getInput("enable-cache")); + const enableCache = getEnableCache(); const restoreCache = core.getInput("restore-cache") === "true"; const saveCache = core.getInput("save-cache") === "true"; const cacheSuffix = core.getInput("cache-suffix") || ""; @@ -65,27 +60,19 @@ export function loadInputs(): SetupInputs { versionFile, enableCache, ); - const cacheDependencyGlob = getCacheDependencyGlob( - workingDirectory, - core.getInput("cache-dependency-glob"), - ); + const cacheDependencyGlob = getCacheDependencyGlob(workingDirectory); const pruneCache = core.getInput("prune-cache") === "true"; const cachePython = core.getInput("cache-python") === "true"; const ignoreNothingToCache = core.getInput("ignore-nothing-to-cache") === "true"; const ignoreEmptyWorkdir = core.getInput("ignore-empty-workdir") === "true"; - const toolBinDir = getToolBinDir( - workingDirectory, - core.getInput("tool-bin-dir"), - ); - const toolDir = getToolDir(workingDirectory, core.getInput("tool-dir")); + const toolBinDir = getToolBinDir(workingDirectory); + const toolDir = getToolDir(workingDirectory); const pythonDir = getUvPythonDir(); const githubToken = core.getInput("github-token"); - const manifestFile = getManifestFile(core.getInput("manifest-file")); + const manifestFile = getManifestFile(); const addProblemMatchers = core.getInput("add-problem-matchers") === "true"; - const resolutionStrategy = getResolutionStrategy( - core.getInput("resolution-strategy"), - ); + const resolutionStrategy = getResolutionStrategy(); return { activateEnvironment, @@ -115,10 +102,8 @@ export function loadInputs(): SetupInputs { }; } -function getVersionFile( - workingDirectory: string, - versionFileInput: string, -): string { +function getVersionFile(workingDirectory: string): string { + const versionFileInput = core.getInput("version-file"); if (versionFileInput !== "") { const tildeExpanded = expandTilde(versionFileInput); return resolveRelativePath(workingDirectory, tildeExpanded); @@ -128,9 +113,9 @@ function getVersionFile( function getVenvPath( workingDirectory: string, - venvPathInput: string, activateEnvironment: boolean, ): string { + const venvPathInput = core.getInput("venv-path"); if (venvPathInput !== "") { if (!activateEnvironment) { core.warning("venv-path is only used when activate-environment is true"); @@ -141,17 +126,16 @@ function getVenvPath( return normalizePath(resolveRelativePath(workingDirectory, ".venv")); } -function getEnableCache(enableCacheInput: string): boolean { +function getEnableCache(): boolean { + const enableCacheInput = core.getInput("enable-cache"); if (enableCacheInput === "auto") { return process.env.RUNNER_ENVIRONMENT === "github-hosted"; } return enableCacheInput === "true"; } -function getToolBinDir( - workingDirectory: string, - toolBinDirInput: string, -): string | undefined { +function getToolBinDir(workingDirectory: string): string | undefined { + const toolBinDirInput = core.getInput("tool-bin-dir"); if (toolBinDirInput !== "") { const tildeExpanded = expandTilde(toolBinDirInput); return resolveRelativePath(workingDirectory, tildeExpanded); @@ -167,10 +151,8 @@ function getToolBinDir( return undefined; } -function getToolDir( - workingDirectory: string, - toolDirInput: string, -): string | undefined { +function getToolDir(workingDirectory: string): string | undefined { + const toolDirInput = core.getInput("tool-dir"); if (toolDirInput !== "") { const tildeExpanded = expandTilde(toolDirInput); return resolveRelativePath(workingDirectory, tildeExpanded); @@ -277,10 +259,8 @@ export function getUvPythonDir(): string { ); } -function getCacheDependencyGlob( - workingDirectory: string, - cacheDependencyGlobInput: string, -): string { +function getCacheDependencyGlob(workingDirectory: string): string { + const cacheDependencyGlobInput = core.getInput("cache-dependency-glob"); if (cacheDependencyGlobInput !== "") { return cacheDependencyGlobInput .split("\n") @@ -327,16 +307,16 @@ function resolveRelativePath( return hasNegation ? `!${resolvedPath}` : resolvedPath; } -function getManifestFile(manifestFileInput: string): string | undefined { +function getManifestFile(): string | undefined { + const manifestFileInput = core.getInput("manifest-file"); if (manifestFileInput !== "") { return manifestFileInput; } return undefined; } -function getResolutionStrategy( - resolutionStrategyInput: string, -): "highest" | "lowest" { +function getResolutionStrategy(): ResolutionStrategy { + const resolutionStrategyInput = core.getInput("resolution-strategy"); if (resolutionStrategyInput === "lowest") { return "lowest"; } From cec208311dfd045dd5311c1add060b2062131d57 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sat, 28 Mar 2026 17:43:22 +0100 Subject: [PATCH 12/20] Shortcircuit latest version from manifest (#828) The first version is guaranteed to be the latest --- __tests__/download/manifest.test.ts | 23 +++- dist/setup/index.cjs | 144 ++++++++++++-------------- dist/update-known-checksums/index.cjs | 32 ++---- src/download/manifest.ts | 13 +-- 4 files changed, 98 insertions(+), 114 deletions(-) diff --git a/__tests__/download/manifest.test.ts b/__tests__/download/manifest.test.ts index 74cd428..85d6872 100644 --- a/__tests__/download/manifest.test.ts +++ b/__tests__/download/manifest.test.ts @@ -17,11 +17,12 @@ const { fetchManifest, getAllVersions, getArtifact, + getLatestVersion, parseManifest, } = await import("../../src/download/manifest"); -const sampleManifestResponse = `{"version":"0.9.25","artifacts":[{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.25/uv-aarch64-apple-darwin.tar.gz","archive_format":"tar.gz","sha256":"606b3c6949d971709f2526fa0d9f0fd23ccf60e09f117999b406b424af18a6a6"}]} -{"version":"0.9.26","artifacts":[{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.tar.gz","archive_format":"tar.gz","sha256":"fcf0a9ea6599c6ae28a4c854ac6da76f2c889354d7c36ce136ef071f7ab9721f"},{"platform":"x86_64-pc-windows-msvc","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-pc-windows-msvc.zip","archive_format":"zip","sha256":"eb02fd95d8e0eed462b4a67ecdd320d865b38c560bffcda9a0b87ec944bdf036"}]}`; +const sampleManifestResponse = `{"version":"0.9.26","artifacts":[{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.tar.gz","archive_format":"tar.gz","sha256":"fcf0a9ea6599c6ae28a4c854ac6da76f2c889354d7c36ce136ef071f7ab9721f"},{"platform":"x86_64-pc-windows-msvc","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-x86_64-pc-windows-msvc.zip","archive_format":"zip","sha256":"eb02fd95d8e0eed462b4a67ecdd320d865b38c560bffcda9a0b87ec944bdf036"}]} +{"version":"0.9.25","artifacts":[{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.25/uv-aarch64-apple-darwin.tar.gz","archive_format":"tar.gz","sha256":"606b3c6949d971709f2526fa0d9f0fd23ccf60e09f117999b406b424af18a6a6"}]}`; const multiVariantManifestResponse = `{"version":"0.9.26","artifacts":[{"platform":"aarch64-apple-darwin","variant":"python-managed","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin-managed.tar.gz","archive_format":"tar.gz","sha256":"managed-checksum"},{"platform":"aarch64-apple-darwin","variant":"default","url":"https://github.com/astral-sh/uv/releases/download/0.9.26/uv-aarch64-apple-darwin.zip","archive_format":"zip","sha256":"default-checksum"}]}`; @@ -54,8 +55,8 @@ describe("manifest", () => { const versions = await fetchManifest(); expect(versions).toHaveLength(2); - expect(versions[0]?.version).toBe("0.9.25"); - expect(versions[1]?.version).toBe("0.9.26"); + expect(versions[0]?.version).toBe("0.9.26"); + expect(versions[1]?.version).toBe("0.9.25"); }); it("throws on a failed fetch", async () => { @@ -90,7 +91,19 @@ describe("manifest", () => { "https://example.com/custom.ndjson", ); - expect(versions).toEqual(["0.9.25", "0.9.26"]); + expect(versions).toEqual(["0.9.26", "0.9.25"]); + }); + }); + + describe("getLatestVersion", () => { + it("returns the first version string", async () => { + mockFetch.mockResolvedValue( + createMockResponse(true, 200, "OK", sampleManifestResponse), + ); + + await expect( + getLatestVersion("https://example.com/custom.ndjson"), + ).resolves.toBe("0.9.26"); }); }); diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index 2b2496f..06712a7 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -20058,8 +20058,8 @@ var require_gt = __commonJS({ "node_modules/@actions/cache/node_modules/semver/functions/gt.js"(exports2, module2) { "use strict"; var compare = require_compare(); - var gt3 = (a, b, loose) => compare(a, b, loose) > 0; - module2.exports = gt3; + var gt2 = (a, b, loose) => compare(a, b, loose) > 0; + module2.exports = gt2; } }); @@ -20119,7 +20119,7 @@ var require_cmp = __commonJS({ "use strict"; var eq = require_eq(); var neq = require_neq(); - var gt3 = require_gt(); + var gt2 = require_gt(); var gte = require_gte(); var lt = require_lt(); var lte = require_lte(); @@ -20148,7 +20148,7 @@ var require_cmp = __commonJS({ case "!=": return neq(a, b, loose); case ">": - return gt3(a, b, loose); + return gt2(a, b, loose); case ">=": return gte(a, b, loose); case "<": @@ -20828,7 +20828,7 @@ var require_min_version = __commonJS({ "use strict"; var SemVer = require_semver(); var Range = require_range(); - var gt3 = require_gt(); + var gt2 = require_gt(); var minVersion = (range2, loose) => { range2 = new Range(range2, loose); let minver = new SemVer("0.0.0"); @@ -20856,7 +20856,7 @@ var require_min_version = __commonJS({ /* fallthrough */ case "": case ">=": - if (!setMin || gt3(compver, setMin)) { + if (!setMin || gt2(compver, setMin)) { setMin = compver; } break; @@ -20868,7 +20868,7 @@ var require_min_version = __commonJS({ throw new Error(`Unexpected operation: ${comparator.operator}`); } }); - if (setMin && (!minver || gt3(minver, setMin))) { + if (setMin && (!minver || gt2(minver, setMin))) { minver = setMin; } } @@ -20906,7 +20906,7 @@ var require_outside = __commonJS({ var { ANY } = Comparator; var Range = require_range(); var satisfies4 = require_satisfies(); - var gt3 = require_gt(); + var gt2 = require_gt(); var lt = require_lt(); var lte = require_lte(); var gte = require_gte(); @@ -20916,7 +20916,7 @@ var require_outside = __commonJS({ let gtfn, ltefn, ltfn, comp26, ecomp; switch (hilo) { case ">": - gtfn = gt3; + gtfn = gt2; ltefn = lte; ltfn = lt; comp26 = ">"; @@ -20925,7 +20925,7 @@ var require_outside = __commonJS({ case "<": gtfn = lt; ltefn = gte; - ltfn = gt3; + ltfn = gt2; comp26 = "<"; ecomp = "<="; break; @@ -21103,10 +21103,10 @@ var require_subset = __commonJS({ } } const eqSet = /* @__PURE__ */ new Set(); - let gt3, lt; + let gt2, lt; for (const c of sub) { if (c.operator === ">" || c.operator === ">=") { - gt3 = higherGT(gt3, c, options); + gt2 = higherGT(gt2, c, options); } else if (c.operator === "<" || c.operator === "<=") { lt = lowerLT(lt, c, options); } else { @@ -21117,16 +21117,16 @@ var require_subset = __commonJS({ return null; } let gtltComp; - if (gt3 && lt) { - gtltComp = compare(gt3.semver, lt.semver, options); + if (gt2 && lt) { + gtltComp = compare(gt2.semver, lt.semver, options); if (gtltComp > 0) { return null; - } else if (gtltComp === 0 && (gt3.operator !== ">=" || lt.operator !== "<=")) { + } else if (gtltComp === 0 && (gt2.operator !== ">=" || lt.operator !== "<=")) { return null; } } for (const eq of eqSet) { - if (gt3 && !satisfies4(eq, String(gt3), options)) { + if (gt2 && !satisfies4(eq, String(gt2), options)) { return null; } if (lt && !satisfies4(eq, String(lt), options)) { @@ -21142,25 +21142,25 @@ var require_subset = __commonJS({ let higher, lower; let hasDomLT, hasDomGT; let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; - let needDomGTPre = gt3 && !options.includePrerelease && gt3.semver.prerelease.length ? gt3.semver : false; + let needDomGTPre = gt2 && !options.includePrerelease && gt2.semver.prerelease.length ? gt2.semver : false; if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false; } for (const c of dom) { hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">="; hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<="; - if (gt3) { + if (gt2) { if (needDomGTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { needDomGTPre = false; } } if (c.operator === ">" || c.operator === ">=") { - higher = higherGT(gt3, c, options); - if (higher === c && higher !== gt3) { + higher = higherGT(gt2, c, options); + if (higher === c && higher !== gt2) { return false; } - } else if (gt3.operator === ">=" && !satisfies4(gt3.semver, String(c), options)) { + } else if (gt2.operator === ">=" && !satisfies4(gt2.semver, String(c), options)) { return false; } } @@ -21179,14 +21179,14 @@ var require_subset = __commonJS({ return false; } } - if (!c.operator && (lt || gt3) && gtltComp !== 0) { + if (!c.operator && (lt || gt2) && gtltComp !== 0) { return false; } } - if (gt3 && hasDomLT && !lt && gtltComp !== 0) { + if (gt2 && hasDomLT && !lt && gtltComp !== 0) { return false; } - if (lt && hasDomGT && !gt3 && gtltComp !== 0) { + if (lt && hasDomGT && !gt2 && gtltComp !== 0) { return false; } if (needDomGTPre || needDomLTPre) { @@ -21235,7 +21235,7 @@ var require_semver2 = __commonJS({ var compareBuild = require_compare_build(); var sort = require_sort(); var rsort = require_rsort(); - var gt3 = require_gt(); + var gt2 = require_gt(); var lt = require_lt(); var eq = require_eq(); var neq = require_neq(); @@ -21273,7 +21273,7 @@ var require_semver2 = __commonJS({ compareBuild, sort, rsort, - gt: gt3, + gt: gt2, lt, eq, neq, @@ -27668,8 +27668,8 @@ var require_gt2 = __commonJS({ "node_modules/@actions/tool-cache/node_modules/semver/functions/gt.js"(exports2, module2) { "use strict"; var compare = require_compare2(); - var gt3 = (a, b, loose) => compare(a, b, loose) > 0; - module2.exports = gt3; + var gt2 = (a, b, loose) => compare(a, b, loose) > 0; + module2.exports = gt2; } }); @@ -27729,7 +27729,7 @@ var require_cmp2 = __commonJS({ "use strict"; var eq = require_eq2(); var neq = require_neq2(); - var gt3 = require_gt2(); + var gt2 = require_gt2(); var gte = require_gte2(); var lt = require_lt2(); var lte = require_lte2(); @@ -27758,7 +27758,7 @@ var require_cmp2 = __commonJS({ case "!=": return neq(a, b, loose); case ">": - return gt3(a, b, loose); + return gt2(a, b, loose); case ">=": return gte(a, b, loose); case "<": @@ -28438,7 +28438,7 @@ var require_min_version2 = __commonJS({ "use strict"; var SemVer = require_semver3(); var Range = require_range2(); - var gt3 = require_gt2(); + var gt2 = require_gt2(); var minVersion = (range2, loose) => { range2 = new Range(range2, loose); let minver = new SemVer("0.0.0"); @@ -28466,7 +28466,7 @@ var require_min_version2 = __commonJS({ /* fallthrough */ case "": case ">=": - if (!setMin || gt3(compver, setMin)) { + if (!setMin || gt2(compver, setMin)) { setMin = compver; } break; @@ -28478,7 +28478,7 @@ var require_min_version2 = __commonJS({ throw new Error(`Unexpected operation: ${comparator.operator}`); } }); - if (setMin && (!minver || gt3(minver, setMin))) { + if (setMin && (!minver || gt2(minver, setMin))) { minver = setMin; } } @@ -28516,7 +28516,7 @@ var require_outside2 = __commonJS({ var { ANY } = Comparator; var Range = require_range2(); var satisfies4 = require_satisfies2(); - var gt3 = require_gt2(); + var gt2 = require_gt2(); var lt = require_lt2(); var lte = require_lte2(); var gte = require_gte2(); @@ -28526,7 +28526,7 @@ var require_outside2 = __commonJS({ let gtfn, ltefn, ltfn, comp26, ecomp; switch (hilo) { case ">": - gtfn = gt3; + gtfn = gt2; ltefn = lte; ltfn = lt; comp26 = ">"; @@ -28535,7 +28535,7 @@ var require_outside2 = __commonJS({ case "<": gtfn = lt; ltefn = gte; - ltfn = gt3; + ltfn = gt2; comp26 = "<"; ecomp = "<="; break; @@ -28713,10 +28713,10 @@ var require_subset2 = __commonJS({ } } const eqSet = /* @__PURE__ */ new Set(); - let gt3, lt; + let gt2, lt; for (const c of sub) { if (c.operator === ">" || c.operator === ">=") { - gt3 = higherGT(gt3, c, options); + gt2 = higherGT(gt2, c, options); } else if (c.operator === "<" || c.operator === "<=") { lt = lowerLT(lt, c, options); } else { @@ -28727,16 +28727,16 @@ var require_subset2 = __commonJS({ return null; } let gtltComp; - if (gt3 && lt) { - gtltComp = compare(gt3.semver, lt.semver, options); + if (gt2 && lt) { + gtltComp = compare(gt2.semver, lt.semver, options); if (gtltComp > 0) { return null; - } else if (gtltComp === 0 && (gt3.operator !== ">=" || lt.operator !== "<=")) { + } else if (gtltComp === 0 && (gt2.operator !== ">=" || lt.operator !== "<=")) { return null; } } for (const eq of eqSet) { - if (gt3 && !satisfies4(eq, String(gt3), options)) { + if (gt2 && !satisfies4(eq, String(gt2), options)) { return null; } if (lt && !satisfies4(eq, String(lt), options)) { @@ -28752,25 +28752,25 @@ var require_subset2 = __commonJS({ let higher, lower; let hasDomLT, hasDomGT; let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false; - let needDomGTPre = gt3 && !options.includePrerelease && gt3.semver.prerelease.length ? gt3.semver : false; + let needDomGTPre = gt2 && !options.includePrerelease && gt2.semver.prerelease.length ? gt2.semver : false; if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) { needDomLTPre = false; } for (const c of dom) { hasDomGT = hasDomGT || c.operator === ">" || c.operator === ">="; hasDomLT = hasDomLT || c.operator === "<" || c.operator === "<="; - if (gt3) { + if (gt2) { if (needDomGTPre) { if (c.semver.prerelease && c.semver.prerelease.length && c.semver.major === needDomGTPre.major && c.semver.minor === needDomGTPre.minor && c.semver.patch === needDomGTPre.patch) { needDomGTPre = false; } } if (c.operator === ">" || c.operator === ">=") { - higher = higherGT(gt3, c, options); - if (higher === c && higher !== gt3) { + higher = higherGT(gt2, c, options); + if (higher === c && higher !== gt2) { return false; } - } else if (gt3.operator === ">=" && !satisfies4(gt3.semver, String(c), options)) { + } else if (gt2.operator === ">=" && !satisfies4(gt2.semver, String(c), options)) { return false; } } @@ -28789,14 +28789,14 @@ var require_subset2 = __commonJS({ return false; } } - if (!c.operator && (lt || gt3) && gtltComp !== 0) { + if (!c.operator && (lt || gt2) && gtltComp !== 0) { return false; } } - if (gt3 && hasDomLT && !lt && gtltComp !== 0) { + if (gt2 && hasDomLT && !lt && gtltComp !== 0) { return false; } - if (lt && hasDomGT && !gt3 && gtltComp !== 0) { + if (lt && hasDomGT && !gt2 && gtltComp !== 0) { return false; } if (needDomGTPre || needDomLTPre) { @@ -28845,7 +28845,7 @@ var require_semver4 = __commonJS({ var compareBuild = require_compare_build2(); var sort = require_sort2(); var rsort = require_rsort2(); - var gt3 = require_gt2(); + var gt2 = require_gt2(); var lt = require_lt2(); var eq = require_eq2(); var neq = require_neq2(); @@ -28883,7 +28883,7 @@ var require_semver4 = __commonJS({ compareBuild, sort, rsort, - gt: gt3, + gt: gt2, lt, eq, neq, @@ -29114,13 +29114,13 @@ var require_operator = __commonJS({ eq, ne, ge, - gt: gt3, + gt: gt2, "<": lt, "<=": le, "==": eq, "!=": ne, ">=": ge, - ">": gt3, + ">": gt2, "===": arbitrary }; function lt(version3, other) { @@ -29138,7 +29138,7 @@ var require_operator = __commonJS({ function ge(version3, other) { return compare(version3, other) >= 0; } - function gt3(version3, other) { + function gt2(version3, other) { return compare(version3, other) > 0; } function arbitrary(version3, other) { @@ -29521,7 +29521,7 @@ var require_semantic = __commonJS({ var require_pep440 = __commonJS({ "node_modules/@renovatebot/pep440/index.js"(exports2, module2) { var { valid: valid2, clean: clean3, explain, parse: parse3 } = require_version(); - var { lt, le, eq, ne, ge, gt: gt3, compare, rcompare } = require_operator(); + var { lt, le, eq, ne, ge, gt: gt2, compare, rcompare } = require_operator(); var { filter, maxSatisfying: maxSatisfying3, @@ -29546,7 +29546,7 @@ var require_pep440 = __commonJS({ neq: ne, ge, gte: ge, - gt: gt3, + gt: gt2, compare, rcompare, // range @@ -30046,8 +30046,8 @@ var require_semver5 = __commonJS({ return exports2.compareBuild(b, a, loose); }); } - exports2.gt = gt3; - function gt3(a, b, loose) { + exports2.gt = gt2; + function gt2(a, b, loose) { return compare(a, b, loose) > 0; } exports2.lt = lt; @@ -30092,7 +30092,7 @@ var require_semver5 = __commonJS({ case "!=": return neq(a, b, loose); case ">": - return gt3(a, b, loose); + return gt2(a, b, loose); case ">=": return gte(a, b, loose); case "<": @@ -30590,7 +30590,7 @@ var require_semver5 = __commonJS({ /* fallthrough */ case "": case ">=": - if (!minver || gt3(minver, compver)) { + if (!minver || gt2(minver, compver)) { minver = compver; } break; @@ -30631,7 +30631,7 @@ var require_semver5 = __commonJS({ var gtfn, ltefn, ltfn, comp26, ecomp; switch (hilo) { case ">": - gtfn = gt3; + gtfn = gt2; ltefn = lte; ltfn = lt; comp26 = ">"; @@ -30640,7 +30640,7 @@ var require_semver5 = __commonJS({ case "<": gtfn = lt; ltefn = gte; - ltfn = gt3; + ltfn = gt2; comp26 = "<"; ecomp = "<="; break; @@ -90965,7 +90965,7 @@ function _getGlobal(key, defaultValue) { // src/download/download-version.ts var pep440 = __toESM(require_pep440(), 1); -var semver5 = __toESM(require_semver5(), 1); +var semver4 = __toESM(require_semver5(), 1); // src/utils/constants.ts var TOOL_CACHE_NAME = "uv"; @@ -95511,9 +95511,6 @@ async function validateFileCheckSum(filePath, expected) { }); } -// src/download/manifest.ts -var semver4 = __toESM(require_semver5(), 1); - // src/utils/fetch.ts var import_undici2 = __toESM(require_undici2(), 1); function getProxyAgent() { @@ -95615,17 +95612,10 @@ function parseManifest(data, sourceDescription) { return versions; } async function getLatestVersion(manifestUrl = VERSIONS_MANIFEST_URL) { - const versions = await fetchManifest(manifestUrl); - const [firstVersion, ...remainingVersions] = versions.map( - (versionData) => versionData.version - ); - if (firstVersion === void 0) { + const latestVersion = (await fetchManifest(manifestUrl))[0]?.version; + if (latestVersion === void 0) { throw new Error("No versions found in manifest data"); } - const latestVersion = remainingVersions.reduce( - (latest, current) => semver4.gt(current, latest) ? current : latest, - firstVersion - ); debug(`Latest version from manifest: ${latestVersion}`); return latestVersion; } @@ -95833,7 +95823,7 @@ function maxSatisfying2(versions, version3) { return void 0; } function minSatisfying3(versions, version3) { - const minSemver = semver5.minSatisfying(versions, version3); + const minSemver = semver4.minSatisfying(versions, version3); if (minSemver !== null) { debug(`Found a version that satisfies the semver range: ${minSemver}`); return minSemver; diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index 3b81829..c8c7c5e 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -19064,8 +19064,8 @@ var require_semver = __commonJS({ return exports2.compareBuild(b, a, loose); }); } - exports2.gt = gt2; - function gt2(a, b, loose) { + exports2.gt = gt; + function gt(a, b, loose) { return compare(a, b, loose) > 0; } exports2.lt = lt; @@ -19110,7 +19110,7 @@ var require_semver = __commonJS({ case "!=": return neq(a, b, loose); case ">": - return gt2(a, b, loose); + return gt(a, b, loose); case ">=": return gte(a, b, loose); case "<": @@ -19608,7 +19608,7 @@ var require_semver = __commonJS({ /* fallthrough */ case "": case ">=": - if (!minver || gt2(minver, compver)) { + if (!minver || gt(minver, compver)) { minver = compver; } break; @@ -19649,7 +19649,7 @@ var require_semver = __commonJS({ var gtfn, ltefn, ltfn, comp, ecomp; switch (hilo) { case ">": - gtfn = gt2; + gtfn = gt; ltefn = lte2; ltfn = lt; comp = ">"; @@ -19658,7 +19658,7 @@ var require_semver = __commonJS({ case "<": gtfn = lt; ltefn = gte; - ltfn = gt2; + ltfn = gt; comp = "<"; ecomp = "<="; break; @@ -44945,7 +44945,7 @@ function info(message) { } // src/update-known-checksums.ts -var semver2 = __toESM(require_semver(), 1); +var semver = __toESM(require_semver(), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { @@ -49463,9 +49463,6 @@ async function updateChecksums(filePath, checksumEntries) { await import_node_fs.promises.writeFile(filePath, content); } -// src/download/manifest.ts -var semver = __toESM(require_semver(), 1); - // src/utils/constants.ts var VERSIONS_MANIFEST_URL = "https://raw.githubusercontent.com/astral-sh/versions/main/v1/uv.ndjson"; @@ -49544,17 +49541,10 @@ function parseManifest(data, sourceDescription) { return versions; } async function getLatestVersion(manifestUrl = VERSIONS_MANIFEST_URL) { - const versions = await fetchManifest(manifestUrl); - const [firstVersion, ...remainingVersions] = versions.map( - (versionData) => versionData.version - ); - if (firstVersion === void 0) { + const latestVersion = (await fetchManifest(manifestUrl))[0]?.version; + if (latestVersion === void 0) { throw new Error("No versions found in manifest data"); } - const latestVersion = remainingVersions.reduce( - (latest, current) => semver.gt(current, latest) ? current : latest, - firstVersion - ); debug(`Latest version from manifest: ${latestVersion}`); return latestVersion; } @@ -49589,7 +49579,7 @@ async function run() { } const latestVersion = await getLatestVersion(); const latestKnownVersion = getLatestKnownVersionFromChecksums(); - if (semver2.lte(latestVersion, latestKnownVersion)) { + if (semver.lte(latestVersion, latestKnownVersion)) { info( `Latest release (${latestVersion}) is not newer than the latest known version (${latestKnownVersion}). Skipping update.` ); @@ -49608,7 +49598,7 @@ function getLatestKnownVersionFromChecksums() { versions.add(version); } } - const latestVersion = [...versions].sort(semver2.rcompare)[0]; + const latestVersion = [...versions].sort(semver.rcompare)[0]; if (!latestVersion) { throw new Error("Could not determine latest known version from checksums."); } diff --git a/src/download/manifest.ts b/src/download/manifest.ts index 21084b7..a033334 100644 --- a/src/download/manifest.ts +++ b/src/download/manifest.ts @@ -1,5 +1,4 @@ import * as core from "@actions/core"; -import * as semver from "semver"; import { VERSIONS_MANIFEST_URL } from "../utils/constants"; import { fetch } from "../utils/fetch"; import { selectDefaultVariant } from "./variant-selection"; @@ -99,20 +98,12 @@ export function parseManifest( export async function getLatestVersion( manifestUrl: string = VERSIONS_MANIFEST_URL, ): Promise { - const versions = await fetchManifest(manifestUrl); - const [firstVersion, ...remainingVersions] = versions.map( - (versionData) => versionData.version, - ); + const latestVersion = (await fetchManifest(manifestUrl))[0]?.version; - if (firstVersion === undefined) { + if (latestVersion === undefined) { throw new Error("No versions found in manifest data"); } - const latestVersion = remainingVersions.reduce( - (latest, current) => (semver.gt(current, latest) ? current : latest), - firstVersion, - ); - core.debug(`Latest version from manifest: ${latestVersion}`); return latestVersion; } From 16592cddee295b60b48cf3202a6dbe45c6f479f9 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sun, 29 Mar 2026 19:36:34 +0200 Subject: [PATCH 13/20] Pin setup-uv docs to v8 (#829) Update all README and docs examples to use the pinned v8 release SHA for astral-sh/setup-uv, with a comment showing the release version for clarity and best practices. --- README.md | 16 ++++++++-------- docs/advanced-version-configuration.md | 14 +++++++------- docs/caching.md | 24 ++++++++++++------------ docs/customization.md | 6 +++--- docs/environment-and-tools.md | 16 ++++++++-------- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 30736be..b7bfb1b 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ Set up your GitHub Actions workflow with a specific version of [uv](https://docs ```yaml - name: Install the latest version of uv - uses: astral-sh/setup-uv@v7 + 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) @@ -42,7 +42,7 @@ Have a look under [Advanced Configuration](#advanced-configuration) for detailed ```yaml - name: Install uv with all available options - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: # The version of uv to install (default: searches for version in config files, then latest) version: "" @@ -139,7 +139,7 @@ This will override any python version specifications in `pyproject.toml` and `.p ```yaml - name: Install the latest version of uv and set the python version to 3.13t - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: python-version: 3.13t - run: uv pip install --python=3.13t pip @@ -157,7 +157,7 @@ jobs: steps: - uses: actions/checkout@v5 - name: Install the latest version of uv and set the python version - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: python-version: ${{ matrix.python-version }} - name: Test with python ${{ matrix.python-version }} @@ -174,7 +174,7 @@ It also controls where [the venv gets created](#activate-environment), unless `v ```yaml - name: Install uv based on the config files in the working-directory - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: working-directory: my/subproject/dir ``` @@ -216,7 +216,7 @@ For example: - name: Checkout the repository uses: actions/checkout@main - name: Install the latest version of uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true - name: Test @@ -228,7 +228,7 @@ To install a specific version of Python, use ```yaml - name: Install the latest version of uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true - name: Install Python 3.12 @@ -247,7 +247,7 @@ output: uses: actions/checkout@main - name: Install the default version of uv id: setup-uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 - name: Print the installed version run: echo "Installed uv version is ${{ steps.setup-uv.outputs.uv-version }}" ``` diff --git a/docs/advanced-version-configuration.md b/docs/advanced-version-configuration.md index 3da882a..5af2bca 100644 --- a/docs/advanced-version-configuration.md +++ b/docs/advanced-version-configuration.md @@ -6,7 +6,7 @@ This document covers advanced options for configuring which version of uv to ins ```yaml - name: Install the latest version of uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: version: "latest" ``` @@ -15,7 +15,7 @@ This document covers advanced options for configuring which version of uv to ins ```yaml - name: Install a specific version of uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: version: "0.4.4" ``` @@ -28,21 +28,21 @@ to install the latest version that satisfies the range. ```yaml - name: Install a semver range of uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: version: ">=0.4.0" ``` ```yaml - name: Pinning a minor version of uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: version: "0.4.x" ``` ```yaml - name: Install a pep440-specifier-satisfying version of uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: version: ">=0.4.25,<0.5" ``` @@ -54,7 +54,7 @@ You can change this behavior using the `resolution-strategy` input: ```yaml - name: Install the lowest compatible version of uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: version: ">=0.4.0" resolution-strategy: "lowest" @@ -76,7 +76,7 @@ uv defined as a dependency in `pyproject.toml` or `requirements.txt`. ```yaml - name: Install uv based on the version defined in pyproject.toml - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: version-file: "pyproject.toml" ``` diff --git a/docs/caching.md b/docs/caching.md index 82063d2..c38691a 100644 --- a/docs/caching.md +++ b/docs/caching.md @@ -23,7 +23,7 @@ The computed cache key is available as the `cache-key` output: ```yaml - name: Setup uv id: setup-uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true - name: Print cache key @@ -50,7 +50,7 @@ You can optionally define a custom cache key suffix. ```yaml - name: Enable caching and define a custom cache key suffix id: setup-uv - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true cache-suffix: "optional-suffix" @@ -89,7 +89,7 @@ changes. If you use relative paths, they are relative to the working directory. ```yaml - name: Define a cache dependency glob - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true cache-dependency-glob: "**/pyproject.toml" @@ -97,7 +97,7 @@ changes. If you use relative paths, they are relative to the working directory. ```yaml - name: Define a list of cache dependency globs - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true cache-dependency-glob: | @@ -107,7 +107,7 @@ changes. If you use relative paths, they are relative to the working directory. ```yaml - name: Define an absolute cache dependency glob - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true 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 - name: Never invalidate the cache - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true cache-dependency-glob: "" @@ -128,7 +128,7 @@ By default, the cache will be restored. ```yaml - name: Don't restore an existing cache - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true restore-cache: false @@ -142,7 +142,7 @@ By default, the cache will be saved. ```yaml - name: Don't save the cache after the run - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true 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 - name: Define a custom uv cache path - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: cache-local-path: "/path/to/cache" ``` @@ -187,7 +187,7 @@ input. ```yaml - name: Don't prune the cache before saving it - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true prune-cache: false @@ -205,7 +205,7 @@ To force managed Python installs, set `UV_PYTHON_PREFERENCE=only-managed`. ```yaml - name: Cache Python installs - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true cache-python: true @@ -218,7 +218,7 @@ If you want to ignore this, set the `ignore-nothing-to-cache` input to `true`. ```yaml - name: Ignore nothing to cache - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: enable-cache: true ignore-nothing-to-cache: true diff --git a/docs/customization.md b/docs/customization.md index 5079746..a1605fc 100644 --- a/docs/customization.md +++ b/docs/customization.md @@ -10,7 +10,7 @@ are automatically verified by this action. The sha256 hashes can be found on the ```yaml - name: Install a specific version and validate the checksum - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: version: "0.3.1" checksum: "e11b01402ab645392c7ad6044db63d37e4fd1e745e015306993b07695ea5f9f8" @@ -39,7 +39,7 @@ The `archive_format` field is currently ignored. ```yaml - name: Use a custom manifest file - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: 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 - name: Install the latest version of uv without problem matchers - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: add-problem-matchers: false ``` diff --git a/docs/environment-and-tools.md b/docs/environment-and-tools.md index 8b6064a..eb7d302 100644 --- a/docs/environment-and-tools.md +++ b/docs/environment-and-tools.md @@ -9,7 +9,7 @@ This allows directly using it in later steps: ```yaml - name: Install the latest version of uv and activate the environment - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: activate-environment: true - 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: ```yaml -- uses: astral-sh/setup-uv@v7 +- uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: activate-environment: true 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 - name: Install the latest version of uv with a custom GitHub token - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: github-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} ``` @@ -69,7 +69,7 @@ input: ```yaml - name: Install the latest version of uv with a custom tool dir - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: 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 - name: Install the latest version of uv with a custom tool bin dir - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: 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 - name: Expand the tilde character - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: cache-local-path: "~/path/to/cache" 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 - name: Ignore empty workdir - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: ignore-empty-workdir: true ``` @@ -145,7 +145,7 @@ This action sets several environment variables that influence uv's behavior and ```yaml - name: Example using environment variables - uses: astral-sh/setup-uv@v7 + uses: astral-sh/setup-uv@cec208311dfd045dd5311c1add060b2062131d57 # v8.0.0 with: python-version: "3.12" tool-dir: "/custom/tool/dir" From d7fe1a5a186096cccdd5fa2252d223b54fa53a72 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Tue, 31 Mar 2026 09:27:10 +0200 Subject: [PATCH 14/20] Update ignore-nothing-to-cache documentation (#833) Add the error message so it can be found when searching for it Helps issues like #831 --- docs/caching.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/caching.md b/docs/caching.md index c38691a..f6d6481 100644 --- a/docs/caching.md +++ b/docs/caching.md @@ -213,7 +213,12 @@ To force managed Python installs, set `UV_PYTHON_PREFERENCE=only-managed`. ## Ignore nothing to cache -By default, the action will fail if caching is enabled but there is nothing to upload (the uv cache directory does not exist). +By default, the action will fail if caching is enabled but there is nothing to upload (the uv cache directory does not exist) with an error like + +```console +Error: Cache path /home/runner/.cache/uv does not exist on disk. This likely indicates that there are no dependencies to cache. Consider disabling the cache input if it is not needed. +``` + If you want to ignore this, set the `ignore-nothing-to-cache` input to `true`. ```yaml From 1c15d185f03657a1644ed2684496fb7c6ed59815 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 Apr 2026 10:42:50 +0200 Subject: [PATCH 15/20] chore: update known checksums for 0.11.3 (#836) chore: update known checksums for 0.11.3 Co-authored-by: eifinger --- dist/setup/index.cjs | 18 ++++++++++++ dist/update-known-checksums/index.cjs | 18 ++++++++++++ src/download/checksum/known-checksums.ts | 36 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index 06712a7..d96aa48 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -90981,6 +90981,24 @@ var fs10 = __toESM(require("node:fs"), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.3": "2bc3d0c7bf2bd08325b1e170abac6f7e5b3346e1d4eab3370d17cefec934996f", + "aarch64-pc-windows-msvc-0.11.3": "e99c56f9ab5e1e1ddcaea3e2389990c94baf38e0d7cb2148de08baf2d3261d49", + "aarch64-unknown-linux-gnu-0.11.3": "711382e3158433f06b11d99afb440f4416359fc3c84558886d8ed8826a921bff", + "aarch64-unknown-linux-musl-0.11.3": "8ecec82cb9a744d5fabff6d16d7777218a7730f699d2aa0d2f751c17858e2efa", + "arm-unknown-linux-musleabihf-0.11.3": "3d021046a94ad11f12b9d83f36442a1a28e92e7149c3f79ba2951c96653dafac", + "armv7-unknown-linux-gnueabihf-0.11.3": "13c9a0f5f624275ccd36db2896607f4fee3585f420734b16f6c66d70e32aa458", + "armv7-unknown-linux-musleabihf-0.11.3": "260a88e2f00daab0363a745fde036a7881002d7a81094388f31925acb284110b", + "i686-pc-windows-msvc-0.11.3": "036fa39fa5ea3cb86c127324924b913b5858e8d91c4cb413edacfc3123001696", + "i686-unknown-linux-gnu-0.11.3": "b9410c8dae2fa0d4939af5b0ee7272d5591bd55890e8274dcf7f1aea84bfe043", + "i686-unknown-linux-musl-0.11.3": "afe533fd409105e753d844490c65a4375e75bfb3812e49122684f996bed9e90a", + "powerpc64le-unknown-linux-gnu-0.11.3": "5cdcadf4d50a5354312bc8ef37c2a6cfab4e2f13ccdf8380d3012b927b4ded95", + "riscv64gc-unknown-linux-gnu-0.11.3": "8271e07ed9695870f4b0ae5ec722e3ae08fff280068f08bc6a8ca76c67d7fefa", + "riscv64gc-unknown-linux-musl-0.11.3": "b750fc8393ced9939448849b05e94de6bf1e998bb7030c4ebe744b47b372bce9", + "s390x-unknown-linux-gnu-0.11.3": "6dc4f555a5f6515f7fddb281422d2a8a3943853dae5de837bbb5d996d7576c71", + "x86_64-apple-darwin-0.11.3": "b0e05e0b43a000fdc2132ee3f3400ba5dee427bc2337d3ec4eb8cf4f3d5722af", + "x86_64-pc-windows-msvc-0.11.3": "ae681c0aaec7cc96af184648cb88d73f8393ed60fa5880abdd6bdb910f9b227c", + "x86_64-unknown-linux-gnu-0.11.3": "c0f3236f146e55472663cfbcc9be3042a9f1092275bbe3fe2a56a6cbfd3da5ce", + "x86_64-unknown-linux-musl-0.11.3": "8b40cf16b849634b81a530a3d0a0bcae5f24996ef9ae782976fd69b6266d3b8e", "aarch64-apple-darwin-0.11.2": "4beaa9550f93ef7f0fc02f7c28c9c48cd61fe30db00f5ac8947e0a425c3fb282", "aarch64-pc-windows-msvc-0.11.2": "ffdded8338205f53727b51d404563a5ac8eaa9aea53279a7b7c42177e11d478c", "aarch64-unknown-linux-gnu-0.11.2": "04792cac761c4a6ba78267f36f2af541b7f92196d42ac55d21d3ff6b0f5ab6a5", diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index c8c7c5e..b61c7d3 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -44949,6 +44949,24 @@ var semver = __toESM(require_semver(), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.3": "2bc3d0c7bf2bd08325b1e170abac6f7e5b3346e1d4eab3370d17cefec934996f", + "aarch64-pc-windows-msvc-0.11.3": "e99c56f9ab5e1e1ddcaea3e2389990c94baf38e0d7cb2148de08baf2d3261d49", + "aarch64-unknown-linux-gnu-0.11.3": "711382e3158433f06b11d99afb440f4416359fc3c84558886d8ed8826a921bff", + "aarch64-unknown-linux-musl-0.11.3": "8ecec82cb9a744d5fabff6d16d7777218a7730f699d2aa0d2f751c17858e2efa", + "arm-unknown-linux-musleabihf-0.11.3": "3d021046a94ad11f12b9d83f36442a1a28e92e7149c3f79ba2951c96653dafac", + "armv7-unknown-linux-gnueabihf-0.11.3": "13c9a0f5f624275ccd36db2896607f4fee3585f420734b16f6c66d70e32aa458", + "armv7-unknown-linux-musleabihf-0.11.3": "260a88e2f00daab0363a745fde036a7881002d7a81094388f31925acb284110b", + "i686-pc-windows-msvc-0.11.3": "036fa39fa5ea3cb86c127324924b913b5858e8d91c4cb413edacfc3123001696", + "i686-unknown-linux-gnu-0.11.3": "b9410c8dae2fa0d4939af5b0ee7272d5591bd55890e8274dcf7f1aea84bfe043", + "i686-unknown-linux-musl-0.11.3": "afe533fd409105e753d844490c65a4375e75bfb3812e49122684f996bed9e90a", + "powerpc64le-unknown-linux-gnu-0.11.3": "5cdcadf4d50a5354312bc8ef37c2a6cfab4e2f13ccdf8380d3012b927b4ded95", + "riscv64gc-unknown-linux-gnu-0.11.3": "8271e07ed9695870f4b0ae5ec722e3ae08fff280068f08bc6a8ca76c67d7fefa", + "riscv64gc-unknown-linux-musl-0.11.3": "b750fc8393ced9939448849b05e94de6bf1e998bb7030c4ebe744b47b372bce9", + "s390x-unknown-linux-gnu-0.11.3": "6dc4f555a5f6515f7fddb281422d2a8a3943853dae5de837bbb5d996d7576c71", + "x86_64-apple-darwin-0.11.3": "b0e05e0b43a000fdc2132ee3f3400ba5dee427bc2337d3ec4eb8cf4f3d5722af", + "x86_64-pc-windows-msvc-0.11.3": "ae681c0aaec7cc96af184648cb88d73f8393ed60fa5880abdd6bdb910f9b227c", + "x86_64-unknown-linux-gnu-0.11.3": "c0f3236f146e55472663cfbcc9be3042a9f1092275bbe3fe2a56a6cbfd3da5ce", + "x86_64-unknown-linux-musl-0.11.3": "8b40cf16b849634b81a530a3d0a0bcae5f24996ef9ae782976fd69b6266d3b8e", "aarch64-apple-darwin-0.11.2": "4beaa9550f93ef7f0fc02f7c28c9c48cd61fe30db00f5ac8947e0a425c3fb282", "aarch64-pc-windows-msvc-0.11.2": "ffdded8338205f53727b51d404563a5ac8eaa9aea53279a7b7c42177e11d478c", "aarch64-unknown-linux-gnu-0.11.2": "04792cac761c4a6ba78267f36f2af541b7f92196d42ac55d21d3ff6b0f5ab6a5", diff --git a/src/download/checksum/known-checksums.ts b/src/download/checksum/known-checksums.ts index 3caebc2..f670760 100644 --- a/src/download/checksum/known-checksums.ts +++ b/src/download/checksum/known-checksums.ts @@ -1,5 +1,41 @@ // AUTOGENERATED_DO_NOT_EDIT export const KNOWN_CHECKSUMS: { [key: string]: string } = { + "aarch64-apple-darwin-0.11.3": + "2bc3d0c7bf2bd08325b1e170abac6f7e5b3346e1d4eab3370d17cefec934996f", + "aarch64-pc-windows-msvc-0.11.3": + "e99c56f9ab5e1e1ddcaea3e2389990c94baf38e0d7cb2148de08baf2d3261d49", + "aarch64-unknown-linux-gnu-0.11.3": + "711382e3158433f06b11d99afb440f4416359fc3c84558886d8ed8826a921bff", + "aarch64-unknown-linux-musl-0.11.3": + "8ecec82cb9a744d5fabff6d16d7777218a7730f699d2aa0d2f751c17858e2efa", + "arm-unknown-linux-musleabihf-0.11.3": + "3d021046a94ad11f12b9d83f36442a1a28e92e7149c3f79ba2951c96653dafac", + "armv7-unknown-linux-gnueabihf-0.11.3": + "13c9a0f5f624275ccd36db2896607f4fee3585f420734b16f6c66d70e32aa458", + "armv7-unknown-linux-musleabihf-0.11.3": + "260a88e2f00daab0363a745fde036a7881002d7a81094388f31925acb284110b", + "i686-pc-windows-msvc-0.11.3": + "036fa39fa5ea3cb86c127324924b913b5858e8d91c4cb413edacfc3123001696", + "i686-unknown-linux-gnu-0.11.3": + "b9410c8dae2fa0d4939af5b0ee7272d5591bd55890e8274dcf7f1aea84bfe043", + "i686-unknown-linux-musl-0.11.3": + "afe533fd409105e753d844490c65a4375e75bfb3812e49122684f996bed9e90a", + "powerpc64le-unknown-linux-gnu-0.11.3": + "5cdcadf4d50a5354312bc8ef37c2a6cfab4e2f13ccdf8380d3012b927b4ded95", + "riscv64gc-unknown-linux-gnu-0.11.3": + "8271e07ed9695870f4b0ae5ec722e3ae08fff280068f08bc6a8ca76c67d7fefa", + "riscv64gc-unknown-linux-musl-0.11.3": + "b750fc8393ced9939448849b05e94de6bf1e998bb7030c4ebe744b47b372bce9", + "s390x-unknown-linux-gnu-0.11.3": + "6dc4f555a5f6515f7fddb281422d2a8a3943853dae5de837bbb5d996d7576c71", + "x86_64-apple-darwin-0.11.3": + "b0e05e0b43a000fdc2132ee3f3400ba5dee427bc2337d3ec4eb8cf4f3d5722af", + "x86_64-pc-windows-msvc-0.11.3": + "ae681c0aaec7cc96af184648cb88d73f8393ed60fa5880abdd6bdb910f9b227c", + "x86_64-unknown-linux-gnu-0.11.3": + "c0f3236f146e55472663cfbcc9be3042a9f1092275bbe3fe2a56a6cbfd3da5ce", + "x86_64-unknown-linux-musl-0.11.3": + "8b40cf16b849634b81a530a3d0a0bcae5f24996ef9ae782976fd69b6266d3b8e", "aarch64-apple-darwin-0.11.2": "4beaa9550f93ef7f0fc02f7c28c9c48cd61fe30db00f5ac8947e0a425c3fb282", "aarch64-pc-windows-msvc-0.11.2": From 7b222e12b6a6f02426bba48a06bbb55ebcba67e5 Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 7 Apr 2026 08:39:52 -0500 Subject: [PATCH 16/20] Add a release workflow (#839) Uses a release workflow with environment protection for publishing releases instead of relying on user invocation. The `release` environment can then be protected, e.g., requiring approval from another team member. We can add a tag ruleset to prevent tags from being created outside of the `release` environment. I've never used Release drafter, but the workflow here differs from our other projects in that the release process just marks the draft release as final and adds the tag. The draft release is required, for simplicity. --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0355c99 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,58 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: "Release version (e.g., 8.1.0)" + required: true + type: string + +permissions: {} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + environment: release + permissions: + contents: write + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + + - name: Validate version + env: + VERSION: ${{ 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 + + - 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) || { + 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 + + echo "Publishing draft release $TAG" + gh release edit "$TAG" --draft=false From a0b52019f16c97e3556f720a3c894238c92f87d7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 8 Apr 2026 07:42:52 +0200 Subject: [PATCH 17/20] chore: update known checksums for 0.11.4 (#843) chore: update known checksums for 0.11.4 Co-authored-by: eifinger --- dist/setup/index.cjs | 18 ++++++++++++ dist/update-known-checksums/index.cjs | 18 ++++++++++++ src/download/checksum/known-checksums.ts | 36 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index d96aa48..5ceae96 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -90981,6 +90981,24 @@ var fs10 = __toESM(require("node:fs"), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.4": "9b9cb6c6f58c3246dbf3351ed4e97c500bc3266f5f237d2fd620b66e1c31dc56", + "aarch64-pc-windows-msvc-0.11.4": "708b1c210109e50ff520bcd9b6d29cbd8cee584bb55e84d3d1941bf75ab0893d", + "aarch64-unknown-linux-gnu-0.11.4": "f5aa91bba0b98d85a4e5262e2847f9ab2273c754f6374dff62b37ef18c65a2e7", + "aarch64-unknown-linux-musl-0.11.4": "a02ec7667d7bb1d33cdb7e1de22f7e4242967e3df7e350bac6212515e3bce8ac", + "arm-unknown-linux-musleabihf-0.11.4": "5bbc59d8c3d5fdade88fca47e4c18298e44a367e178e97e11466b22e992edae2", + "armv7-unknown-linux-gnueabihf-0.11.4": "9d2299155b65988643a55777c638408a0df8e65f606933d1e44691ada72ff106", + "armv7-unknown-linux-musleabihf-0.11.4": "43b1e02f8f4b27fd1d085fb14a246638bb607af32408cb13c5c3b3fb47db027f", + "i686-pc-windows-msvc-0.11.4": "661588b3607e6d5bb78551f596772a0d04a930ce128189c90800d07f6fca1998", + "i686-unknown-linux-gnu-0.11.4": "4248773a2574c3b697588655d7bf14f97baa744c3e156585230e5c711befa6ff", + "i686-unknown-linux-musl-0.11.4": "0323c08c1e7455cdf65c89296eda28bad9051cb09d16ea3ce1d0bf718143449e", + "powerpc64le-unknown-linux-gnu-0.11.4": "3ddb764538a5dcb4967d7375fde193ce5391e37ddd4d1242012d04cf3848479f", + "riscv64gc-unknown-linux-gnu-0.11.4": "93db93607a824d677c47003ee828936913cfdeb2c871bb34cd79c3ec4481e2b1", + "riscv64gc-unknown-linux-musl-0.11.4": "78f0d7f92244ce3d7a7a0df5fab2495450bcb18600b59acf1755e77cafed2300", + "s390x-unknown-linux-gnu-0.11.4": "07361e1fb32e870841a27d3d7b0b20c4a81e0cc25eeb8b9115425bfd227d2d05", + "x86_64-apple-darwin-0.11.4": "c326edaf3fd492f53d1c58777f3459c0d87bf9dae8d89e80aec4b0da6622dcf3", + "x86_64-pc-windows-msvc-0.11.4": "26d84455a40b0272b2ab4785cad298ff2c89cd0765b482e9f85b5a1bd880a863", + "x86_64-unknown-linux-gnu-0.11.4": "12f9a192bb32d70470aa22cbd2a193d1323a3f58f6ac5f9e3866aaca760c98c6", + "x86_64-unknown-linux-musl-0.11.4": "36ce1c5d8997db9b6a24d0f41646d5509b6d1d8b9448c7325f8248a6ea5d4b00", "aarch64-apple-darwin-0.11.3": "2bc3d0c7bf2bd08325b1e170abac6f7e5b3346e1d4eab3370d17cefec934996f", "aarch64-pc-windows-msvc-0.11.3": "e99c56f9ab5e1e1ddcaea3e2389990c94baf38e0d7cb2148de08baf2d3261d49", "aarch64-unknown-linux-gnu-0.11.3": "711382e3158433f06b11d99afb440f4416359fc3c84558886d8ed8826a921bff", diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index b61c7d3..dfadb7c 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -44949,6 +44949,24 @@ var semver = __toESM(require_semver(), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.4": "9b9cb6c6f58c3246dbf3351ed4e97c500bc3266f5f237d2fd620b66e1c31dc56", + "aarch64-pc-windows-msvc-0.11.4": "708b1c210109e50ff520bcd9b6d29cbd8cee584bb55e84d3d1941bf75ab0893d", + "aarch64-unknown-linux-gnu-0.11.4": "f5aa91bba0b98d85a4e5262e2847f9ab2273c754f6374dff62b37ef18c65a2e7", + "aarch64-unknown-linux-musl-0.11.4": "a02ec7667d7bb1d33cdb7e1de22f7e4242967e3df7e350bac6212515e3bce8ac", + "arm-unknown-linux-musleabihf-0.11.4": "5bbc59d8c3d5fdade88fca47e4c18298e44a367e178e97e11466b22e992edae2", + "armv7-unknown-linux-gnueabihf-0.11.4": "9d2299155b65988643a55777c638408a0df8e65f606933d1e44691ada72ff106", + "armv7-unknown-linux-musleabihf-0.11.4": "43b1e02f8f4b27fd1d085fb14a246638bb607af32408cb13c5c3b3fb47db027f", + "i686-pc-windows-msvc-0.11.4": "661588b3607e6d5bb78551f596772a0d04a930ce128189c90800d07f6fca1998", + "i686-unknown-linux-gnu-0.11.4": "4248773a2574c3b697588655d7bf14f97baa744c3e156585230e5c711befa6ff", + "i686-unknown-linux-musl-0.11.4": "0323c08c1e7455cdf65c89296eda28bad9051cb09d16ea3ce1d0bf718143449e", + "powerpc64le-unknown-linux-gnu-0.11.4": "3ddb764538a5dcb4967d7375fde193ce5391e37ddd4d1242012d04cf3848479f", + "riscv64gc-unknown-linux-gnu-0.11.4": "93db93607a824d677c47003ee828936913cfdeb2c871bb34cd79c3ec4481e2b1", + "riscv64gc-unknown-linux-musl-0.11.4": "78f0d7f92244ce3d7a7a0df5fab2495450bcb18600b59acf1755e77cafed2300", + "s390x-unknown-linux-gnu-0.11.4": "07361e1fb32e870841a27d3d7b0b20c4a81e0cc25eeb8b9115425bfd227d2d05", + "x86_64-apple-darwin-0.11.4": "c326edaf3fd492f53d1c58777f3459c0d87bf9dae8d89e80aec4b0da6622dcf3", + "x86_64-pc-windows-msvc-0.11.4": "26d84455a40b0272b2ab4785cad298ff2c89cd0765b482e9f85b5a1bd880a863", + "x86_64-unknown-linux-gnu-0.11.4": "12f9a192bb32d70470aa22cbd2a193d1323a3f58f6ac5f9e3866aaca760c98c6", + "x86_64-unknown-linux-musl-0.11.4": "36ce1c5d8997db9b6a24d0f41646d5509b6d1d8b9448c7325f8248a6ea5d4b00", "aarch64-apple-darwin-0.11.3": "2bc3d0c7bf2bd08325b1e170abac6f7e5b3346e1d4eab3370d17cefec934996f", "aarch64-pc-windows-msvc-0.11.3": "e99c56f9ab5e1e1ddcaea3e2389990c94baf38e0d7cb2148de08baf2d3261d49", "aarch64-unknown-linux-gnu-0.11.3": "711382e3158433f06b11d99afb440f4416359fc3c84558886d8ed8826a921bff", diff --git a/src/download/checksum/known-checksums.ts b/src/download/checksum/known-checksums.ts index f670760..72b1347 100644 --- a/src/download/checksum/known-checksums.ts +++ b/src/download/checksum/known-checksums.ts @@ -1,5 +1,41 @@ // AUTOGENERATED_DO_NOT_EDIT export const KNOWN_CHECKSUMS: { [key: string]: string } = { + "aarch64-apple-darwin-0.11.4": + "9b9cb6c6f58c3246dbf3351ed4e97c500bc3266f5f237d2fd620b66e1c31dc56", + "aarch64-pc-windows-msvc-0.11.4": + "708b1c210109e50ff520bcd9b6d29cbd8cee584bb55e84d3d1941bf75ab0893d", + "aarch64-unknown-linux-gnu-0.11.4": + "f5aa91bba0b98d85a4e5262e2847f9ab2273c754f6374dff62b37ef18c65a2e7", + "aarch64-unknown-linux-musl-0.11.4": + "a02ec7667d7bb1d33cdb7e1de22f7e4242967e3df7e350bac6212515e3bce8ac", + "arm-unknown-linux-musleabihf-0.11.4": + "5bbc59d8c3d5fdade88fca47e4c18298e44a367e178e97e11466b22e992edae2", + "armv7-unknown-linux-gnueabihf-0.11.4": + "9d2299155b65988643a55777c638408a0df8e65f606933d1e44691ada72ff106", + "armv7-unknown-linux-musleabihf-0.11.4": + "43b1e02f8f4b27fd1d085fb14a246638bb607af32408cb13c5c3b3fb47db027f", + "i686-pc-windows-msvc-0.11.4": + "661588b3607e6d5bb78551f596772a0d04a930ce128189c90800d07f6fca1998", + "i686-unknown-linux-gnu-0.11.4": + "4248773a2574c3b697588655d7bf14f97baa744c3e156585230e5c711befa6ff", + "i686-unknown-linux-musl-0.11.4": + "0323c08c1e7455cdf65c89296eda28bad9051cb09d16ea3ce1d0bf718143449e", + "powerpc64le-unknown-linux-gnu-0.11.4": + "3ddb764538a5dcb4967d7375fde193ce5391e37ddd4d1242012d04cf3848479f", + "riscv64gc-unknown-linux-gnu-0.11.4": + "93db93607a824d677c47003ee828936913cfdeb2c871bb34cd79c3ec4481e2b1", + "riscv64gc-unknown-linux-musl-0.11.4": + "78f0d7f92244ce3d7a7a0df5fab2495450bcb18600b59acf1755e77cafed2300", + "s390x-unknown-linux-gnu-0.11.4": + "07361e1fb32e870841a27d3d7b0b20c4a81e0cc25eeb8b9115425bfd227d2d05", + "x86_64-apple-darwin-0.11.4": + "c326edaf3fd492f53d1c58777f3459c0d87bf9dae8d89e80aec4b0da6622dcf3", + "x86_64-pc-windows-msvc-0.11.4": + "26d84455a40b0272b2ab4785cad298ff2c89cd0765b482e9f85b5a1bd880a863", + "x86_64-unknown-linux-gnu-0.11.4": + "12f9a192bb32d70470aa22cbd2a193d1323a3f58f6ac5f9e3866aaca760c98c6", + "x86_64-unknown-linux-musl-0.11.4": + "36ce1c5d8997db9b6a24d0f41646d5509b6d1d8b9448c7325f8248a6ea5d4b00", "aarch64-apple-darwin-0.11.3": "2bc3d0c7bf2bd08325b1e170abac6f7e5b3346e1d4eab3370d17cefec934996f", "aarch64-pc-windows-msvc-0.11.3": From 1912cc65f2e839707d7a16f2372f30b57d35fd80 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 9 Apr 2026 08:26:38 +0200 Subject: [PATCH 18/20] chore: update known checksums for 0.11.5 (#845) chore: update known checksums for 0.11.5 Co-authored-by: eifinger --- dist/setup/index.cjs | 18 ++++++++++++ dist/update-known-checksums/index.cjs | 18 ++++++++++++ src/download/checksum/known-checksums.ts | 36 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index 5ceae96..d14a8f4 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -90981,6 +90981,24 @@ var fs10 = __toESM(require("node:fs"), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.5": "470993e87503874c7c48861daa308b48a7c367e117235bbecf19368b9fdd35b2", + "aarch64-pc-windows-msvc-0.11.5": "9b9b99a985cccf249225aaad76412823e9d9736d605dc2252151172a7f6ab3db", + "aarch64-unknown-linux-gnu-0.11.5": "3e9b525d686ae4f3682412bce21536366a5c79616a41055530319c501c883169", + "aarch64-unknown-linux-musl-0.11.5": "d73860013061c62d6a89f3370527d4c407214038af331147773ae2fd8f6394c1", + "arm-unknown-linux-musleabihf-0.11.5": "dcfb4dc15f46eae90ac6d64e7dfc91d8bc0b16816f53b9f8d58ccc8a1220dbb8", + "armv7-unknown-linux-gnueabihf-0.11.5": "818d86386fb57ca4182f39df25dd6160e97300d5ba362bc44e25d8adc904776c", + "armv7-unknown-linux-musleabihf-0.11.5": "2cae8baae2c1b42249e656e16f5fe733189b0760ee93995be024f9cc5e72eb19", + "i686-pc-windows-msvc-0.11.5": "2057ccf3dba9ed23755df92318a08ab221e9e088385c667292acc09d9cc477c6", + "i686-unknown-linux-gnu-0.11.5": "2d340e2e5b3354ee7208bb8f2bbf4d2347d7ffdf2af733c21bee98746e34076d", + "i686-unknown-linux-musl-0.11.5": "ffe2bc9e0c4fdc18f69b7c5bc016a03fa17028d42620ab2b024ad5bb22cd3f3d", + "powerpc64le-unknown-linux-gnu-0.11.5": "c4dabaaa36a13989ab04389263064ca5c27093eb2e7c851ab62d50b6312d9800", + "riscv64gc-unknown-linux-gnu-0.11.5": "6ae3ec3cf1aab72604bc6aa8486faf4b473066422c49d9c42ea8366ff3039de4", + "riscv64gc-unknown-linux-musl-0.11.5": "d4686fb144563a40e791fc3f010a91e57fdce9cac7a03b8a14a972c25be4464c", + "s390x-unknown-linux-gnu-0.11.5": "1309f1e462462dab2da6a55c37012a228d1c06a55c5b43f8ef901ba1599d9e12", + "x86_64-apple-darwin-0.11.5": "b8964bed538143f9016d807e421e28f0237a29589851fc79e8159751ac64779a", + "x86_64-pc-windows-msvc-0.11.5": "3fa5b6ea9de9256a035e0471f5ef0bb5d95344659723d6eb063e27c76431515d", + "x86_64-unknown-linux-gnu-0.11.5": "0d87793f733f327849ebf9cf51b576cfb08328e22af73061405e4bec96ae84d1", + "x86_64-unknown-linux-musl-0.11.5": "ee8a52743ce3979e52872b49c5e58ffa541048cb95132142bff23fe5608d73ea", "aarch64-apple-darwin-0.11.4": "9b9cb6c6f58c3246dbf3351ed4e97c500bc3266f5f237d2fd620b66e1c31dc56", "aarch64-pc-windows-msvc-0.11.4": "708b1c210109e50ff520bcd9b6d29cbd8cee584bb55e84d3d1941bf75ab0893d", "aarch64-unknown-linux-gnu-0.11.4": "f5aa91bba0b98d85a4e5262e2847f9ab2273c754f6374dff62b37ef18c65a2e7", diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index dfadb7c..bd0a350 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -44949,6 +44949,24 @@ var semver = __toESM(require_semver(), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "aarch64-apple-darwin-0.11.5": "470993e87503874c7c48861daa308b48a7c367e117235bbecf19368b9fdd35b2", + "aarch64-pc-windows-msvc-0.11.5": "9b9b99a985cccf249225aaad76412823e9d9736d605dc2252151172a7f6ab3db", + "aarch64-unknown-linux-gnu-0.11.5": "3e9b525d686ae4f3682412bce21536366a5c79616a41055530319c501c883169", + "aarch64-unknown-linux-musl-0.11.5": "d73860013061c62d6a89f3370527d4c407214038af331147773ae2fd8f6394c1", + "arm-unknown-linux-musleabihf-0.11.5": "dcfb4dc15f46eae90ac6d64e7dfc91d8bc0b16816f53b9f8d58ccc8a1220dbb8", + "armv7-unknown-linux-gnueabihf-0.11.5": "818d86386fb57ca4182f39df25dd6160e97300d5ba362bc44e25d8adc904776c", + "armv7-unknown-linux-musleabihf-0.11.5": "2cae8baae2c1b42249e656e16f5fe733189b0760ee93995be024f9cc5e72eb19", + "i686-pc-windows-msvc-0.11.5": "2057ccf3dba9ed23755df92318a08ab221e9e088385c667292acc09d9cc477c6", + "i686-unknown-linux-gnu-0.11.5": "2d340e2e5b3354ee7208bb8f2bbf4d2347d7ffdf2af733c21bee98746e34076d", + "i686-unknown-linux-musl-0.11.5": "ffe2bc9e0c4fdc18f69b7c5bc016a03fa17028d42620ab2b024ad5bb22cd3f3d", + "powerpc64le-unknown-linux-gnu-0.11.5": "c4dabaaa36a13989ab04389263064ca5c27093eb2e7c851ab62d50b6312d9800", + "riscv64gc-unknown-linux-gnu-0.11.5": "6ae3ec3cf1aab72604bc6aa8486faf4b473066422c49d9c42ea8366ff3039de4", + "riscv64gc-unknown-linux-musl-0.11.5": "d4686fb144563a40e791fc3f010a91e57fdce9cac7a03b8a14a972c25be4464c", + "s390x-unknown-linux-gnu-0.11.5": "1309f1e462462dab2da6a55c37012a228d1c06a55c5b43f8ef901ba1599d9e12", + "x86_64-apple-darwin-0.11.5": "b8964bed538143f9016d807e421e28f0237a29589851fc79e8159751ac64779a", + "x86_64-pc-windows-msvc-0.11.5": "3fa5b6ea9de9256a035e0471f5ef0bb5d95344659723d6eb063e27c76431515d", + "x86_64-unknown-linux-gnu-0.11.5": "0d87793f733f327849ebf9cf51b576cfb08328e22af73061405e4bec96ae84d1", + "x86_64-unknown-linux-musl-0.11.5": "ee8a52743ce3979e52872b49c5e58ffa541048cb95132142bff23fe5608d73ea", "aarch64-apple-darwin-0.11.4": "9b9cb6c6f58c3246dbf3351ed4e97c500bc3266f5f237d2fd620b66e1c31dc56", "aarch64-pc-windows-msvc-0.11.4": "708b1c210109e50ff520bcd9b6d29cbd8cee584bb55e84d3d1941bf75ab0893d", "aarch64-unknown-linux-gnu-0.11.4": "f5aa91bba0b98d85a4e5262e2847f9ab2273c754f6374dff62b37ef18c65a2e7", diff --git a/src/download/checksum/known-checksums.ts b/src/download/checksum/known-checksums.ts index 72b1347..03abe8d 100644 --- a/src/download/checksum/known-checksums.ts +++ b/src/download/checksum/known-checksums.ts @@ -1,5 +1,41 @@ // AUTOGENERATED_DO_NOT_EDIT export const KNOWN_CHECKSUMS: { [key: string]: string } = { + "aarch64-apple-darwin-0.11.5": + "470993e87503874c7c48861daa308b48a7c367e117235bbecf19368b9fdd35b2", + "aarch64-pc-windows-msvc-0.11.5": + "9b9b99a985cccf249225aaad76412823e9d9736d605dc2252151172a7f6ab3db", + "aarch64-unknown-linux-gnu-0.11.5": + "3e9b525d686ae4f3682412bce21536366a5c79616a41055530319c501c883169", + "aarch64-unknown-linux-musl-0.11.5": + "d73860013061c62d6a89f3370527d4c407214038af331147773ae2fd8f6394c1", + "arm-unknown-linux-musleabihf-0.11.5": + "dcfb4dc15f46eae90ac6d64e7dfc91d8bc0b16816f53b9f8d58ccc8a1220dbb8", + "armv7-unknown-linux-gnueabihf-0.11.5": + "818d86386fb57ca4182f39df25dd6160e97300d5ba362bc44e25d8adc904776c", + "armv7-unknown-linux-musleabihf-0.11.5": + "2cae8baae2c1b42249e656e16f5fe733189b0760ee93995be024f9cc5e72eb19", + "i686-pc-windows-msvc-0.11.5": + "2057ccf3dba9ed23755df92318a08ab221e9e088385c667292acc09d9cc477c6", + "i686-unknown-linux-gnu-0.11.5": + "2d340e2e5b3354ee7208bb8f2bbf4d2347d7ffdf2af733c21bee98746e34076d", + "i686-unknown-linux-musl-0.11.5": + "ffe2bc9e0c4fdc18f69b7c5bc016a03fa17028d42620ab2b024ad5bb22cd3f3d", + "powerpc64le-unknown-linux-gnu-0.11.5": + "c4dabaaa36a13989ab04389263064ca5c27093eb2e7c851ab62d50b6312d9800", + "riscv64gc-unknown-linux-gnu-0.11.5": + "6ae3ec3cf1aab72604bc6aa8486faf4b473066422c49d9c42ea8366ff3039de4", + "riscv64gc-unknown-linux-musl-0.11.5": + "d4686fb144563a40e791fc3f010a91e57fdce9cac7a03b8a14a972c25be4464c", + "s390x-unknown-linux-gnu-0.11.5": + "1309f1e462462dab2da6a55c37012a228d1c06a55c5b43f8ef901ba1599d9e12", + "x86_64-apple-darwin-0.11.5": + "b8964bed538143f9016d807e421e28f0237a29589851fc79e8159751ac64779a", + "x86_64-pc-windows-msvc-0.11.5": + "3fa5b6ea9de9256a035e0471f5ef0bb5d95344659723d6eb063e27c76431515d", + "x86_64-unknown-linux-gnu-0.11.5": + "0d87793f733f327849ebf9cf51b576cfb08328e22af73061405e4bec96ae84d1", + "x86_64-unknown-linux-musl-0.11.5": + "ee8a52743ce3979e52872b49c5e58ffa541048cb95132142bff23fe5608d73ea", "aarch64-apple-darwin-0.11.4": "9b9cb6c6f58c3246dbf3351ed4e97c500bc3266f5f237d2fd620b66e1c31dc56", "aarch64-pc-windows-msvc-0.11.4": From cb84d12dc6a0d495b82fcae14fa4559b90698660 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 13:32:57 +0200 Subject: [PATCH 19/20] chore: update known checksums for 0.11.6 (#850) chore: update known checksums for 0.11.6 Co-authored-by: eifinger --- dist/setup/index.cjs | 18 ++++++++++++ dist/update-known-checksums/index.cjs | 18 ++++++++++++ src/download/checksum/known-checksums.ts | 36 ++++++++++++++++++++++++ 3 files changed, 72 insertions(+) diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index d14a8f4..661e30a 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -90981,6 +90981,24 @@ var fs10 = __toESM(require("node:fs"), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "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-pc-windows-msvc-0.11.5": "9b9b99a985cccf249225aaad76412823e9d9736d605dc2252151172a7f6ab3db", "aarch64-unknown-linux-gnu-0.11.5": "3e9b525d686ae4f3682412bce21536366a5c79616a41055530319c501c883169", diff --git a/dist/update-known-checksums/index.cjs b/dist/update-known-checksums/index.cjs index bd0a350..329d0e0 100644 --- a/dist/update-known-checksums/index.cjs +++ b/dist/update-known-checksums/index.cjs @@ -44949,6 +44949,24 @@ var semver = __toESM(require_semver(), 1); // src/download/checksum/known-checksums.ts var KNOWN_CHECKSUMS = { + "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-pc-windows-msvc-0.11.5": "9b9b99a985cccf249225aaad76412823e9d9736d605dc2252151172a7f6ab3db", "aarch64-unknown-linux-gnu-0.11.5": "3e9b525d686ae4f3682412bce21536366a5c79616a41055530319c501c883169", diff --git a/src/download/checksum/known-checksums.ts b/src/download/checksum/known-checksums.ts index 03abe8d..89d87ae 100644 --- a/src/download/checksum/known-checksums.ts +++ b/src/download/checksum/known-checksums.ts @@ -1,5 +1,41 @@ // AUTOGENERATED_DO_NOT_EDIT export const KNOWN_CHECKSUMS: { [key: string]: string } = { + "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-pc-windows-msvc-0.11.5": From cdfb2ee6dde255817c739680168ad81e184c4bfb Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Sat, 11 Apr 2026 11:38:41 +0200 Subject: [PATCH 20/20] Refactor version resolving (#852) --- __tests__/download/download-version.test.ts | 29 + __tests__/version/requirements-file.test.ts | 2 +- .../version/requirements-hashes-file.test.ts | 2 +- .../version/version-request-resolver.test.ts | 125 + dist/save-cache/index.cjs | 6 + dist/setup/index.cjs | 4694 +++++++++-------- src/download/download-version.ts | 105 +- src/download/manifest.ts | 11 + src/setup-uv.ts | 50 +- src/utils/config-file.ts | 13 + src/version/file-parser.ts | 103 + src/version/requirements-file.ts | 66 +- src/version/resolve.ts | 211 +- src/version/specifier.ts | 59 + src/version/types.ts | 34 + src/version/version-request-resolver.ts | 158 + 16 files changed, 3233 insertions(+), 2435 deletions(-) create mode 100644 __tests__/version/version-request-resolver.test.ts create mode 100644 src/version/file-parser.ts create mode 100644 src/version/specifier.ts create mode 100644 src/version/types.ts create mode 100644 src/version/version-request-resolver.ts diff --git a/__tests__/download/download-version.test.ts b/__tests__/download/download-version.test.ts index a638636..309116b 100644 --- a/__tests__/download/download-version.test.ts +++ b/__tests__/download/download-version.test.ts @@ -95,6 +95,35 @@ describe("download-version", () => { 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 () => { mockGetAllVersions.mockResolvedValue(["0.9.26", "0.9.25"]); diff --git a/__tests__/version/requirements-file.test.ts b/__tests__/version/requirements-file.test.ts index 5c085ed..aa7b957 100644 --- a/__tests__/version/requirements-file.test.ts +++ b/__tests__/version/requirements-file.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "@jest/globals"; -import { getUvVersionFromFile } from "../../src/version/resolve"; +import { getUvVersionFromFile } from "../../src/version/file-parser"; test("ignores dependencies starting with uv", async () => { const parsedVersion = getUvVersionFromFile( diff --git a/__tests__/version/requirements-hashes-file.test.ts b/__tests__/version/requirements-hashes-file.test.ts index 2aace2b..675af48 100644 --- a/__tests__/version/requirements-hashes-file.test.ts +++ b/__tests__/version/requirements-hashes-file.test.ts @@ -1,5 +1,5 @@ import { expect, test } from "@jest/globals"; -import { getUvVersionFromFile } from "../../src/version/resolve"; +import { getUvVersionFromFile } from "../../src/version/file-parser"; test("ignores dependencies starting with uv", async () => { const parsedVersion = getUvVersionFromFile( diff --git a/__tests__/version/version-request-resolver.test.ts b/__tests__/version/version-request-resolver.test.ts new file mode 100644 index 0000000..e3478ff --- /dev/null +++ b/__tests__/version/version-request-resolver.test.ts @@ -0,0 +1,125 @@ +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 { + 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")}`, + ); + }); +}); diff --git a/dist/save-cache/index.cjs b/dist/save-cache/index.cjs index ecbfbbb..60bdd2c 100644 --- a/dist/save-cache/index.cjs +++ b/dist/save-cache/index.cjs @@ -62947,6 +62947,12 @@ function getConfigValueFromTomlFile(filePath, key) { return void 0; } 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")) { const tomlContent2 = parse2(fileContent); return tomlContent2?.tool?.uv?.[key]; diff --git a/dist/setup/index.cjs b/dist/setup/index.cjs index 661e30a..e236d0d 100644 --- a/dist/setup/index.cjs +++ b/dist/setup/index.cjs @@ -1068,14 +1068,14 @@ var require_util = __commonJS({ } const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80; let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`; - let path16 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; + let path17 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`; if (origin[origin.length - 1] === "/") { origin = origin.slice(0, origin.length - 1); } - if (path16 && path16[0] !== "/") { - path16 = `/${path16}`; + if (path17 && path17[0] !== "/") { + path17 = `/${path17}`; } - return new URL(`${origin}${path16}`); + return new URL(`${origin}${path17}`); } if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) { throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`."); @@ -1526,39 +1526,39 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path17, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); + debuglog("sending request to %s %s/%s", method, origin, path17); }); diagnosticsChannel.channel("undici:request:headers").subscribe((evt) => { const { - request: { method, path: path16, origin }, + request: { method, path: path17, origin }, response: { statusCode } } = evt; debuglog( "received response to %s %s/%s - HTTP %d", method, origin, - path16, + path17, statusCode ); }); diagnosticsChannel.channel("undici:request:trailers").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path17, origin } } = evt; - debuglog("trailers received from %s %s/%s", method, origin, path16); + debuglog("trailers received from %s %s/%s", method, origin, path17); }); diagnosticsChannel.channel("undici:request:error").subscribe((evt) => { const { - request: { method, path: path16, origin }, + request: { method, path: path17, origin }, error: error2 } = evt; debuglog( "request to %s %s/%s errored - %s", method, origin, - path16, + path17, error2.message ); }); @@ -1607,9 +1607,9 @@ var require_diagnostics = __commonJS({ }); diagnosticsChannel.channel("undici:client:sendHeaders").subscribe((evt) => { const { - request: { method, path: path16, origin } + request: { method, path: path17, origin } } = evt; - debuglog("sending request to %s %s/%s", method, origin, path16); + debuglog("sending request to %s %s/%s", method, origin, path17); }); } diagnosticsChannel.channel("undici:websocket:open").subscribe((evt) => { @@ -1672,7 +1672,7 @@ var require_request = __commonJS({ var kHandler = /* @__PURE__ */ Symbol("handler"); var Request = class { constructor(origin, { - path: path16, + path: path17, method, body: body2, headers, @@ -1687,11 +1687,11 @@ var require_request = __commonJS({ expectContinue, servername }, handler) { - if (typeof path16 !== "string") { + if (typeof path17 !== "string") { throw new InvalidArgumentError("path must be a string"); - } else if (path16[0] !== "/" && !(path16.startsWith("http://") || path16.startsWith("https://")) && method !== "CONNECT") { + } else if (path17[0] !== "/" && !(path17.startsWith("http://") || path17.startsWith("https://")) && method !== "CONNECT") { throw new InvalidArgumentError("path must be an absolute URL or start with a slash"); - } else if (invalidPathRegex.test(path16)) { + } else if (invalidPathRegex.test(path17)) { throw new InvalidArgumentError("invalid request path"); } if (typeof method !== "string") { @@ -1757,7 +1757,7 @@ var require_request = __commonJS({ this.completed = false; this.aborted = false; this.upgrade = upgrade || null; - this.path = query ? buildURL(path16, query) : path16; + this.path = query ? buildURL(path17, query) : path17; this.origin = origin; this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent; this.blocking = blocking == null ? false : blocking; @@ -6276,7 +6276,7 @@ var require_client_h1 = __commonJS({ return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT"; } function writeH1(client, request) { - const { method, path: path16, host, upgrade, blocking, reset } = request; + const { method, path: path17, host, upgrade, blocking, reset } = request; let { body: body2, headers, contentLength: contentLength2 } = request; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH"; if (util7.isFormDataLike(body2)) { @@ -6342,7 +6342,7 @@ var require_client_h1 = __commonJS({ if (blocking) { socket[kBlocking] = true; } - let header = `${method} ${path16} HTTP/1.1\r + let header = `${method} ${path17} HTTP/1.1\r `; if (typeof host === "string") { header += `host: ${host}\r @@ -6868,7 +6868,7 @@ var require_client_h2 = __commonJS({ } function writeH2(client, request) { const session = client[kHTTP2Session]; - const { method, path: path16, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; + const { method, path: path17, host, upgrade, expectContinue, signal, headers: reqHeaders } = request; let { body: body2 } = request; if (upgrade) { util7.errorRequest(client, request, new Error("Upgrade not supported for H2")); @@ -6935,7 +6935,7 @@ var require_client_h2 = __commonJS({ }); return true; } - headers[HTTP2_HEADER_PATH] = path16; + headers[HTTP2_HEADER_PATH] = path17; headers[HTTP2_HEADER_SCHEME] = "https"; const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH"; if (body2 && typeof body2.read === "function") { @@ -7288,9 +7288,9 @@ var require_redirect_handler = __commonJS({ return this.handler.onHeaders(statusCode, headers, resume, statusText); } const { origin, pathname, search } = util7.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin))); - const path16 = search ? `${pathname}${search}` : pathname; + const path17 = search ? `${pathname}${search}` : pathname; this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin); - this.opts.path = path16; + this.opts.path = path17; this.opts.origin = origin; this.opts.maxRedirections = 0; this.opts.query = null; @@ -8524,10 +8524,10 @@ var require_proxy_agent = __commonJS({ }; const { origin, - path: path16 = "/", + path: path17 = "/", headers = {} } = opts; - opts.path = origin + path16; + opts.path = origin + path17; if (!("host" in headers) && !("Host" in headers)) { const { host } = new URL3(origin); headers.host = host; @@ -10448,20 +10448,20 @@ var require_mock_utils = __commonJS({ } return true; } - function safeUrl(path16) { - if (typeof path16 !== "string") { - return path16; + function safeUrl(path17) { + if (typeof path17 !== "string") { + return path17; } - const pathSegments = path16.split("?"); + const pathSegments = path17.split("?"); if (pathSegments.length !== 2) { - return path16; + return path17; } const qp = new URLSearchParams(pathSegments.pop()); qp.sort(); return [...pathSegments, qp.toString()].join("?"); } - function matchKey(mockDispatch2, { path: path16, method, body: body2, headers }) { - const pathMatch = matchValue(mockDispatch2.path, path16); + function matchKey(mockDispatch2, { path: path17, method, body: body2, headers }) { + const pathMatch = matchValue(mockDispatch2.path, path17); const methodMatch = matchValue(mockDispatch2.method, method); const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body2) : true; const headersMatch = matchHeaders(mockDispatch2, headers); @@ -10483,7 +10483,7 @@ var require_mock_utils = __commonJS({ function getMockDispatch(mockDispatches, key) { const basePath = key.query ? buildURL(key.path, key.query) : key.path; const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath; - let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path16 }) => matchValue(safeUrl(path16), resolvedPath)); + let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path17 }) => matchValue(safeUrl(path17), resolvedPath)); if (matchedMockDispatches.length === 0) { throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`); } @@ -10521,9 +10521,9 @@ var require_mock_utils = __commonJS({ } } function buildKey(opts) { - const { path: path16, method, body: body2, headers, query } = opts; + const { path: path17, method, body: body2, headers, query } = opts; return { - path: path16, + path: path17, method, body: body2, headers, @@ -10986,10 +10986,10 @@ var require_pending_interceptors_formatter = __commonJS({ } format(pendingInterceptors) { const withPrettyHeaders = pendingInterceptors.map( - ({ method, path: path16, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ + ({ method, path: path17, data: { statusCode }, persist, times, timesInvoked, origin }) => ({ Method: method, Origin: origin, - Path: path16, + Path: path17, "Status code": statusCode, Persistent: persist ? PERSISTENT : NOT_PERSISTENT, Invocations: timesInvoked, @@ -15870,9 +15870,9 @@ var require_util6 = __commonJS({ } } } - function validateCookiePath(path16) { - for (let i = 0; i < path16.length; ++i) { - const code = path16.charCodeAt(i); + function validateCookiePath(path17) { + for (let i = 0; i < path17.length; ++i) { + const code = path17.charCodeAt(i); if (code < 32 || // exclude CTLs (0-31) code === 127 || // DEL code === 59) { @@ -18512,11 +18512,11 @@ var require_undici = __commonJS({ if (typeof opts.path !== "string") { throw new InvalidArgumentError("invalid opts.path"); } - let path16 = opts.path; + let path17 = opts.path; if (!opts.path.startsWith("/")) { - path16 = `/${path16}`; + path17 = `/${path17}`; } - url2 = new URL(util7.parseOrigin(url2).origin + path16); + url2 = new URL(util7.parseOrigin(url2).origin + path17); } else { if (!opts) { opts = typeof url2 === "object" ? url2 : {}; @@ -18809,7 +18809,7 @@ var require_minimatch = __commonJS({ "node_modules/minimatch/minimatch.js"(exports2, module2) { module2.exports = minimatch2; minimatch2.Minimatch = Minimatch2; - var path16 = (function() { + var path17 = (function() { try { return require("path"); } catch (e) { @@ -18817,7 +18817,7 @@ var require_minimatch = __commonJS({ })() || { sep: "/" }; - minimatch2.sep = path16.sep; + minimatch2.sep = path17.sep; var GLOBSTAR = minimatch2.GLOBSTAR = Minimatch2.GLOBSTAR = {}; var expand = require_brace_expansion(); var plTypes = { @@ -18906,8 +18906,8 @@ var require_minimatch = __commonJS({ assertValidPattern(pattern); if (!options) options = {}; pattern = pattern.trim(); - if (!options.allowWindowsEscape && path16.sep !== "/") { - pattern = pattern.split(path16.sep).join("/"); + if (!options.allowWindowsEscape && path17.sep !== "/") { + pattern = pattern.split(path17.sep).join("/"); } this.options = options; this.set = []; @@ -19276,8 +19276,8 @@ var require_minimatch = __commonJS({ if (this.empty) return f === ""; if (f === "/" && partial) return true; var options = this.options; - if (path16.sep !== "/") { - f = f.split(path16.sep).join("/"); + if (path17.sep !== "/") { + f = f.split(path17.sep).join("/"); } f = f.split(slashSplit); this.debug(this.pattern, "split", f); @@ -28917,1810 +28917,6 @@ var require_semver4 = __commonJS({ } }); -// node_modules/@renovatebot/pep440/lib/version.js -var require_version = __commonJS({ - "node_modules/@renovatebot/pep440/lib/version.js"(exports2, module2) { - var VERSION_PATTERN = [ - "v?", - "(?:", - /* */ - "(?:(?[0-9]+)!)?", - // epoch - /* */ - "(?[0-9]+(?:\\.[0-9]+)*)", - // release segment - /* */ - "(?
",
-      // pre-release
-      /*    */
-      "[-_\\.]?",
-      /*    */
-      "(?(a|b|c|rc|alpha|beta|pre|preview))",
-      /*    */
-      "[-_\\.]?",
-      /*    */
-      "(?[0-9]+)?",
-      /* */
-      ")?",
-      /* */
-      "(?",
-      // post release
-      /*    */
-      "(?:-(?[0-9]+))",
-      /*    */
-      "|",
-      /*    */
-      "(?:",
-      /*        */
-      "[-_\\.]?",
-      /*        */
-      "(?post|rev|r)",
-      /*        */
-      "[-_\\.]?",
-      /*        */
-      "(?[0-9]+)?",
-      /*    */
-      ")",
-      /* */
-      ")?",
-      /* */
-      "(?",
-      // dev release
-      /*    */
-      "[-_\\.]?",
-      /*    */
-      "(?dev)",
-      /*    */
-      "[-_\\.]?",
-      /*    */
-      "(?[0-9]+)?",
-      /* */
-      ")?",
-      ")",
-      "(?:\\+(?[a-z0-9]+(?:[-_\\.][a-z0-9]+)*))?"
-      // local version
-    ].join("");
-    module2.exports = {
-      VERSION_PATTERN,
-      valid: valid2,
-      clean: clean3,
-      explain,
-      parse: parse3,
-      stringify: stringify2
-    };
-    var validRegex = new RegExp("^" + VERSION_PATTERN + "$", "i");
-    function valid2(version3) {
-      return validRegex.test(version3) ? version3 : null;
-    }
-    var cleanRegex = new RegExp("^\\s*" + VERSION_PATTERN + "\\s*$", "i");
-    function clean3(version3) {
-      return stringify2(parse3(version3, cleanRegex));
-    }
-    function parse3(version3, regex) {
-      const { groups } = (regex || validRegex).exec(version3) || {};
-      if (!groups) {
-        return null;
-      }
-      const parsed = {
-        epoch: Number(groups.epoch ? groups.epoch : 0),
-        release: groups.release.split(".").map(Number),
-        pre: normalize_letter_version(groups.pre_l, groups.pre_n),
-        post: normalize_letter_version(
-          groups.post_l,
-          groups.post_n1 || groups.post_n2
-        ),
-        dev: normalize_letter_version(groups.dev_l, groups.dev_n),
-        local: parse_local_version(groups.local)
-      };
-      return parsed;
-    }
-    function stringify2(parsed) {
-      if (!parsed) {
-        return null;
-      }
-      const { epoch, release, pre, post, dev, local } = parsed;
-      const parts = [];
-      if (epoch !== 0) {
-        parts.push(`${epoch}!`);
-      }
-      parts.push(release.join("."));
-      if (pre) {
-        parts.push(pre.join(""));
-      }
-      if (post) {
-        parts.push("." + post.join(""));
-      }
-      if (dev) {
-        parts.push("." + dev.join(""));
-      }
-      if (local) {
-        parts.push(`+${local}`);
-      }
-      return parts.join("");
-    }
-    function normalize_letter_version(letterIn, numberIn) {
-      let letter = letterIn;
-      let number = numberIn;
-      if (letter) {
-        if (!number) {
-          number = 0;
-        }
-        letter = letter.toLowerCase();
-        if (letter === "alpha") {
-          letter = "a";
-        } else if (letter === "beta") {
-          letter = "b";
-        } else if (["c", "pre", "preview"].includes(letter)) {
-          letter = "rc";
-        } else if (["rev", "r"].includes(letter)) {
-          letter = "post";
-        }
-        return [letter, Number(number)];
-      }
-      if (!letter && number) {
-        letter = "post";
-        return [letter, Number(number)];
-      }
-      return null;
-    }
-    function parse_local_version(local) {
-      if (local) {
-        return local.split(/[._-]/).map(
-          (part) => Number.isNaN(Number(part)) ? part.toLowerCase() : Number(part)
-        );
-      }
-      return null;
-    }
-    function explain(version3) {
-      const parsed = parse3(version3);
-      if (!parsed) {
-        return parsed;
-      }
-      const { epoch, release, pre, post, dev, local } = parsed;
-      let base_version = "";
-      if (epoch !== 0) {
-        base_version += epoch + "!";
-      }
-      base_version += release.join(".");
-      const is_prerelease = Boolean(dev || pre);
-      const is_devrelease = Boolean(dev);
-      const is_postrelease = Boolean(post);
-      return {
-        epoch,
-        release,
-        pre,
-        post: post ? post[1] : post,
-        dev: dev ? dev[1] : dev,
-        local: local ? local.join(".") : local,
-        public: stringify2(parsed).split("+", 1)[0],
-        base_version,
-        is_prerelease,
-        is_devrelease,
-        is_postrelease
-      };
-    }
-  }
-});
-
-// node_modules/@renovatebot/pep440/lib/operator.js
-var require_operator = __commonJS({
-  "node_modules/@renovatebot/pep440/lib/operator.js"(exports2, module2) {
-    var { parse: parse3 } = require_version();
-    module2.exports = {
-      compare,
-      rcompare,
-      lt,
-      le,
-      eq,
-      ne,
-      ge,
-      gt: gt2,
-      "<": lt,
-      "<=": le,
-      "==": eq,
-      "!=": ne,
-      ">=": ge,
-      ">": gt2,
-      "===": arbitrary
-    };
-    function lt(version3, other) {
-      return compare(version3, other) < 0;
-    }
-    function le(version3, other) {
-      return compare(version3, other) <= 0;
-    }
-    function eq(version3, other) {
-      return compare(version3, other) === 0;
-    }
-    function ne(version3, other) {
-      return compare(version3, other) !== 0;
-    }
-    function ge(version3, other) {
-      return compare(version3, other) >= 0;
-    }
-    function gt2(version3, other) {
-      return compare(version3, other) > 0;
-    }
-    function arbitrary(version3, other) {
-      return version3.toLowerCase() === other.toLowerCase();
-    }
-    function compare(version3, other) {
-      const parsedVersion = parse3(version3);
-      const parsedOther = parse3(other);
-      const keyVersion = calculateKey(parsedVersion);
-      const keyOther = calculateKey(parsedOther);
-      return pyCompare(keyVersion, keyOther);
-    }
-    function rcompare(version3, other) {
-      return -compare(version3, other);
-    }
-    function pyCompare(elemIn, otherIn) {
-      let elem = elemIn;
-      let other = otherIn;
-      if (elem === other) {
-        return 0;
-      }
-      if (Array.isArray(elem) !== Array.isArray(other)) {
-        elem = Array.isArray(elem) ? elem : [elem];
-        other = Array.isArray(other) ? other : [other];
-      }
-      if (Array.isArray(elem)) {
-        const len = Math.min(elem.length, other.length);
-        for (let i = 0; i < len; i += 1) {
-          const res = pyCompare(elem[i], other[i]);
-          if (res !== 0) {
-            return res;
-          }
-        }
-        return elem.length - other.length;
-      }
-      if (elem === -Infinity || other === Infinity) {
-        return -1;
-      }
-      if (elem === Infinity || other === -Infinity) {
-        return 1;
-      }
-      return elem < other ? -1 : 1;
-    }
-    function calculateKey(input) {
-      const { epoch } = input;
-      let { release, pre, post, local, dev } = input;
-      release = release.concat();
-      release.reverse();
-      while (release.length && release[0] === 0) {
-        release.shift();
-      }
-      release.reverse();
-      if (!pre && !post && dev) pre = -Infinity;
-      else if (!pre) pre = Infinity;
-      if (!post) post = -Infinity;
-      if (!dev) dev = Infinity;
-      if (!local) {
-        local = -Infinity;
-      } else {
-        local = local.map(
-          (i) => Number.isNaN(Number(i)) ? [-Infinity, i] : [Number(i), ""]
-        );
-      }
-      return [epoch, release, pre, post, dev, local];
-    }
-  }
-});
-
-// node_modules/@renovatebot/pep440/lib/specifier.js
-var require_specifier = __commonJS({
-  "node_modules/@renovatebot/pep440/lib/specifier.js"(exports2, module2) {
-    var { VERSION_PATTERN, explain: explainVersion } = require_version();
-    var Operator = require_operator();
-    var RANGE_PATTERN = [
-      "(?(===|~=|==|!=|<=|>=|<|>))",
-      "\\s*",
-      "(",
-      /*  */
-      "(?(?:" + VERSION_PATTERN.replace(/\?<\w+>/g, "?:") + "))",
-      /*  */
-      "(?\\.\\*)?",
-      /*  */
-      "|",
-      /*  */
-      "(?[^,;\\s)]+)",
-      ")"
-    ].join("");
-    module2.exports = {
-      RANGE_PATTERN,
-      parse: parse3,
-      satisfies: satisfies4,
-      filter,
-      validRange,
-      maxSatisfying: maxSatisfying3,
-      minSatisfying: minSatisfying4
-    };
-    var isEqualityOperator = (op) => ["==", "!=", "==="].includes(op);
-    var rangeRegex = new RegExp("^" + RANGE_PATTERN + "$", "i");
-    function parse3(ranges) {
-      if (!ranges.trim()) {
-        return [];
-      }
-      const specifiers = ranges.split(",").map((range2) => rangeRegex.exec(range2.trim()) || {}).map(({ groups }) => {
-        if (!groups) {
-          return null;
-        }
-        let { ...spec } = groups;
-        const { operator, version: version3, prefix: prefix2, legacy } = groups;
-        if (version3) {
-          spec = { ...spec, ...explainVersion(version3) };
-          if (operator === "~=") {
-            if (spec.release.length < 2) {
-              return null;
-            }
-          }
-          if (!isEqualityOperator(operator) && spec.local) {
-            return null;
-          }
-          if (prefix2) {
-            if (!isEqualityOperator(operator) || spec.dev || spec.local) {
-              return null;
-            }
-          }
-        }
-        if (legacy && operator !== "===") {
-          return null;
-        }
-        return spec;
-      });
-      if (specifiers.filter(Boolean).length !== specifiers.length) {
-        return null;
-      }
-      return specifiers;
-    }
-    function filter(versions, specifier, options = {}) {
-      const filtered = pick(versions, specifier, options);
-      if (filtered.length === 0 && options.prereleases === void 0) {
-        return pick(versions, specifier, { prereleases: true });
-      }
-      return filtered;
-    }
-    function maxSatisfying3(versions, range2, options) {
-      const found = filter(versions, range2, options).sort(Operator.compare);
-      return found.length === 0 ? null : found[found.length - 1];
-    }
-    function minSatisfying4(versions, range2, options) {
-      const found = filter(versions, range2, options).sort(Operator.compare);
-      return found.length === 0 ? null : found[0];
-    }
-    function pick(versions, specifier, options) {
-      const parsed = parse3(specifier);
-      if (!parsed) {
-        return [];
-      }
-      return versions.filter((version3) => {
-        const explained = explainVersion(version3);
-        if (!parsed.length) {
-          return explained && !(explained.is_prerelease && !options.prereleases);
-        }
-        return parsed.reduce((pass, spec) => {
-          if (!pass) {
-            return false;
-          }
-          return contains({ ...spec, ...options }, { version: version3, explained });
-        }, true);
-      });
-    }
-    function satisfies4(version3, specifier, options = {}) {
-      const filtered = pick([version3], specifier, options);
-      return filtered.length === 1;
-    }
-    function arrayStartsWith(array, prefix2) {
-      if (prefix2.length > array.length) {
-        return false;
-      }
-      for (let i = 0; i < prefix2.length; i += 1) {
-        if (prefix2[i] !== array[i]) {
-          return false;
-        }
-      }
-      return true;
-    }
-    function contains(specifier, input) {
-      const { explained } = input;
-      let { version: version3 } = input;
-      const { ...spec } = specifier;
-      if (spec.prereleases === void 0) {
-        spec.prereleases = spec.is_prerelease;
-      }
-      if (explained && explained.is_prerelease && !spec.prereleases) {
-        return false;
-      }
-      if (spec.operator === "~=") {
-        let compatiblePrefix = spec.release.slice(0, -1).concat("*").join(".");
-        if (spec.epoch) {
-          compatiblePrefix = spec.epoch + "!" + compatiblePrefix;
-        }
-        return satisfies4(version3, `>=${spec.version}, ==${compatiblePrefix}`, {
-          prereleases: spec.prereleases
-        });
-      }
-      if (spec.prefix) {
-        const isMatching = explained.epoch === spec.epoch && arrayStartsWith(explained.release, spec.release);
-        const isEquality = spec.operator !== "!=";
-        return isEquality ? isMatching : !isMatching;
-      }
-      if (explained) {
-        if (explained.local && spec.version) {
-          version3 = explained.public;
-          spec.version = explainVersion(spec.version).public;
-        }
-      }
-      if (spec.operator === "<" || spec.operator === ">") {
-        if (Operator.eq(spec.release.join("."), explained.release.join("."))) {
-          return false;
-        }
-      }
-      const op = Operator[spec.operator];
-      return op(version3, spec.version || spec.legacy);
-    }
-    function validRange(specifier) {
-      return Boolean(parse3(specifier));
-    }
-  }
-});
-
-// node_modules/@renovatebot/pep440/lib/semantic.js
-var require_semantic = __commonJS({
-  "node_modules/@renovatebot/pep440/lib/semantic.js"(exports2, module2) {
-    var { explain, parse: parse3, stringify: stringify2 } = require_version();
-    module2.exports = {
-      major,
-      minor,
-      patch,
-      inc
-    };
-    function major(input) {
-      const version3 = explain(input);
-      if (!version3) {
-        throw new TypeError("Invalid Version: " + input);
-      }
-      return version3.release[0];
-    }
-    function minor(input) {
-      const version3 = explain(input);
-      if (!version3) {
-        throw new TypeError("Invalid Version: " + input);
-      }
-      if (version3.release.length < 2) {
-        return 0;
-      }
-      return version3.release[1];
-    }
-    function patch(input) {
-      const version3 = explain(input);
-      if (!version3) {
-        throw new TypeError("Invalid Version: " + input);
-      }
-      if (version3.release.length < 3) {
-        return 0;
-      }
-      return version3.release[2];
-    }
-    function inc(input, release, preReleaseIdentifier) {
-      let identifier = preReleaseIdentifier || `a`;
-      const version3 = parse3(input);
-      if (!version3) {
-        return null;
-      }
-      if (!["a", "b", "c", "rc", "alpha", "beta", "pre", "preview"].includes(
-        identifier
-      )) {
-        return null;
-      }
-      switch (release) {
-        case "premajor":
-          {
-            const [majorVersion] = version3.release;
-            version3.release.fill(0);
-            version3.release[0] = majorVersion + 1;
-          }
-          version3.pre = [identifier, 0];
-          delete version3.post;
-          delete version3.dev;
-          delete version3.local;
-          break;
-        case "preminor":
-          {
-            const [majorVersion, minorVersion = 0] = version3.release;
-            version3.release.fill(0);
-            version3.release[0] = majorVersion;
-            version3.release[1] = minorVersion + 1;
-          }
-          version3.pre = [identifier, 0];
-          delete version3.post;
-          delete version3.dev;
-          delete version3.local;
-          break;
-        case "prepatch":
-          {
-            const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release;
-            version3.release.fill(0);
-            version3.release[0] = majorVersion;
-            version3.release[1] = minorVersion;
-            version3.release[2] = patchVersion + 1;
-          }
-          version3.pre = [identifier, 0];
-          delete version3.post;
-          delete version3.dev;
-          delete version3.local;
-          break;
-        case "prerelease":
-          if (version3.pre === null) {
-            const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release;
-            version3.release.fill(0);
-            version3.release[0] = majorVersion;
-            version3.release[1] = minorVersion;
-            version3.release[2] = patchVersion + 1;
-            version3.pre = [identifier, 0];
-          } else {
-            if (preReleaseIdentifier === void 0 && version3.pre !== null) {
-              [identifier] = version3.pre;
-            }
-            const [letter, number] = version3.pre;
-            if (letter === identifier) {
-              version3.pre = [letter, number + 1];
-            } else {
-              version3.pre = [identifier, 0];
-            }
-          }
-          delete version3.post;
-          delete version3.dev;
-          delete version3.local;
-          break;
-        case "major":
-          if (version3.release.slice(1).some((value) => value !== 0) || version3.pre === null) {
-            const [majorVersion] = version3.release;
-            version3.release.fill(0);
-            version3.release[0] = majorVersion + 1;
-          }
-          delete version3.pre;
-          delete version3.post;
-          delete version3.dev;
-          delete version3.local;
-          break;
-        case "minor":
-          if (version3.release.slice(2).some((value) => value !== 0) || version3.pre === null) {
-            const [majorVersion, minorVersion = 0] = version3.release;
-            version3.release.fill(0);
-            version3.release[0] = majorVersion;
-            version3.release[1] = minorVersion + 1;
-          }
-          delete version3.pre;
-          delete version3.post;
-          delete version3.dev;
-          delete version3.local;
-          break;
-        case "patch":
-          if (version3.release.slice(3).some((value) => value !== 0) || version3.pre === null) {
-            const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release;
-            version3.release.fill(0);
-            version3.release[0] = majorVersion;
-            version3.release[1] = minorVersion;
-            version3.release[2] = patchVersion + 1;
-          }
-          delete version3.pre;
-          delete version3.post;
-          delete version3.dev;
-          delete version3.local;
-          break;
-        default:
-          return null;
-      }
-      return stringify2(version3);
-    }
-  }
-});
-
-// node_modules/@renovatebot/pep440/index.js
-var require_pep440 = __commonJS({
-  "node_modules/@renovatebot/pep440/index.js"(exports2, module2) {
-    var { valid: valid2, clean: clean3, explain, parse: parse3 } = require_version();
-    var { lt, le, eq, ne, ge, gt: gt2, compare, rcompare } = require_operator();
-    var {
-      filter,
-      maxSatisfying: maxSatisfying3,
-      minSatisfying: minSatisfying4,
-      RANGE_PATTERN,
-      satisfies: satisfies4,
-      validRange
-    } = require_specifier();
-    var { major, minor, patch, inc } = require_semantic();
-    module2.exports = {
-      // version
-      valid: valid2,
-      clean: clean3,
-      explain,
-      parse: parse3,
-      // operator
-      lt,
-      le,
-      lte: le,
-      eq,
-      ne,
-      neq: ne,
-      ge,
-      gte: ge,
-      gt: gt2,
-      compare,
-      rcompare,
-      // range
-      filter,
-      maxSatisfying: maxSatisfying3,
-      minSatisfying: minSatisfying4,
-      RANGE_PATTERN,
-      satisfies: satisfies4,
-      validRange,
-      // semantic
-      major,
-      minor,
-      patch,
-      inc
-    };
-  }
-});
-
-// node_modules/semver/semver.js
-var require_semver5 = __commonJS({
-  "node_modules/semver/semver.js"(exports2, module2) {
-    exports2 = module2.exports = SemVer;
-    var debug2;
-    if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
-      debug2 = function() {
-        var args = Array.prototype.slice.call(arguments, 0);
-        args.unshift("SEMVER");
-        console.log.apply(console, args);
-      };
-    } else {
-      debug2 = function() {
-      };
-    }
-    exports2.SEMVER_SPEC_VERSION = "2.0.0";
-    var MAX_LENGTH = 256;
-    var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
-    9007199254740991;
-    var MAX_SAFE_COMPONENT_LENGTH = 16;
-    var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
-    var re = exports2.re = [];
-    var safeRe = exports2.safeRe = [];
-    var src = exports2.src = [];
-    var t = exports2.tokens = {};
-    var R = 0;
-    function tok(n) {
-      t[n] = R++;
-    }
-    var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
-    var safeRegexReplacements = [
-      ["\\s", 1],
-      ["\\d", MAX_LENGTH],
-      [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
-    ];
-    function makeSafeRe(value) {
-      for (var i2 = 0; i2 < safeRegexReplacements.length; i2++) {
-        var token = safeRegexReplacements[i2][0];
-        var max = safeRegexReplacements[i2][1];
-        value = value.split(token + "*").join(token + "{0," + max + "}").split(token + "+").join(token + "{1," + max + "}");
-      }
-      return value;
-    }
-    tok("NUMERICIDENTIFIER");
-    src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*";
-    tok("NUMERICIDENTIFIERLOOSE");
-    src[t.NUMERICIDENTIFIERLOOSE] = "\\d+";
-    tok("NONNUMERICIDENTIFIER");
-    src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + LETTERDASHNUMBER + "*";
-    tok("MAINVERSION");
-    src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")";
-    tok("MAINVERSIONLOOSE");
-    src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")";
-    tok("PRERELEASEIDENTIFIER");
-    src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
-    tok("PRERELEASEIDENTIFIERLOOSE");
-    src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
-    tok("PRERELEASE");
-    src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))";
-    tok("PRERELEASELOOSE");
-    src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))";
-    tok("BUILDIDENTIFIER");
-    src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + "+";
-    tok("BUILD");
-    src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))";
-    tok("FULL");
-    tok("FULLPLAIN");
-    src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?";
-    src[t.FULL] = "^" + src[t.FULLPLAIN] + "$";
-    tok("LOOSEPLAIN");
-    src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?";
-    tok("LOOSE");
-    src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$";
-    tok("GTLT");
-    src[t.GTLT] = "((?:<|>)?=?)";
-    tok("XRANGEIDENTIFIERLOOSE");
-    src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*";
-    tok("XRANGEIDENTIFIER");
-    src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*";
-    tok("XRANGEPLAIN");
-    src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?";
-    tok("XRANGEPLAINLOOSE");
-    src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?";
-    tok("XRANGE");
-    src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$";
-    tok("XRANGELOOSE");
-    src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$";
-    tok("COERCE");
-    src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])";
-    tok("COERCERTL");
-    re[t.COERCERTL] = new RegExp(src[t.COERCE], "g");
-    safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), "g");
-    tok("LONETILDE");
-    src[t.LONETILDE] = "(?:~>?)";
-    tok("TILDETRIM");
-    src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+";
-    re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g");
-    safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), "g");
-    var tildeTrimReplace = "$1~";
-    tok("TILDE");
-    src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$";
-    tok("TILDELOOSE");
-    src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$";
-    tok("LONECARET");
-    src[t.LONECARET] = "(?:\\^)";
-    tok("CARETTRIM");
-    src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+";
-    re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g");
-    safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), "g");
-    var caretTrimReplace = "$1^";
-    tok("CARET");
-    src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$";
-    tok("CARETLOOSE");
-    src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$";
-    tok("COMPARATORLOOSE");
-    src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$";
-    tok("COMPARATOR");
-    src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$";
-    tok("COMPARATORTRIM");
-    src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")";
-    re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g");
-    safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), "g");
-    var comparatorTrimReplace = "$1$2$3";
-    tok("HYPHENRANGE");
-    src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$";
-    tok("HYPHENRANGELOOSE");
-    src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$";
-    tok("STAR");
-    src[t.STAR] = "(<|>)?=?\\s*\\*";
-    for (i = 0; i < R; i++) {
-      debug2(i, src[i]);
-      if (!re[i]) {
-        re[i] = new RegExp(src[i]);
-        safeRe[i] = new RegExp(makeSafeRe(src[i]));
-      }
-    }
-    var i;
-    exports2.parse = parse3;
-    function parse3(version3, options) {
-      if (!options || typeof options !== "object") {
-        options = {
-          loose: !!options,
-          includePrerelease: false
-        };
-      }
-      if (version3 instanceof SemVer) {
-        return version3;
-      }
-      if (typeof version3 !== "string") {
-        return null;
-      }
-      if (version3.length > MAX_LENGTH) {
-        return null;
-      }
-      var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL];
-      if (!r.test(version3)) {
-        return null;
-      }
-      try {
-        return new SemVer(version3, options);
-      } catch (er) {
-        return null;
-      }
-    }
-    exports2.valid = valid2;
-    function valid2(version3, options) {
-      var v = parse3(version3, options);
-      return v ? v.version : null;
-    }
-    exports2.clean = clean3;
-    function clean3(version3, options) {
-      var s = parse3(version3.trim().replace(/^[=v]+/, ""), options);
-      return s ? s.version : null;
-    }
-    exports2.SemVer = SemVer;
-    function SemVer(version3, options) {
-      if (!options || typeof options !== "object") {
-        options = {
-          loose: !!options,
-          includePrerelease: false
-        };
-      }
-      if (version3 instanceof SemVer) {
-        if (version3.loose === options.loose) {
-          return version3;
-        } else {
-          version3 = version3.version;
-        }
-      } else if (typeof version3 !== "string") {
-        throw new TypeError("Invalid Version: " + version3);
-      }
-      if (version3.length > MAX_LENGTH) {
-        throw new TypeError("version is longer than " + MAX_LENGTH + " characters");
-      }
-      if (!(this instanceof SemVer)) {
-        return new SemVer(version3, options);
-      }
-      debug2("SemVer", version3, options);
-      this.options = options;
-      this.loose = !!options.loose;
-      var m = version3.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]);
-      if (!m) {
-        throw new TypeError("Invalid Version: " + version3);
-      }
-      this.raw = version3;
-      this.major = +m[1];
-      this.minor = +m[2];
-      this.patch = +m[3];
-      if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
-        throw new TypeError("Invalid major version");
-      }
-      if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
-        throw new TypeError("Invalid minor version");
-      }
-      if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
-        throw new TypeError("Invalid patch version");
-      }
-      if (!m[4]) {
-        this.prerelease = [];
-      } else {
-        this.prerelease = m[4].split(".").map(function(id) {
-          if (/^[0-9]+$/.test(id)) {
-            var num = +id;
-            if (num >= 0 && num < MAX_SAFE_INTEGER) {
-              return num;
-            }
-          }
-          return id;
-        });
-      }
-      this.build = m[5] ? m[5].split(".") : [];
-      this.format();
-    }
-    SemVer.prototype.format = function() {
-      this.version = this.major + "." + this.minor + "." + this.patch;
-      if (this.prerelease.length) {
-        this.version += "-" + this.prerelease.join(".");
-      }
-      return this.version;
-    };
-    SemVer.prototype.toString = function() {
-      return this.version;
-    };
-    SemVer.prototype.compare = function(other) {
-      debug2("SemVer.compare", this.version, this.options, other);
-      if (!(other instanceof SemVer)) {
-        other = new SemVer(other, this.options);
-      }
-      return this.compareMain(other) || this.comparePre(other);
-    };
-    SemVer.prototype.compareMain = function(other) {
-      if (!(other instanceof SemVer)) {
-        other = new SemVer(other, this.options);
-      }
-      return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
-    };
-    SemVer.prototype.comparePre = function(other) {
-      if (!(other instanceof SemVer)) {
-        other = new SemVer(other, this.options);
-      }
-      if (this.prerelease.length && !other.prerelease.length) {
-        return -1;
-      } else if (!this.prerelease.length && other.prerelease.length) {
-        return 1;
-      } else if (!this.prerelease.length && !other.prerelease.length) {
-        return 0;
-      }
-      var i2 = 0;
-      do {
-        var a = this.prerelease[i2];
-        var b = other.prerelease[i2];
-        debug2("prerelease compare", i2, a, b);
-        if (a === void 0 && b === void 0) {
-          return 0;
-        } else if (b === void 0) {
-          return 1;
-        } else if (a === void 0) {
-          return -1;
-        } else if (a === b) {
-          continue;
-        } else {
-          return compareIdentifiers(a, b);
-        }
-      } while (++i2);
-    };
-    SemVer.prototype.compareBuild = function(other) {
-      if (!(other instanceof SemVer)) {
-        other = new SemVer(other, this.options);
-      }
-      var i2 = 0;
-      do {
-        var a = this.build[i2];
-        var b = other.build[i2];
-        debug2("prerelease compare", i2, a, b);
-        if (a === void 0 && b === void 0) {
-          return 0;
-        } else if (b === void 0) {
-          return 1;
-        } else if (a === void 0) {
-          return -1;
-        } else if (a === b) {
-          continue;
-        } else {
-          return compareIdentifiers(a, b);
-        }
-      } while (++i2);
-    };
-    SemVer.prototype.inc = function(release, identifier) {
-      switch (release) {
-        case "premajor":
-          this.prerelease.length = 0;
-          this.patch = 0;
-          this.minor = 0;
-          this.major++;
-          this.inc("pre", identifier);
-          break;
-        case "preminor":
-          this.prerelease.length = 0;
-          this.patch = 0;
-          this.minor++;
-          this.inc("pre", identifier);
-          break;
-        case "prepatch":
-          this.prerelease.length = 0;
-          this.inc("patch", identifier);
-          this.inc("pre", identifier);
-          break;
-        // If the input is a non-prerelease version, this acts the same as
-        // prepatch.
-        case "prerelease":
-          if (this.prerelease.length === 0) {
-            this.inc("patch", identifier);
-          }
-          this.inc("pre", identifier);
-          break;
-        case "major":
-          if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
-            this.major++;
-          }
-          this.minor = 0;
-          this.patch = 0;
-          this.prerelease = [];
-          break;
-        case "minor":
-          if (this.patch !== 0 || this.prerelease.length === 0) {
-            this.minor++;
-          }
-          this.patch = 0;
-          this.prerelease = [];
-          break;
-        case "patch":
-          if (this.prerelease.length === 0) {
-            this.patch++;
-          }
-          this.prerelease = [];
-          break;
-        // This probably shouldn't be used publicly.
-        // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
-        case "pre":
-          if (this.prerelease.length === 0) {
-            this.prerelease = [0];
-          } else {
-            var i2 = this.prerelease.length;
-            while (--i2 >= 0) {
-              if (typeof this.prerelease[i2] === "number") {
-                this.prerelease[i2]++;
-                i2 = -2;
-              }
-            }
-            if (i2 === -1) {
-              this.prerelease.push(0);
-            }
-          }
-          if (identifier) {
-            if (this.prerelease[0] === identifier) {
-              if (isNaN(this.prerelease[1])) {
-                this.prerelease = [identifier, 0];
-              }
-            } else {
-              this.prerelease = [identifier, 0];
-            }
-          }
-          break;
-        default:
-          throw new Error("invalid increment argument: " + release);
-      }
-      this.format();
-      this.raw = this.version;
-      return this;
-    };
-    exports2.inc = inc;
-    function inc(version3, release, loose, identifier) {
-      if (typeof loose === "string") {
-        identifier = loose;
-        loose = void 0;
-      }
-      try {
-        return new SemVer(version3, loose).inc(release, identifier).version;
-      } catch (er) {
-        return null;
-      }
-    }
-    exports2.diff = diff;
-    function diff(version1, version22) {
-      if (eq(version1, version22)) {
-        return null;
-      } else {
-        var v1 = parse3(version1);
-        var v2 = parse3(version22);
-        var prefix2 = "";
-        if (v1.prerelease.length || v2.prerelease.length) {
-          prefix2 = "pre";
-          var defaultResult = "prerelease";
-        }
-        for (var key in v1) {
-          if (key === "major" || key === "minor" || key === "patch") {
-            if (v1[key] !== v2[key]) {
-              return prefix2 + key;
-            }
-          }
-        }
-        return defaultResult;
-      }
-    }
-    exports2.compareIdentifiers = compareIdentifiers;
-    var numeric = /^[0-9]+$/;
-    function compareIdentifiers(a, b) {
-      var anum = numeric.test(a);
-      var bnum = numeric.test(b);
-      if (anum && bnum) {
-        a = +a;
-        b = +b;
-      }
-      return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
-    }
-    exports2.rcompareIdentifiers = rcompareIdentifiers;
-    function rcompareIdentifiers(a, b) {
-      return compareIdentifiers(b, a);
-    }
-    exports2.major = major;
-    function major(a, loose) {
-      return new SemVer(a, loose).major;
-    }
-    exports2.minor = minor;
-    function minor(a, loose) {
-      return new SemVer(a, loose).minor;
-    }
-    exports2.patch = patch;
-    function patch(a, loose) {
-      return new SemVer(a, loose).patch;
-    }
-    exports2.compare = compare;
-    function compare(a, b, loose) {
-      return new SemVer(a, loose).compare(new SemVer(b, loose));
-    }
-    exports2.compareLoose = compareLoose;
-    function compareLoose(a, b) {
-      return compare(a, b, true);
-    }
-    exports2.compareBuild = compareBuild;
-    function compareBuild(a, b, loose) {
-      var versionA = new SemVer(a, loose);
-      var versionB = new SemVer(b, loose);
-      return versionA.compare(versionB) || versionA.compareBuild(versionB);
-    }
-    exports2.rcompare = rcompare;
-    function rcompare(a, b, loose) {
-      return compare(b, a, loose);
-    }
-    exports2.sort = sort;
-    function sort(list, loose) {
-      return list.sort(function(a, b) {
-        return exports2.compareBuild(a, b, loose);
-      });
-    }
-    exports2.rsort = rsort;
-    function rsort(list, loose) {
-      return list.sort(function(a, b) {
-        return exports2.compareBuild(b, a, loose);
-      });
-    }
-    exports2.gt = gt2;
-    function gt2(a, b, loose) {
-      return compare(a, b, loose) > 0;
-    }
-    exports2.lt = lt;
-    function lt(a, b, loose) {
-      return compare(a, b, loose) < 0;
-    }
-    exports2.eq = eq;
-    function eq(a, b, loose) {
-      return compare(a, b, loose) === 0;
-    }
-    exports2.neq = neq;
-    function neq(a, b, loose) {
-      return compare(a, b, loose) !== 0;
-    }
-    exports2.gte = gte;
-    function gte(a, b, loose) {
-      return compare(a, b, loose) >= 0;
-    }
-    exports2.lte = lte;
-    function lte(a, b, loose) {
-      return compare(a, b, loose) <= 0;
-    }
-    exports2.cmp = cmp;
-    function cmp(a, op, b, loose) {
-      switch (op) {
-        case "===":
-          if (typeof a === "object")
-            a = a.version;
-          if (typeof b === "object")
-            b = b.version;
-          return a === b;
-        case "!==":
-          if (typeof a === "object")
-            a = a.version;
-          if (typeof b === "object")
-            b = b.version;
-          return a !== b;
-        case "":
-        case "=":
-        case "==":
-          return eq(a, b, loose);
-        case "!=":
-          return neq(a, b, loose);
-        case ">":
-          return gt2(a, b, loose);
-        case ">=":
-          return gte(a, b, loose);
-        case "<":
-          return lt(a, b, loose);
-        case "<=":
-          return lte(a, b, loose);
-        default:
-          throw new TypeError("Invalid operator: " + op);
-      }
-    }
-    exports2.Comparator = Comparator;
-    function Comparator(comp26, options) {
-      if (!options || typeof options !== "object") {
-        options = {
-          loose: !!options,
-          includePrerelease: false
-        };
-      }
-      if (comp26 instanceof Comparator) {
-        if (comp26.loose === !!options.loose) {
-          return comp26;
-        } else {
-          comp26 = comp26.value;
-        }
-      }
-      if (!(this instanceof Comparator)) {
-        return new Comparator(comp26, options);
-      }
-      comp26 = comp26.trim().split(/\s+/).join(" ");
-      debug2("comparator", comp26, options);
-      this.options = options;
-      this.loose = !!options.loose;
-      this.parse(comp26);
-      if (this.semver === ANY) {
-        this.value = "";
-      } else {
-        this.value = this.operator + this.semver.version;
-      }
-      debug2("comp", this);
-    }
-    var ANY = {};
-    Comparator.prototype.parse = function(comp26) {
-      var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
-      var m = comp26.match(r);
-      if (!m) {
-        throw new TypeError("Invalid comparator: " + comp26);
-      }
-      this.operator = m[1] !== void 0 ? m[1] : "";
-      if (this.operator === "=") {
-        this.operator = "";
-      }
-      if (!m[2]) {
-        this.semver = ANY;
-      } else {
-        this.semver = new SemVer(m[2], this.options.loose);
-      }
-    };
-    Comparator.prototype.toString = function() {
-      return this.value;
-    };
-    Comparator.prototype.test = function(version3) {
-      debug2("Comparator.test", version3, this.options.loose);
-      if (this.semver === ANY || version3 === ANY) {
-        return true;
-      }
-      if (typeof version3 === "string") {
-        try {
-          version3 = new SemVer(version3, this.options);
-        } catch (er) {
-          return false;
-        }
-      }
-      return cmp(version3, this.operator, this.semver, this.options);
-    };
-    Comparator.prototype.intersects = function(comp26, options) {
-      if (!(comp26 instanceof Comparator)) {
-        throw new TypeError("a Comparator is required");
-      }
-      if (!options || typeof options !== "object") {
-        options = {
-          loose: !!options,
-          includePrerelease: false
-        };
-      }
-      var rangeTmp;
-      if (this.operator === "") {
-        if (this.value === "") {
-          return true;
-        }
-        rangeTmp = new Range(comp26.value, options);
-        return satisfies4(this.value, rangeTmp, options);
-      } else if (comp26.operator === "") {
-        if (comp26.value === "") {
-          return true;
-        }
-        rangeTmp = new Range(this.value, options);
-        return satisfies4(comp26.semver, rangeTmp, options);
-      }
-      var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp26.operator === ">=" || comp26.operator === ">");
-      var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp26.operator === "<=" || comp26.operator === "<");
-      var sameSemVer = this.semver.version === comp26.semver.version;
-      var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp26.operator === ">=" || comp26.operator === "<=");
-      var oppositeDirectionsLessThan = cmp(this.semver, "<", comp26.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp26.operator === "<=" || comp26.operator === "<"));
-      var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp26.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp26.operator === ">=" || comp26.operator === ">"));
-      return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
-    };
-    exports2.Range = Range;
-    function Range(range2, options) {
-      if (!options || typeof options !== "object") {
-        options = {
-          loose: !!options,
-          includePrerelease: false
-        };
-      }
-      if (range2 instanceof Range) {
-        if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) {
-          return range2;
-        } else {
-          return new Range(range2.raw, options);
-        }
-      }
-      if (range2 instanceof Comparator) {
-        return new Range(range2.value, options);
-      }
-      if (!(this instanceof Range)) {
-        return new Range(range2, options);
-      }
-      this.options = options;
-      this.loose = !!options.loose;
-      this.includePrerelease = !!options.includePrerelease;
-      this.raw = range2.trim().split(/\s+/).join(" ");
-      this.set = this.raw.split("||").map(function(range3) {
-        return this.parseRange(range3.trim());
-      }, this).filter(function(c) {
-        return c.length;
-      });
-      if (!this.set.length) {
-        throw new TypeError("Invalid SemVer Range: " + this.raw);
-      }
-      this.format();
-    }
-    Range.prototype.format = function() {
-      this.range = this.set.map(function(comps) {
-        return comps.join(" ").trim();
-      }).join("||").trim();
-      return this.range;
-    };
-    Range.prototype.toString = function() {
-      return this.range;
-    };
-    Range.prototype.parseRange = function(range2) {
-      var loose = this.options.loose;
-      var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE];
-      range2 = range2.replace(hr, hyphenReplace);
-      debug2("hyphen replace", range2);
-      range2 = range2.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace);
-      debug2("comparator trim", range2, safeRe[t.COMPARATORTRIM]);
-      range2 = range2.replace(safeRe[t.TILDETRIM], tildeTrimReplace);
-      range2 = range2.replace(safeRe[t.CARETTRIM], caretTrimReplace);
-      range2 = range2.split(/\s+/).join(" ");
-      var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
-      var set = range2.split(" ").map(function(comp26) {
-        return parseComparator(comp26, this.options);
-      }, this).join(" ").split(/\s+/);
-      if (this.options.loose) {
-        set = set.filter(function(comp26) {
-          return !!comp26.match(compRe);
-        });
-      }
-      set = set.map(function(comp26) {
-        return new Comparator(comp26, this.options);
-      }, this);
-      return set;
-    };
-    Range.prototype.intersects = function(range2, options) {
-      if (!(range2 instanceof Range)) {
-        throw new TypeError("a Range is required");
-      }
-      return this.set.some(function(thisComparators) {
-        return isSatisfiable(thisComparators, options) && range2.set.some(function(rangeComparators) {
-          return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
-            return rangeComparators.every(function(rangeComparator) {
-              return thisComparator.intersects(rangeComparator, options);
-            });
-          });
-        });
-      });
-    };
-    function isSatisfiable(comparators, options) {
-      var result = true;
-      var remainingComparators = comparators.slice();
-      var testComparator = remainingComparators.pop();
-      while (result && remainingComparators.length) {
-        result = remainingComparators.every(function(otherComparator) {
-          return testComparator.intersects(otherComparator, options);
-        });
-        testComparator = remainingComparators.pop();
-      }
-      return result;
-    }
-    exports2.toComparators = toComparators;
-    function toComparators(range2, options) {
-      return new Range(range2, options).set.map(function(comp26) {
-        return comp26.map(function(c) {
-          return c.value;
-        }).join(" ").trim().split(" ");
-      });
-    }
-    function parseComparator(comp26, options) {
-      debug2("comp", comp26, options);
-      comp26 = replaceCarets(comp26, options);
-      debug2("caret", comp26);
-      comp26 = replaceTildes(comp26, options);
-      debug2("tildes", comp26);
-      comp26 = replaceXRanges(comp26, options);
-      debug2("xrange", comp26);
-      comp26 = replaceStars(comp26, options);
-      debug2("stars", comp26);
-      return comp26;
-    }
-    function isX(id) {
-      return !id || id.toLowerCase() === "x" || id === "*";
-    }
-    function replaceTildes(comp26, options) {
-      return comp26.trim().split(/\s+/).map(function(comp27) {
-        return replaceTilde(comp27, options);
-      }).join(" ");
-    }
-    function replaceTilde(comp26, options) {
-      var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE];
-      return comp26.replace(r, function(_, M, m, p, pr) {
-        debug2("tilde", comp26, _, M, m, p, pr);
-        var ret;
-        if (isX(M)) {
-          ret = "";
-        } else if (isX(m)) {
-          ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
-        } else if (isX(p)) {
-          ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
-        } else if (pr) {
-          debug2("replaceTilde pr", pr);
-          ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
-        } else {
-          ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
-        }
-        debug2("tilde return", ret);
-        return ret;
-      });
-    }
-    function replaceCarets(comp26, options) {
-      return comp26.trim().split(/\s+/).map(function(comp27) {
-        return replaceCaret(comp27, options);
-      }).join(" ");
-    }
-    function replaceCaret(comp26, options) {
-      debug2("caret", comp26, options);
-      var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET];
-      return comp26.replace(r, function(_, M, m, p, pr) {
-        debug2("caret", comp26, _, M, m, p, pr);
-        var ret;
-        if (isX(M)) {
-          ret = "";
-        } else if (isX(m)) {
-          ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
-        } else if (isX(p)) {
-          if (M === "0") {
-            ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
-          } else {
-            ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
-          }
-        } else if (pr) {
-          debug2("replaceCaret pr", pr);
-          if (M === "0") {
-            if (m === "0") {
-              ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
-            } else {
-              ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
-            }
-          } else {
-            ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
-          }
-        } else {
-          debug2("no pr");
-          if (M === "0") {
-            if (m === "0") {
-              ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
-            } else {
-              ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
-            }
-          } else {
-            ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
-          }
-        }
-        debug2("caret return", ret);
-        return ret;
-      });
-    }
-    function replaceXRanges(comp26, options) {
-      debug2("replaceXRanges", comp26, options);
-      return comp26.split(/\s+/).map(function(comp27) {
-        return replaceXRange(comp27, options);
-      }).join(" ");
-    }
-    function replaceXRange(comp26, options) {
-      comp26 = comp26.trim();
-      var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE];
-      return comp26.replace(r, function(ret, gtlt, M, m, p, pr) {
-        debug2("xRange", comp26, ret, gtlt, M, m, p, pr);
-        var xM = isX(M);
-        var xm = xM || isX(m);
-        var xp = xm || isX(p);
-        var anyX = xp;
-        if (gtlt === "=" && anyX) {
-          gtlt = "";
-        }
-        pr = options.includePrerelease ? "-0" : "";
-        if (xM) {
-          if (gtlt === ">" || gtlt === "<") {
-            ret = "<0.0.0-0";
-          } else {
-            ret = "*";
-          }
-        } else if (gtlt && anyX) {
-          if (xm) {
-            m = 0;
-          }
-          p = 0;
-          if (gtlt === ">") {
-            gtlt = ">=";
-            if (xm) {
-              M = +M + 1;
-              m = 0;
-              p = 0;
-            } else {
-              m = +m + 1;
-              p = 0;
-            }
-          } else if (gtlt === "<=") {
-            gtlt = "<";
-            if (xm) {
-              M = +M + 1;
-            } else {
-              m = +m + 1;
-            }
-          }
-          ret = gtlt + M + "." + m + "." + p + pr;
-        } else if (xm) {
-          ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr;
-        } else if (xp) {
-          ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
-        }
-        debug2("xRange return", ret);
-        return ret;
-      });
-    }
-    function replaceStars(comp26, options) {
-      debug2("replaceStars", comp26, options);
-      return comp26.trim().replace(safeRe[t.STAR], "");
-    }
-    function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
-      if (isX(fM)) {
-        from = "";
-      } else if (isX(fm)) {
-        from = ">=" + fM + ".0.0";
-      } else if (isX(fp)) {
-        from = ">=" + fM + "." + fm + ".0";
-      } else {
-        from = ">=" + from;
-      }
-      if (isX(tM)) {
-        to = "";
-      } else if (isX(tm)) {
-        to = "<" + (+tM + 1) + ".0.0";
-      } else if (isX(tp)) {
-        to = "<" + tM + "." + (+tm + 1) + ".0";
-      } else if (tpr) {
-        to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
-      } else {
-        to = "<=" + to;
-      }
-      return (from + " " + to).trim();
-    }
-    Range.prototype.test = function(version3) {
-      if (!version3) {
-        return false;
-      }
-      if (typeof version3 === "string") {
-        try {
-          version3 = new SemVer(version3, this.options);
-        } catch (er) {
-          return false;
-        }
-      }
-      for (var i2 = 0; i2 < this.set.length; i2++) {
-        if (testSet(this.set[i2], version3, this.options)) {
-          return true;
-        }
-      }
-      return false;
-    };
-    function testSet(set, version3, options) {
-      for (var i2 = 0; i2 < set.length; i2++) {
-        if (!set[i2].test(version3)) {
-          return false;
-        }
-      }
-      if (version3.prerelease.length && !options.includePrerelease) {
-        for (i2 = 0; i2 < set.length; i2++) {
-          debug2(set[i2].semver);
-          if (set[i2].semver === ANY) {
-            continue;
-          }
-          if (set[i2].semver.prerelease.length > 0) {
-            var allowed = set[i2].semver;
-            if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) {
-              return true;
-            }
-          }
-        }
-        return false;
-      }
-      return true;
-    }
-    exports2.satisfies = satisfies4;
-    function satisfies4(version3, range2, options) {
-      try {
-        range2 = new Range(range2, options);
-      } catch (er) {
-        return false;
-      }
-      return range2.test(version3);
-    }
-    exports2.maxSatisfying = maxSatisfying3;
-    function maxSatisfying3(versions, range2, options) {
-      var max = null;
-      var maxSV = null;
-      try {
-        var rangeObj = new Range(range2, options);
-      } catch (er) {
-        return null;
-      }
-      versions.forEach(function(v) {
-        if (rangeObj.test(v)) {
-          if (!max || maxSV.compare(v) === -1) {
-            max = v;
-            maxSV = new SemVer(max, options);
-          }
-        }
-      });
-      return max;
-    }
-    exports2.minSatisfying = minSatisfying4;
-    function minSatisfying4(versions, range2, options) {
-      var min = null;
-      var minSV = null;
-      try {
-        var rangeObj = new Range(range2, options);
-      } catch (er) {
-        return null;
-      }
-      versions.forEach(function(v) {
-        if (rangeObj.test(v)) {
-          if (!min || minSV.compare(v) === 1) {
-            min = v;
-            minSV = new SemVer(min, options);
-          }
-        }
-      });
-      return min;
-    }
-    exports2.minVersion = minVersion;
-    function minVersion(range2, loose) {
-      range2 = new Range(range2, loose);
-      var minver = new SemVer("0.0.0");
-      if (range2.test(minver)) {
-        return minver;
-      }
-      minver = new SemVer("0.0.0-0");
-      if (range2.test(minver)) {
-        return minver;
-      }
-      minver = null;
-      for (var i2 = 0; i2 < range2.set.length; ++i2) {
-        var comparators = range2.set[i2];
-        comparators.forEach(function(comparator) {
-          var compver = new SemVer(comparator.semver.version);
-          switch (comparator.operator) {
-            case ">":
-              if (compver.prerelease.length === 0) {
-                compver.patch++;
-              } else {
-                compver.prerelease.push(0);
-              }
-              compver.raw = compver.format();
-            /* fallthrough */
-            case "":
-            case ">=":
-              if (!minver || gt2(minver, compver)) {
-                minver = compver;
-              }
-              break;
-            case "<":
-            case "<=":
-              break;
-            /* istanbul ignore next */
-            default:
-              throw new Error("Unexpected operation: " + comparator.operator);
-          }
-        });
-      }
-      if (minver && range2.test(minver)) {
-        return minver;
-      }
-      return null;
-    }
-    exports2.validRange = validRange;
-    function validRange(range2, options) {
-      try {
-        return new Range(range2, options).range || "*";
-      } catch (er) {
-        return null;
-      }
-    }
-    exports2.ltr = ltr;
-    function ltr(version3, range2, options) {
-      return outside(version3, range2, "<", options);
-    }
-    exports2.gtr = gtr;
-    function gtr(version3, range2, options) {
-      return outside(version3, range2, ">", options);
-    }
-    exports2.outside = outside;
-    function outside(version3, range2, hilo, options) {
-      version3 = new SemVer(version3, options);
-      range2 = new Range(range2, options);
-      var gtfn, ltefn, ltfn, comp26, ecomp;
-      switch (hilo) {
-        case ">":
-          gtfn = gt2;
-          ltefn = lte;
-          ltfn = lt;
-          comp26 = ">";
-          ecomp = ">=";
-          break;
-        case "<":
-          gtfn = lt;
-          ltefn = gte;
-          ltfn = gt2;
-          comp26 = "<";
-          ecomp = "<=";
-          break;
-        default:
-          throw new TypeError('Must provide a hilo val of "<" or ">"');
-      }
-      if (satisfies4(version3, range2, options)) {
-        return false;
-      }
-      for (var i2 = 0; i2 < range2.set.length; ++i2) {
-        var comparators = range2.set[i2];
-        var high = null;
-        var low = null;
-        comparators.forEach(function(comparator) {
-          if (comparator.semver === ANY) {
-            comparator = new Comparator(">=0.0.0");
-          }
-          high = high || comparator;
-          low = low || comparator;
-          if (gtfn(comparator.semver, high.semver, options)) {
-            high = comparator;
-          } else if (ltfn(comparator.semver, low.semver, options)) {
-            low = comparator;
-          }
-        });
-        if (high.operator === comp26 || high.operator === ecomp) {
-          return false;
-        }
-        if ((!low.operator || low.operator === comp26) && ltefn(version3, low.semver)) {
-          return false;
-        } else if (low.operator === ecomp && ltfn(version3, low.semver)) {
-          return false;
-        }
-      }
-      return true;
-    }
-    exports2.prerelease = prerelease;
-    function prerelease(version3, options) {
-      var parsed = parse3(version3, options);
-      return parsed && parsed.prerelease.length ? parsed.prerelease : null;
-    }
-    exports2.intersects = intersects;
-    function intersects(r1, r2, options) {
-      r1 = new Range(r1, options);
-      r2 = new Range(r2, options);
-      return r1.intersects(r2);
-    }
-    exports2.coerce = coerce;
-    function coerce(version3, options) {
-      if (version3 instanceof SemVer) {
-        return version3;
-      }
-      if (typeof version3 === "number") {
-        version3 = String(version3);
-      }
-      if (typeof version3 !== "string") {
-        return null;
-      }
-      options = options || {};
-      var match2 = null;
-      if (!options.rtl) {
-        match2 = version3.match(safeRe[t.COERCE]);
-      } else {
-        var next;
-        while ((next = safeRe[t.COERCERTL].exec(version3)) && (!match2 || match2.index + match2[0].length !== version3.length)) {
-          if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
-            match2 = next;
-          }
-          safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
-        }
-        safeRe[t.COERCERTL].lastIndex = -1;
-      }
-      if (match2 === null) {
-        return null;
-      }
-      return parse3(match2[2] + "." + (match2[3] || "0") + "." + (match2[4] || "0"), options);
-    }
-  }
-});
-
 // node_modules/undici/lib/core/symbols.js
 var require_symbols6 = __commonJS({
   "node_modules/undici/lib/core/symbols.js"(exports2, module2) {
@@ -31829,14 +30025,14 @@ var require_util9 = __commonJS({
         }
         const port = url2.port != null ? url2.port : url2.protocol === "https:" ? 443 : 80;
         let origin = url2.origin != null ? url2.origin : `${url2.protocol || ""}//${url2.hostname || ""}:${port}`;
-        let path16 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
+        let path17 = url2.path != null ? url2.path : `${url2.pathname || ""}${url2.search || ""}`;
         if (origin[origin.length - 1] === "/") {
           origin = origin.slice(0, origin.length - 1);
         }
-        if (path16 && path16[0] !== "/") {
-          path16 = `/${path16}`;
+        if (path17 && path17[0] !== "/") {
+          path17 = `/${path17}`;
         }
-        return new URL(`${origin}${path16}`);
+        return new URL(`${origin}${path17}`);
       }
       if (!isHttpOrHttpsPrefixed(url2.origin || url2.protocol)) {
         throw new InvalidArgumentError("Invalid URL protocol: the URL must start with `http:` or `https:`.");
@@ -32647,9 +30843,9 @@ var require_diagnostics2 = __commonJS({
         "undici:client:sendHeaders",
         (evt) => {
           const {
-            request: { method, path: path16, origin }
+            request: { method, path: path17, origin }
           } = evt;
-          debugLog("sending request to %s %s%s", method, origin, path16);
+          debugLog("sending request to %s %s%s", method, origin, path17);
         }
       );
     }
@@ -32667,14 +30863,14 @@ var require_diagnostics2 = __commonJS({
         "undici:request:headers",
         (evt) => {
           const {
-            request: { method, path: path16, origin },
+            request: { method, path: path17, origin },
             response: { statusCode }
           } = evt;
           debugLog(
             "received response to %s %s%s - HTTP %d",
             method,
             origin,
-            path16,
+            path17,
             statusCode
           );
         }
@@ -32683,23 +30879,23 @@ var require_diagnostics2 = __commonJS({
         "undici:request:trailers",
         (evt) => {
           const {
-            request: { method, path: path16, origin }
+            request: { method, path: path17, origin }
           } = evt;
-          debugLog("trailers received from %s %s%s", method, origin, path16);
+          debugLog("trailers received from %s %s%s", method, origin, path17);
         }
       );
       diagnosticsChannel.subscribe(
         "undici:request:error",
         (evt) => {
           const {
-            request: { method, path: path16, origin },
+            request: { method, path: path17, origin },
             error: error2
           } = evt;
           debugLog(
             "request to %s %s%s errored - %s",
             method,
             origin,
-            path16,
+            path17,
             error2.message
           );
         }
@@ -32800,7 +30996,7 @@ var require_request3 = __commonJS({
     var kHandler = /* @__PURE__ */ Symbol("handler");
     var Request = class {
       constructor(origin, {
-        path: path16,
+        path: path17,
         method,
         body: body2,
         headers,
@@ -32817,11 +31013,11 @@ var require_request3 = __commonJS({
         maxRedirections,
         typeOfService
       }, handler) {
-        if (typeof path16 !== "string") {
+        if (typeof path17 !== "string") {
           throw new InvalidArgumentError("path must be a string");
-        } else if (path16[0] !== "/" && !(path16.startsWith("http://") || path16.startsWith("https://")) && method !== "CONNECT") {
+        } else if (path17[0] !== "/" && !(path17.startsWith("http://") || path17.startsWith("https://")) && method !== "CONNECT") {
           throw new InvalidArgumentError("path must be an absolute URL or start with a slash");
-        } else if (invalidPathRegex.test(path16)) {
+        } else if (invalidPathRegex.test(path17)) {
           throw new InvalidArgumentError("invalid request path");
         }
         if (typeof method !== "string") {
@@ -32896,7 +31092,7 @@ var require_request3 = __commonJS({
         this.completed = false;
         this.aborted = false;
         this.upgrade = upgrade || null;
-        this.path = query ? serializePathWithQuery(path16, query) : path16;
+        this.path = query ? serializePathWithQuery(path17, query) : path17;
         this.origin = origin;
         this.protocol = getProtocolFromUrlString(origin);
         this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
@@ -37929,7 +36125,7 @@ var require_client_h12 = __commonJS({
       return method !== "GET" && method !== "HEAD" && method !== "OPTIONS" && method !== "TRACE" && method !== "CONNECT";
     }
     function writeH1(client, request) {
-      const { method, path: path16, host, upgrade, blocking, reset } = request;
+      const { method, path: path17, host, upgrade, blocking, reset } = request;
       let { body: body2, headers, contentLength: contentLength2 } = request;
       const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH" || method === "QUERY" || method === "PROPFIND" || method === "PROPPATCH";
       if (util7.isFormDataLike(body2)) {
@@ -37998,7 +36194,7 @@ var require_client_h12 = __commonJS({
       if (socket.setTypeOfService) {
         socket.setTypeOfService(request.typeOfService);
       }
-      let header = `${method} ${path16} HTTP/1.1\r
+      let header = `${method} ${path17} HTTP/1.1\r
 `;
       if (typeof host === "string") {
         header += `host: ${host}\r
@@ -38651,7 +36847,7 @@ var require_client_h22 = __commonJS({
     function writeH2(client, request) {
       const requestTimeout = request.bodyTimeout ?? client[kBodyTimeout];
       const session = client[kHTTP2Session];
-      const { method, path: path16, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request;
+      const { method, path: path17, host, upgrade, expectContinue, signal, protocol, headers: reqHeaders } = request;
       let { body: body2 } = request;
       if (upgrade != null && upgrade !== "websocket") {
         util7.errorRequest(client, request, new InvalidArgumentError(`Custom upgrade "${upgrade}" not supported over HTTP/2`));
@@ -38719,7 +36915,7 @@ var require_client_h22 = __commonJS({
           }
           headers[HTTP2_HEADER_METHOD] = "CONNECT";
           headers[HTTP2_HEADER_PROTOCOL] = "websocket";
-          headers[HTTP2_HEADER_PATH] = path16;
+          headers[HTTP2_HEADER_PATH] = path17;
           if (protocol === "ws:" || protocol === "wss:") {
             headers[HTTP2_HEADER_SCHEME] = protocol === "ws:" ? "http" : "https";
           } else {
@@ -38760,7 +36956,7 @@ var require_client_h22 = __commonJS({
         stream4.setTimeout(requestTimeout);
         return true;
       }
-      headers[HTTP2_HEADER_PATH] = path16;
+      headers[HTTP2_HEADER_PATH] = path17;
       headers[HTTP2_HEADER_SCHEME] = protocol === "http:" ? "http" : "https";
       const expectsPayload = method === "PUT" || method === "POST" || method === "PATCH";
       if (body2 && typeof body2.read === "function") {
@@ -41057,10 +39253,10 @@ var require_proxy_agent2 = __commonJS({
         };
         const {
           origin,
-          path: path16 = "/",
+          path: path17 = "/",
           headers = {}
         } = opts;
-        opts.path = origin + path16;
+        opts.path = origin + path17;
         if (!("host" in headers) && !("Host" in headers)) {
           const { host } = new URL(origin);
           headers.host = host;
@@ -43121,20 +41317,20 @@ var require_mock_utils2 = __commonJS({
       }
       return normalizedQp;
     }
-    function safeUrl(path16) {
-      if (typeof path16 !== "string") {
-        return path16;
+    function safeUrl(path17) {
+      if (typeof path17 !== "string") {
+        return path17;
       }
-      const pathSegments = path16.split("?", 3);
+      const pathSegments = path17.split("?", 3);
       if (pathSegments.length !== 2) {
-        return path16;
+        return path17;
       }
       const qp = new URLSearchParams(pathSegments.pop());
       qp.sort();
       return [...pathSegments, qp.toString()].join("?");
     }
-    function matchKey(mockDispatch2, { path: path16, method, body: body2, headers }) {
-      const pathMatch = matchValue(mockDispatch2.path, path16);
+    function matchKey(mockDispatch2, { path: path17, method, body: body2, headers }) {
+      const pathMatch = matchValue(mockDispatch2.path, path17);
       const methodMatch = matchValue(mockDispatch2.method, method);
       const bodyMatch = typeof mockDispatch2.body !== "undefined" ? matchValue(mockDispatch2.body, body2) : true;
       const headersMatch = matchHeaders(mockDispatch2, headers);
@@ -43159,8 +41355,8 @@ var require_mock_utils2 = __commonJS({
       const basePath = key.query ? serializePathWithQuery(key.path, key.query) : key.path;
       const resolvedPath = typeof basePath === "string" ? safeUrl(basePath) : basePath;
       const resolvedPathWithoutTrailingSlash = removeTrailingSlash(resolvedPath);
-      let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path16, ignoreTrailingSlash }) => {
-        return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path16)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path16), resolvedPath);
+      let matchedMockDispatches = mockDispatches.filter(({ consumed }) => !consumed).filter(({ path: path17, ignoreTrailingSlash }) => {
+        return ignoreTrailingSlash ? matchValue(removeTrailingSlash(safeUrl(path17)), resolvedPathWithoutTrailingSlash) : matchValue(safeUrl(path17), resolvedPath);
       });
       if (matchedMockDispatches.length === 0) {
         throw new MockNotMatchedError(`Mock dispatch not matched for path '${resolvedPath}'`);
@@ -43198,19 +41394,19 @@ var require_mock_utils2 = __commonJS({
         mockDispatches.splice(index, 1);
       }
     }
-    function removeTrailingSlash(path16) {
-      while (path16.endsWith("/")) {
-        path16 = path16.slice(0, -1);
+    function removeTrailingSlash(path17) {
+      while (path17.endsWith("/")) {
+        path17 = path17.slice(0, -1);
       }
-      if (path16.length === 0) {
-        path16 = "/";
+      if (path17.length === 0) {
+        path17 = "/";
       }
-      return path16;
+      return path17;
     }
     function buildKey(opts) {
-      const { path: path16, method, body: body2, headers, query } = opts;
+      const { path: path17, method, body: body2, headers, query } = opts;
       return {
-        path: path16,
+        path: path17,
         method,
         body: body2,
         headers,
@@ -43897,10 +42093,10 @@ var require_pending_interceptors_formatter2 = __commonJS({
       }
       format(pendingInterceptors) {
         const withPrettyHeaders = pendingInterceptors.map(
-          ({ method, path: path16, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
+          ({ method, path: path17, data: { statusCode }, persist, times, timesInvoked, origin }) => ({
             Method: method,
             Origin: origin,
-            Path: path16,
+            Path: path17,
             "Status code": statusCode,
             Persistent: persist ? PERSISTENT : NOT_PERSISTENT,
             Invocations: timesInvoked,
@@ -43982,9 +42178,9 @@ var require_mock_agent2 = __commonJS({
         const acceptNonStandardSearchParameters = this[kMockAgentAcceptsNonStandardSearchParameters];
         const dispatchOpts = { ...opts };
         if (acceptNonStandardSearchParameters && dispatchOpts.path) {
-          const [path16, searchParams] = dispatchOpts.path.split("?");
+          const [path17, searchParams] = dispatchOpts.path.split("?");
           const normalizedSearchParams = normalizeSearchParams(searchParams, acceptNonStandardSearchParameters);
-          dispatchOpts.path = `${path16}?${normalizedSearchParams}`;
+          dispatchOpts.path = `${path17}?${normalizedSearchParams}`;
         }
         return this[kAgent].dispatch(dispatchOpts, handler);
       }
@@ -44385,12 +42581,12 @@ var require_snapshot_recorder = __commonJS({
        * @return {Promise} - Resolves when snapshots are loaded
        */
       async loadSnapshots(filePath) {
-        const path16 = filePath || this.#snapshotPath;
-        if (!path16) {
+        const path17 = filePath || this.#snapshotPath;
+        if (!path17) {
           throw new InvalidArgumentError("Snapshot path is required");
         }
         try {
-          const data = await readFile(resolve3(path16), "utf8");
+          const data = await readFile(resolve3(path17), "utf8");
           const parsed = JSON.parse(data);
           if (Array.isArray(parsed)) {
             this.#snapshots.clear();
@@ -44404,7 +42600,7 @@ var require_snapshot_recorder = __commonJS({
           if (error2.code === "ENOENT") {
             this.#snapshots.clear();
           } else {
-            throw new UndiciError(`Failed to load snapshots from ${path16}`, { cause: error2 });
+            throw new UndiciError(`Failed to load snapshots from ${path17}`, { cause: error2 });
           }
         }
       }
@@ -44415,11 +42611,11 @@ var require_snapshot_recorder = __commonJS({
        * @returns {Promise} - Resolves when snapshots are saved
        */
       async saveSnapshots(filePath) {
-        const path16 = filePath || this.#snapshotPath;
-        if (!path16) {
+        const path17 = filePath || this.#snapshotPath;
+        if (!path17) {
           throw new InvalidArgumentError("Snapshot path is required");
         }
-        const resolvedPath = resolve3(path16);
+        const resolvedPath = resolve3(path17);
         await mkdir2(dirname6(resolvedPath), { recursive: true });
         const data = Array.from(this.#snapshots.entries()).map(([hash, snapshot2]) => ({
           hash,
@@ -45044,15 +43240,15 @@ var require_redirect_handler2 = __commonJS({
           return;
         }
         const { origin, pathname, search } = util7.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
-        const path16 = search ? `${pathname}${search}` : pathname;
-        const redirectUrlString = `${origin}${path16}`;
+        const path17 = search ? `${pathname}${search}` : pathname;
+        const redirectUrlString = `${origin}${path17}`;
         for (const historyUrl of this.history) {
           if (historyUrl.toString() === redirectUrlString) {
             throw new InvalidArgumentError(`Redirect loop detected. Cannot redirect to ${origin}. This typically happens when using a Client or Pool with cross-origin redirects. Use an Agent for cross-origin redirects.`);
           }
         }
         this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
-        this.opts.path = path16;
+        this.opts.path = path17;
         this.opts.origin = origin;
         this.opts.query = null;
       }
@@ -52185,9 +50381,9 @@ var require_util12 = __commonJS({
         }
       }
     }
-    function validateCookiePath(path16) {
-      for (let i = 0; i < path16.length; ++i) {
-        const code = path16.charCodeAt(i);
+    function validateCookiePath(path17) {
+      for (let i = 0; i < path17.length; ++i) {
+        const code = path17.charCodeAt(i);
         if (code < 32 || // exclude CTLs (0-31)
         code === 127 || // DEL
         code === 59) {
@@ -55348,11 +53544,11 @@ var require_undici2 = __commonJS({
           if (typeof opts.path !== "string") {
             throw new InvalidArgumentError("invalid opts.path");
           }
-          let path16 = opts.path;
+          let path17 = opts.path;
           if (!opts.path.startsWith("/")) {
-            path16 = `/${path16}`;
+            path17 = `/${path17}`;
           }
-          url2 = new URL(util7.parseOrigin(url2).origin + path16);
+          url2 = new URL(util7.parseOrigin(url2).origin + path17);
         } else {
           if (!opts) {
             opts = typeof url2 === "object" ? url2 : {};
@@ -55461,9 +53657,1813 @@ ${captureLines}` : capture.stack;
   }
 });
 
+// node_modules/@renovatebot/pep440/lib/version.js
+var require_version = __commonJS({
+  "node_modules/@renovatebot/pep440/lib/version.js"(exports2, module2) {
+    var VERSION_PATTERN = [
+      "v?",
+      "(?:",
+      /* */
+      "(?:(?[0-9]+)!)?",
+      // epoch
+      /* */
+      "(?[0-9]+(?:\\.[0-9]+)*)",
+      // release segment
+      /* */
+      "(?
",
+      // pre-release
+      /*    */
+      "[-_\\.]?",
+      /*    */
+      "(?(a|b|c|rc|alpha|beta|pre|preview))",
+      /*    */
+      "[-_\\.]?",
+      /*    */
+      "(?[0-9]+)?",
+      /* */
+      ")?",
+      /* */
+      "(?",
+      // post release
+      /*    */
+      "(?:-(?[0-9]+))",
+      /*    */
+      "|",
+      /*    */
+      "(?:",
+      /*        */
+      "[-_\\.]?",
+      /*        */
+      "(?post|rev|r)",
+      /*        */
+      "[-_\\.]?",
+      /*        */
+      "(?[0-9]+)?",
+      /*    */
+      ")",
+      /* */
+      ")?",
+      /* */
+      "(?",
+      // dev release
+      /*    */
+      "[-_\\.]?",
+      /*    */
+      "(?dev)",
+      /*    */
+      "[-_\\.]?",
+      /*    */
+      "(?[0-9]+)?",
+      /* */
+      ")?",
+      ")",
+      "(?:\\+(?[a-z0-9]+(?:[-_\\.][a-z0-9]+)*))?"
+      // local version
+    ].join("");
+    module2.exports = {
+      VERSION_PATTERN,
+      valid: valid2,
+      clean: clean3,
+      explain,
+      parse: parse3,
+      stringify: stringify2
+    };
+    var validRegex = new RegExp("^" + VERSION_PATTERN + "$", "i");
+    function valid2(version3) {
+      return validRegex.test(version3) ? version3 : null;
+    }
+    var cleanRegex = new RegExp("^\\s*" + VERSION_PATTERN + "\\s*$", "i");
+    function clean3(version3) {
+      return stringify2(parse3(version3, cleanRegex));
+    }
+    function parse3(version3, regex) {
+      const { groups } = (regex || validRegex).exec(version3) || {};
+      if (!groups) {
+        return null;
+      }
+      const parsed = {
+        epoch: Number(groups.epoch ? groups.epoch : 0),
+        release: groups.release.split(".").map(Number),
+        pre: normalize_letter_version(groups.pre_l, groups.pre_n),
+        post: normalize_letter_version(
+          groups.post_l,
+          groups.post_n1 || groups.post_n2
+        ),
+        dev: normalize_letter_version(groups.dev_l, groups.dev_n),
+        local: parse_local_version(groups.local)
+      };
+      return parsed;
+    }
+    function stringify2(parsed) {
+      if (!parsed) {
+        return null;
+      }
+      const { epoch, release, pre, post, dev, local } = parsed;
+      const parts = [];
+      if (epoch !== 0) {
+        parts.push(`${epoch}!`);
+      }
+      parts.push(release.join("."));
+      if (pre) {
+        parts.push(pre.join(""));
+      }
+      if (post) {
+        parts.push("." + post.join(""));
+      }
+      if (dev) {
+        parts.push("." + dev.join(""));
+      }
+      if (local) {
+        parts.push(`+${local}`);
+      }
+      return parts.join("");
+    }
+    function normalize_letter_version(letterIn, numberIn) {
+      let letter = letterIn;
+      let number = numberIn;
+      if (letter) {
+        if (!number) {
+          number = 0;
+        }
+        letter = letter.toLowerCase();
+        if (letter === "alpha") {
+          letter = "a";
+        } else if (letter === "beta") {
+          letter = "b";
+        } else if (["c", "pre", "preview"].includes(letter)) {
+          letter = "rc";
+        } else if (["rev", "r"].includes(letter)) {
+          letter = "post";
+        }
+        return [letter, Number(number)];
+      }
+      if (!letter && number) {
+        letter = "post";
+        return [letter, Number(number)];
+      }
+      return null;
+    }
+    function parse_local_version(local) {
+      if (local) {
+        return local.split(/[._-]/).map(
+          (part) => Number.isNaN(Number(part)) ? part.toLowerCase() : Number(part)
+        );
+      }
+      return null;
+    }
+    function explain(version3) {
+      const parsed = parse3(version3);
+      if (!parsed) {
+        return parsed;
+      }
+      const { epoch, release, pre, post, dev, local } = parsed;
+      let base_version = "";
+      if (epoch !== 0) {
+        base_version += epoch + "!";
+      }
+      base_version += release.join(".");
+      const is_prerelease = Boolean(dev || pre);
+      const is_devrelease = Boolean(dev);
+      const is_postrelease = Boolean(post);
+      return {
+        epoch,
+        release,
+        pre,
+        post: post ? post[1] : post,
+        dev: dev ? dev[1] : dev,
+        local: local ? local.join(".") : local,
+        public: stringify2(parsed).split("+", 1)[0],
+        base_version,
+        is_prerelease,
+        is_devrelease,
+        is_postrelease
+      };
+    }
+  }
+});
+
+// node_modules/@renovatebot/pep440/lib/operator.js
+var require_operator = __commonJS({
+  "node_modules/@renovatebot/pep440/lib/operator.js"(exports2, module2) {
+    var { parse: parse3 } = require_version();
+    module2.exports = {
+      compare,
+      rcompare,
+      lt,
+      le,
+      eq,
+      ne,
+      ge,
+      gt: gt2,
+      "<": lt,
+      "<=": le,
+      "==": eq,
+      "!=": ne,
+      ">=": ge,
+      ">": gt2,
+      "===": arbitrary
+    };
+    function lt(version3, other) {
+      return compare(version3, other) < 0;
+    }
+    function le(version3, other) {
+      return compare(version3, other) <= 0;
+    }
+    function eq(version3, other) {
+      return compare(version3, other) === 0;
+    }
+    function ne(version3, other) {
+      return compare(version3, other) !== 0;
+    }
+    function ge(version3, other) {
+      return compare(version3, other) >= 0;
+    }
+    function gt2(version3, other) {
+      return compare(version3, other) > 0;
+    }
+    function arbitrary(version3, other) {
+      return version3.toLowerCase() === other.toLowerCase();
+    }
+    function compare(version3, other) {
+      const parsedVersion = parse3(version3);
+      const parsedOther = parse3(other);
+      const keyVersion = calculateKey(parsedVersion);
+      const keyOther = calculateKey(parsedOther);
+      return pyCompare(keyVersion, keyOther);
+    }
+    function rcompare(version3, other) {
+      return -compare(version3, other);
+    }
+    function pyCompare(elemIn, otherIn) {
+      let elem = elemIn;
+      let other = otherIn;
+      if (elem === other) {
+        return 0;
+      }
+      if (Array.isArray(elem) !== Array.isArray(other)) {
+        elem = Array.isArray(elem) ? elem : [elem];
+        other = Array.isArray(other) ? other : [other];
+      }
+      if (Array.isArray(elem)) {
+        const len = Math.min(elem.length, other.length);
+        for (let i = 0; i < len; i += 1) {
+          const res = pyCompare(elem[i], other[i]);
+          if (res !== 0) {
+            return res;
+          }
+        }
+        return elem.length - other.length;
+      }
+      if (elem === -Infinity || other === Infinity) {
+        return -1;
+      }
+      if (elem === Infinity || other === -Infinity) {
+        return 1;
+      }
+      return elem < other ? -1 : 1;
+    }
+    function calculateKey(input) {
+      const { epoch } = input;
+      let { release, pre, post, local, dev } = input;
+      release = release.concat();
+      release.reverse();
+      while (release.length && release[0] === 0) {
+        release.shift();
+      }
+      release.reverse();
+      if (!pre && !post && dev) pre = -Infinity;
+      else if (!pre) pre = Infinity;
+      if (!post) post = -Infinity;
+      if (!dev) dev = Infinity;
+      if (!local) {
+        local = -Infinity;
+      } else {
+        local = local.map(
+          (i) => Number.isNaN(Number(i)) ? [-Infinity, i] : [Number(i), ""]
+        );
+      }
+      return [epoch, release, pre, post, dev, local];
+    }
+  }
+});
+
+// node_modules/@renovatebot/pep440/lib/specifier.js
+var require_specifier = __commonJS({
+  "node_modules/@renovatebot/pep440/lib/specifier.js"(exports2, module2) {
+    var { VERSION_PATTERN, explain: explainVersion } = require_version();
+    var Operator = require_operator();
+    var RANGE_PATTERN = [
+      "(?(===|~=|==|!=|<=|>=|<|>))",
+      "\\s*",
+      "(",
+      /*  */
+      "(?(?:" + VERSION_PATTERN.replace(/\?<\w+>/g, "?:") + "))",
+      /*  */
+      "(?\\.\\*)?",
+      /*  */
+      "|",
+      /*  */
+      "(?[^,;\\s)]+)",
+      ")"
+    ].join("");
+    module2.exports = {
+      RANGE_PATTERN,
+      parse: parse3,
+      satisfies: satisfies4,
+      filter,
+      validRange,
+      maxSatisfying: maxSatisfying3,
+      minSatisfying: minSatisfying4
+    };
+    var isEqualityOperator = (op) => ["==", "!=", "==="].includes(op);
+    var rangeRegex = new RegExp("^" + RANGE_PATTERN + "$", "i");
+    function parse3(ranges) {
+      if (!ranges.trim()) {
+        return [];
+      }
+      const specifiers = ranges.split(",").map((range2) => rangeRegex.exec(range2.trim()) || {}).map(({ groups }) => {
+        if (!groups) {
+          return null;
+        }
+        let { ...spec } = groups;
+        const { operator, version: version3, prefix: prefix2, legacy } = groups;
+        if (version3) {
+          spec = { ...spec, ...explainVersion(version3) };
+          if (operator === "~=") {
+            if (spec.release.length < 2) {
+              return null;
+            }
+          }
+          if (!isEqualityOperator(operator) && spec.local) {
+            return null;
+          }
+          if (prefix2) {
+            if (!isEqualityOperator(operator) || spec.dev || spec.local) {
+              return null;
+            }
+          }
+        }
+        if (legacy && operator !== "===") {
+          return null;
+        }
+        return spec;
+      });
+      if (specifiers.filter(Boolean).length !== specifiers.length) {
+        return null;
+      }
+      return specifiers;
+    }
+    function filter(versions, specifier, options = {}) {
+      const filtered = pick(versions, specifier, options);
+      if (filtered.length === 0 && options.prereleases === void 0) {
+        return pick(versions, specifier, { prereleases: true });
+      }
+      return filtered;
+    }
+    function maxSatisfying3(versions, range2, options) {
+      const found = filter(versions, range2, options).sort(Operator.compare);
+      return found.length === 0 ? null : found[found.length - 1];
+    }
+    function minSatisfying4(versions, range2, options) {
+      const found = filter(versions, range2, options).sort(Operator.compare);
+      return found.length === 0 ? null : found[0];
+    }
+    function pick(versions, specifier, options) {
+      const parsed = parse3(specifier);
+      if (!parsed) {
+        return [];
+      }
+      return versions.filter((version3) => {
+        const explained = explainVersion(version3);
+        if (!parsed.length) {
+          return explained && !(explained.is_prerelease && !options.prereleases);
+        }
+        return parsed.reduce((pass, spec) => {
+          if (!pass) {
+            return false;
+          }
+          return contains({ ...spec, ...options }, { version: version3, explained });
+        }, true);
+      });
+    }
+    function satisfies4(version3, specifier, options = {}) {
+      const filtered = pick([version3], specifier, options);
+      return filtered.length === 1;
+    }
+    function arrayStartsWith(array, prefix2) {
+      if (prefix2.length > array.length) {
+        return false;
+      }
+      for (let i = 0; i < prefix2.length; i += 1) {
+        if (prefix2[i] !== array[i]) {
+          return false;
+        }
+      }
+      return true;
+    }
+    function contains(specifier, input) {
+      const { explained } = input;
+      let { version: version3 } = input;
+      const { ...spec } = specifier;
+      if (spec.prereleases === void 0) {
+        spec.prereleases = spec.is_prerelease;
+      }
+      if (explained && explained.is_prerelease && !spec.prereleases) {
+        return false;
+      }
+      if (spec.operator === "~=") {
+        let compatiblePrefix = spec.release.slice(0, -1).concat("*").join(".");
+        if (spec.epoch) {
+          compatiblePrefix = spec.epoch + "!" + compatiblePrefix;
+        }
+        return satisfies4(version3, `>=${spec.version}, ==${compatiblePrefix}`, {
+          prereleases: spec.prereleases
+        });
+      }
+      if (spec.prefix) {
+        const isMatching = explained.epoch === spec.epoch && arrayStartsWith(explained.release, spec.release);
+        const isEquality = spec.operator !== "!=";
+        return isEquality ? isMatching : !isMatching;
+      }
+      if (explained) {
+        if (explained.local && spec.version) {
+          version3 = explained.public;
+          spec.version = explainVersion(spec.version).public;
+        }
+      }
+      if (spec.operator === "<" || spec.operator === ">") {
+        if (Operator.eq(spec.release.join("."), explained.release.join("."))) {
+          return false;
+        }
+      }
+      const op = Operator[spec.operator];
+      return op(version3, spec.version || spec.legacy);
+    }
+    function validRange(specifier) {
+      return Boolean(parse3(specifier));
+    }
+  }
+});
+
+// node_modules/@renovatebot/pep440/lib/semantic.js
+var require_semantic = __commonJS({
+  "node_modules/@renovatebot/pep440/lib/semantic.js"(exports2, module2) {
+    var { explain, parse: parse3, stringify: stringify2 } = require_version();
+    module2.exports = {
+      major,
+      minor,
+      patch,
+      inc
+    };
+    function major(input) {
+      const version3 = explain(input);
+      if (!version3) {
+        throw new TypeError("Invalid Version: " + input);
+      }
+      return version3.release[0];
+    }
+    function minor(input) {
+      const version3 = explain(input);
+      if (!version3) {
+        throw new TypeError("Invalid Version: " + input);
+      }
+      if (version3.release.length < 2) {
+        return 0;
+      }
+      return version3.release[1];
+    }
+    function patch(input) {
+      const version3 = explain(input);
+      if (!version3) {
+        throw new TypeError("Invalid Version: " + input);
+      }
+      if (version3.release.length < 3) {
+        return 0;
+      }
+      return version3.release[2];
+    }
+    function inc(input, release, preReleaseIdentifier) {
+      let identifier = preReleaseIdentifier || `a`;
+      const version3 = parse3(input);
+      if (!version3) {
+        return null;
+      }
+      if (!["a", "b", "c", "rc", "alpha", "beta", "pre", "preview"].includes(
+        identifier
+      )) {
+        return null;
+      }
+      switch (release) {
+        case "premajor":
+          {
+            const [majorVersion] = version3.release;
+            version3.release.fill(0);
+            version3.release[0] = majorVersion + 1;
+          }
+          version3.pre = [identifier, 0];
+          delete version3.post;
+          delete version3.dev;
+          delete version3.local;
+          break;
+        case "preminor":
+          {
+            const [majorVersion, minorVersion = 0] = version3.release;
+            version3.release.fill(0);
+            version3.release[0] = majorVersion;
+            version3.release[1] = minorVersion + 1;
+          }
+          version3.pre = [identifier, 0];
+          delete version3.post;
+          delete version3.dev;
+          delete version3.local;
+          break;
+        case "prepatch":
+          {
+            const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release;
+            version3.release.fill(0);
+            version3.release[0] = majorVersion;
+            version3.release[1] = minorVersion;
+            version3.release[2] = patchVersion + 1;
+          }
+          version3.pre = [identifier, 0];
+          delete version3.post;
+          delete version3.dev;
+          delete version3.local;
+          break;
+        case "prerelease":
+          if (version3.pre === null) {
+            const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release;
+            version3.release.fill(0);
+            version3.release[0] = majorVersion;
+            version3.release[1] = minorVersion;
+            version3.release[2] = patchVersion + 1;
+            version3.pre = [identifier, 0];
+          } else {
+            if (preReleaseIdentifier === void 0 && version3.pre !== null) {
+              [identifier] = version3.pre;
+            }
+            const [letter, number] = version3.pre;
+            if (letter === identifier) {
+              version3.pre = [letter, number + 1];
+            } else {
+              version3.pre = [identifier, 0];
+            }
+          }
+          delete version3.post;
+          delete version3.dev;
+          delete version3.local;
+          break;
+        case "major":
+          if (version3.release.slice(1).some((value) => value !== 0) || version3.pre === null) {
+            const [majorVersion] = version3.release;
+            version3.release.fill(0);
+            version3.release[0] = majorVersion + 1;
+          }
+          delete version3.pre;
+          delete version3.post;
+          delete version3.dev;
+          delete version3.local;
+          break;
+        case "minor":
+          if (version3.release.slice(2).some((value) => value !== 0) || version3.pre === null) {
+            const [majorVersion, minorVersion = 0] = version3.release;
+            version3.release.fill(0);
+            version3.release[0] = majorVersion;
+            version3.release[1] = minorVersion + 1;
+          }
+          delete version3.pre;
+          delete version3.post;
+          delete version3.dev;
+          delete version3.local;
+          break;
+        case "patch":
+          if (version3.release.slice(3).some((value) => value !== 0) || version3.pre === null) {
+            const [majorVersion, minorVersion = 0, patchVersion = 0] = version3.release;
+            version3.release.fill(0);
+            version3.release[0] = majorVersion;
+            version3.release[1] = minorVersion;
+            version3.release[2] = patchVersion + 1;
+          }
+          delete version3.pre;
+          delete version3.post;
+          delete version3.dev;
+          delete version3.local;
+          break;
+        default:
+          return null;
+      }
+      return stringify2(version3);
+    }
+  }
+});
+
+// node_modules/@renovatebot/pep440/index.js
+var require_pep440 = __commonJS({
+  "node_modules/@renovatebot/pep440/index.js"(exports2, module2) {
+    var { valid: valid2, clean: clean3, explain, parse: parse3 } = require_version();
+    var { lt, le, eq, ne, ge, gt: gt2, compare, rcompare } = require_operator();
+    var {
+      filter,
+      maxSatisfying: maxSatisfying3,
+      minSatisfying: minSatisfying4,
+      RANGE_PATTERN,
+      satisfies: satisfies4,
+      validRange
+    } = require_specifier();
+    var { major, minor, patch, inc } = require_semantic();
+    module2.exports = {
+      // version
+      valid: valid2,
+      clean: clean3,
+      explain,
+      parse: parse3,
+      // operator
+      lt,
+      le,
+      lte: le,
+      eq,
+      ne,
+      neq: ne,
+      ge,
+      gte: ge,
+      gt: gt2,
+      compare,
+      rcompare,
+      // range
+      filter,
+      maxSatisfying: maxSatisfying3,
+      minSatisfying: minSatisfying4,
+      RANGE_PATTERN,
+      satisfies: satisfies4,
+      validRange,
+      // semantic
+      major,
+      minor,
+      patch,
+      inc
+    };
+  }
+});
+
+// node_modules/semver/semver.js
+var require_semver5 = __commonJS({
+  "node_modules/semver/semver.js"(exports2, module2) {
+    exports2 = module2.exports = SemVer;
+    var debug2;
+    if (typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
+      debug2 = function() {
+        var args = Array.prototype.slice.call(arguments, 0);
+        args.unshift("SEMVER");
+        console.log.apply(console, args);
+      };
+    } else {
+      debug2 = function() {
+      };
+    }
+    exports2.SEMVER_SPEC_VERSION = "2.0.0";
+    var MAX_LENGTH = 256;
+    var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
+    9007199254740991;
+    var MAX_SAFE_COMPONENT_LENGTH = 16;
+    var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
+    var re = exports2.re = [];
+    var safeRe = exports2.safeRe = [];
+    var src = exports2.src = [];
+    var t = exports2.tokens = {};
+    var R = 0;
+    function tok(n) {
+      t[n] = R++;
+    }
+    var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
+    var safeRegexReplacements = [
+      ["\\s", 1],
+      ["\\d", MAX_LENGTH],
+      [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
+    ];
+    function makeSafeRe(value) {
+      for (var i2 = 0; i2 < safeRegexReplacements.length; i2++) {
+        var token = safeRegexReplacements[i2][0];
+        var max = safeRegexReplacements[i2][1];
+        value = value.split(token + "*").join(token + "{0," + max + "}").split(token + "+").join(token + "{1," + max + "}");
+      }
+      return value;
+    }
+    tok("NUMERICIDENTIFIER");
+    src[t.NUMERICIDENTIFIER] = "0|[1-9]\\d*";
+    tok("NUMERICIDENTIFIERLOOSE");
+    src[t.NUMERICIDENTIFIERLOOSE] = "\\d+";
+    tok("NONNUMERICIDENTIFIER");
+    src[t.NONNUMERICIDENTIFIER] = "\\d*[a-zA-Z-]" + LETTERDASHNUMBER + "*";
+    tok("MAINVERSION");
+    src[t.MAINVERSION] = "(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")\\.(" + src[t.NUMERICIDENTIFIER] + ")";
+    tok("MAINVERSIONLOOSE");
+    src[t.MAINVERSIONLOOSE] = "(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")\\.(" + src[t.NUMERICIDENTIFIERLOOSE] + ")";
+    tok("PRERELEASEIDENTIFIER");
+    src[t.PRERELEASEIDENTIFIER] = "(?:" + src[t.NUMERICIDENTIFIER] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
+    tok("PRERELEASEIDENTIFIERLOOSE");
+    src[t.PRERELEASEIDENTIFIERLOOSE] = "(?:" + src[t.NUMERICIDENTIFIERLOOSE] + "|" + src[t.NONNUMERICIDENTIFIER] + ")";
+    tok("PRERELEASE");
+    src[t.PRERELEASE] = "(?:-(" + src[t.PRERELEASEIDENTIFIER] + "(?:\\." + src[t.PRERELEASEIDENTIFIER] + ")*))";
+    tok("PRERELEASELOOSE");
+    src[t.PRERELEASELOOSE] = "(?:-?(" + src[t.PRERELEASEIDENTIFIERLOOSE] + "(?:\\." + src[t.PRERELEASEIDENTIFIERLOOSE] + ")*))";
+    tok("BUILDIDENTIFIER");
+    src[t.BUILDIDENTIFIER] = LETTERDASHNUMBER + "+";
+    tok("BUILD");
+    src[t.BUILD] = "(?:\\+(" + src[t.BUILDIDENTIFIER] + "(?:\\." + src[t.BUILDIDENTIFIER] + ")*))";
+    tok("FULL");
+    tok("FULLPLAIN");
+    src[t.FULLPLAIN] = "v?" + src[t.MAINVERSION] + src[t.PRERELEASE] + "?" + src[t.BUILD] + "?";
+    src[t.FULL] = "^" + src[t.FULLPLAIN] + "$";
+    tok("LOOSEPLAIN");
+    src[t.LOOSEPLAIN] = "[v=\\s]*" + src[t.MAINVERSIONLOOSE] + src[t.PRERELEASELOOSE] + "?" + src[t.BUILD] + "?";
+    tok("LOOSE");
+    src[t.LOOSE] = "^" + src[t.LOOSEPLAIN] + "$";
+    tok("GTLT");
+    src[t.GTLT] = "((?:<|>)?=?)";
+    tok("XRANGEIDENTIFIERLOOSE");
+    src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + "|x|X|\\*";
+    tok("XRANGEIDENTIFIER");
+    src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + "|x|X|\\*";
+    tok("XRANGEPLAIN");
+    src[t.XRANGEPLAIN] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:\\.(" + src[t.XRANGEIDENTIFIER] + ")(?:" + src[t.PRERELEASE] + ")?" + src[t.BUILD] + "?)?)?";
+    tok("XRANGEPLAINLOOSE");
+    src[t.XRANGEPLAINLOOSE] = "[v=\\s]*(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:\\.(" + src[t.XRANGEIDENTIFIERLOOSE] + ")(?:" + src[t.PRERELEASELOOSE] + ")?" + src[t.BUILD] + "?)?)?";
+    tok("XRANGE");
+    src[t.XRANGE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAIN] + "$";
+    tok("XRANGELOOSE");
+    src[t.XRANGELOOSE] = "^" + src[t.GTLT] + "\\s*" + src[t.XRANGEPLAINLOOSE] + "$";
+    tok("COERCE");
+    src[t.COERCE] = "(^|[^\\d])(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "})(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:\\.(\\d{1," + MAX_SAFE_COMPONENT_LENGTH + "}))?(?:$|[^\\d])";
+    tok("COERCERTL");
+    re[t.COERCERTL] = new RegExp(src[t.COERCE], "g");
+    safeRe[t.COERCERTL] = new RegExp(makeSafeRe(src[t.COERCE]), "g");
+    tok("LONETILDE");
+    src[t.LONETILDE] = "(?:~>?)";
+    tok("TILDETRIM");
+    src[t.TILDETRIM] = "(\\s*)" + src[t.LONETILDE] + "\\s+";
+    re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], "g");
+    safeRe[t.TILDETRIM] = new RegExp(makeSafeRe(src[t.TILDETRIM]), "g");
+    var tildeTrimReplace = "$1~";
+    tok("TILDE");
+    src[t.TILDE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAIN] + "$";
+    tok("TILDELOOSE");
+    src[t.TILDELOOSE] = "^" + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + "$";
+    tok("LONECARET");
+    src[t.LONECARET] = "(?:\\^)";
+    tok("CARETTRIM");
+    src[t.CARETTRIM] = "(\\s*)" + src[t.LONECARET] + "\\s+";
+    re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], "g");
+    safeRe[t.CARETTRIM] = new RegExp(makeSafeRe(src[t.CARETTRIM]), "g");
+    var caretTrimReplace = "$1^";
+    tok("CARET");
+    src[t.CARET] = "^" + src[t.LONECARET] + src[t.XRANGEPLAIN] + "$";
+    tok("CARETLOOSE");
+    src[t.CARETLOOSE] = "^" + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + "$";
+    tok("COMPARATORLOOSE");
+    src[t.COMPARATORLOOSE] = "^" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + ")$|^$";
+    tok("COMPARATOR");
+    src[t.COMPARATOR] = "^" + src[t.GTLT] + "\\s*(" + src[t.FULLPLAIN] + ")$|^$";
+    tok("COMPARATORTRIM");
+    src[t.COMPARATORTRIM] = "(\\s*)" + src[t.GTLT] + "\\s*(" + src[t.LOOSEPLAIN] + "|" + src[t.XRANGEPLAIN] + ")";
+    re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], "g");
+    safeRe[t.COMPARATORTRIM] = new RegExp(makeSafeRe(src[t.COMPARATORTRIM]), "g");
+    var comparatorTrimReplace = "$1$2$3";
+    tok("HYPHENRANGE");
+    src[t.HYPHENRANGE] = "^\\s*(" + src[t.XRANGEPLAIN] + ")\\s+-\\s+(" + src[t.XRANGEPLAIN] + ")\\s*$";
+    tok("HYPHENRANGELOOSE");
+    src[t.HYPHENRANGELOOSE] = "^\\s*(" + src[t.XRANGEPLAINLOOSE] + ")\\s+-\\s+(" + src[t.XRANGEPLAINLOOSE] + ")\\s*$";
+    tok("STAR");
+    src[t.STAR] = "(<|>)?=?\\s*\\*";
+    for (i = 0; i < R; i++) {
+      debug2(i, src[i]);
+      if (!re[i]) {
+        re[i] = new RegExp(src[i]);
+        safeRe[i] = new RegExp(makeSafeRe(src[i]));
+      }
+    }
+    var i;
+    exports2.parse = parse3;
+    function parse3(version3, options) {
+      if (!options || typeof options !== "object") {
+        options = {
+          loose: !!options,
+          includePrerelease: false
+        };
+      }
+      if (version3 instanceof SemVer) {
+        return version3;
+      }
+      if (typeof version3 !== "string") {
+        return null;
+      }
+      if (version3.length > MAX_LENGTH) {
+        return null;
+      }
+      var r = options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL];
+      if (!r.test(version3)) {
+        return null;
+      }
+      try {
+        return new SemVer(version3, options);
+      } catch (er) {
+        return null;
+      }
+    }
+    exports2.valid = valid2;
+    function valid2(version3, options) {
+      var v = parse3(version3, options);
+      return v ? v.version : null;
+    }
+    exports2.clean = clean3;
+    function clean3(version3, options) {
+      var s = parse3(version3.trim().replace(/^[=v]+/, ""), options);
+      return s ? s.version : null;
+    }
+    exports2.SemVer = SemVer;
+    function SemVer(version3, options) {
+      if (!options || typeof options !== "object") {
+        options = {
+          loose: !!options,
+          includePrerelease: false
+        };
+      }
+      if (version3 instanceof SemVer) {
+        if (version3.loose === options.loose) {
+          return version3;
+        } else {
+          version3 = version3.version;
+        }
+      } else if (typeof version3 !== "string") {
+        throw new TypeError("Invalid Version: " + version3);
+      }
+      if (version3.length > MAX_LENGTH) {
+        throw new TypeError("version is longer than " + MAX_LENGTH + " characters");
+      }
+      if (!(this instanceof SemVer)) {
+        return new SemVer(version3, options);
+      }
+      debug2("SemVer", version3, options);
+      this.options = options;
+      this.loose = !!options.loose;
+      var m = version3.trim().match(options.loose ? safeRe[t.LOOSE] : safeRe[t.FULL]);
+      if (!m) {
+        throw new TypeError("Invalid Version: " + version3);
+      }
+      this.raw = version3;
+      this.major = +m[1];
+      this.minor = +m[2];
+      this.patch = +m[3];
+      if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
+        throw new TypeError("Invalid major version");
+      }
+      if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
+        throw new TypeError("Invalid minor version");
+      }
+      if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
+        throw new TypeError("Invalid patch version");
+      }
+      if (!m[4]) {
+        this.prerelease = [];
+      } else {
+        this.prerelease = m[4].split(".").map(function(id) {
+          if (/^[0-9]+$/.test(id)) {
+            var num = +id;
+            if (num >= 0 && num < MAX_SAFE_INTEGER) {
+              return num;
+            }
+          }
+          return id;
+        });
+      }
+      this.build = m[5] ? m[5].split(".") : [];
+      this.format();
+    }
+    SemVer.prototype.format = function() {
+      this.version = this.major + "." + this.minor + "." + this.patch;
+      if (this.prerelease.length) {
+        this.version += "-" + this.prerelease.join(".");
+      }
+      return this.version;
+    };
+    SemVer.prototype.toString = function() {
+      return this.version;
+    };
+    SemVer.prototype.compare = function(other) {
+      debug2("SemVer.compare", this.version, this.options, other);
+      if (!(other instanceof SemVer)) {
+        other = new SemVer(other, this.options);
+      }
+      return this.compareMain(other) || this.comparePre(other);
+    };
+    SemVer.prototype.compareMain = function(other) {
+      if (!(other instanceof SemVer)) {
+        other = new SemVer(other, this.options);
+      }
+      return compareIdentifiers(this.major, other.major) || compareIdentifiers(this.minor, other.minor) || compareIdentifiers(this.patch, other.patch);
+    };
+    SemVer.prototype.comparePre = function(other) {
+      if (!(other instanceof SemVer)) {
+        other = new SemVer(other, this.options);
+      }
+      if (this.prerelease.length && !other.prerelease.length) {
+        return -1;
+      } else if (!this.prerelease.length && other.prerelease.length) {
+        return 1;
+      } else if (!this.prerelease.length && !other.prerelease.length) {
+        return 0;
+      }
+      var i2 = 0;
+      do {
+        var a = this.prerelease[i2];
+        var b = other.prerelease[i2];
+        debug2("prerelease compare", i2, a, b);
+        if (a === void 0 && b === void 0) {
+          return 0;
+        } else if (b === void 0) {
+          return 1;
+        } else if (a === void 0) {
+          return -1;
+        } else if (a === b) {
+          continue;
+        } else {
+          return compareIdentifiers(a, b);
+        }
+      } while (++i2);
+    };
+    SemVer.prototype.compareBuild = function(other) {
+      if (!(other instanceof SemVer)) {
+        other = new SemVer(other, this.options);
+      }
+      var i2 = 0;
+      do {
+        var a = this.build[i2];
+        var b = other.build[i2];
+        debug2("prerelease compare", i2, a, b);
+        if (a === void 0 && b === void 0) {
+          return 0;
+        } else if (b === void 0) {
+          return 1;
+        } else if (a === void 0) {
+          return -1;
+        } else if (a === b) {
+          continue;
+        } else {
+          return compareIdentifiers(a, b);
+        }
+      } while (++i2);
+    };
+    SemVer.prototype.inc = function(release, identifier) {
+      switch (release) {
+        case "premajor":
+          this.prerelease.length = 0;
+          this.patch = 0;
+          this.minor = 0;
+          this.major++;
+          this.inc("pre", identifier);
+          break;
+        case "preminor":
+          this.prerelease.length = 0;
+          this.patch = 0;
+          this.minor++;
+          this.inc("pre", identifier);
+          break;
+        case "prepatch":
+          this.prerelease.length = 0;
+          this.inc("patch", identifier);
+          this.inc("pre", identifier);
+          break;
+        // If the input is a non-prerelease version, this acts the same as
+        // prepatch.
+        case "prerelease":
+          if (this.prerelease.length === 0) {
+            this.inc("patch", identifier);
+          }
+          this.inc("pre", identifier);
+          break;
+        case "major":
+          if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
+            this.major++;
+          }
+          this.minor = 0;
+          this.patch = 0;
+          this.prerelease = [];
+          break;
+        case "minor":
+          if (this.patch !== 0 || this.prerelease.length === 0) {
+            this.minor++;
+          }
+          this.patch = 0;
+          this.prerelease = [];
+          break;
+        case "patch":
+          if (this.prerelease.length === 0) {
+            this.patch++;
+          }
+          this.prerelease = [];
+          break;
+        // This probably shouldn't be used publicly.
+        // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
+        case "pre":
+          if (this.prerelease.length === 0) {
+            this.prerelease = [0];
+          } else {
+            var i2 = this.prerelease.length;
+            while (--i2 >= 0) {
+              if (typeof this.prerelease[i2] === "number") {
+                this.prerelease[i2]++;
+                i2 = -2;
+              }
+            }
+            if (i2 === -1) {
+              this.prerelease.push(0);
+            }
+          }
+          if (identifier) {
+            if (this.prerelease[0] === identifier) {
+              if (isNaN(this.prerelease[1])) {
+                this.prerelease = [identifier, 0];
+              }
+            } else {
+              this.prerelease = [identifier, 0];
+            }
+          }
+          break;
+        default:
+          throw new Error("invalid increment argument: " + release);
+      }
+      this.format();
+      this.raw = this.version;
+      return this;
+    };
+    exports2.inc = inc;
+    function inc(version3, release, loose, identifier) {
+      if (typeof loose === "string") {
+        identifier = loose;
+        loose = void 0;
+      }
+      try {
+        return new SemVer(version3, loose).inc(release, identifier).version;
+      } catch (er) {
+        return null;
+      }
+    }
+    exports2.diff = diff;
+    function diff(version1, version22) {
+      if (eq(version1, version22)) {
+        return null;
+      } else {
+        var v1 = parse3(version1);
+        var v2 = parse3(version22);
+        var prefix2 = "";
+        if (v1.prerelease.length || v2.prerelease.length) {
+          prefix2 = "pre";
+          var defaultResult = "prerelease";
+        }
+        for (var key in v1) {
+          if (key === "major" || key === "minor" || key === "patch") {
+            if (v1[key] !== v2[key]) {
+              return prefix2 + key;
+            }
+          }
+        }
+        return defaultResult;
+      }
+    }
+    exports2.compareIdentifiers = compareIdentifiers;
+    var numeric = /^[0-9]+$/;
+    function compareIdentifiers(a, b) {
+      var anum = numeric.test(a);
+      var bnum = numeric.test(b);
+      if (anum && bnum) {
+        a = +a;
+        b = +b;
+      }
+      return a === b ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a < b ? -1 : 1;
+    }
+    exports2.rcompareIdentifiers = rcompareIdentifiers;
+    function rcompareIdentifiers(a, b) {
+      return compareIdentifiers(b, a);
+    }
+    exports2.major = major;
+    function major(a, loose) {
+      return new SemVer(a, loose).major;
+    }
+    exports2.minor = minor;
+    function minor(a, loose) {
+      return new SemVer(a, loose).minor;
+    }
+    exports2.patch = patch;
+    function patch(a, loose) {
+      return new SemVer(a, loose).patch;
+    }
+    exports2.compare = compare;
+    function compare(a, b, loose) {
+      return new SemVer(a, loose).compare(new SemVer(b, loose));
+    }
+    exports2.compareLoose = compareLoose;
+    function compareLoose(a, b) {
+      return compare(a, b, true);
+    }
+    exports2.compareBuild = compareBuild;
+    function compareBuild(a, b, loose) {
+      var versionA = new SemVer(a, loose);
+      var versionB = new SemVer(b, loose);
+      return versionA.compare(versionB) || versionA.compareBuild(versionB);
+    }
+    exports2.rcompare = rcompare;
+    function rcompare(a, b, loose) {
+      return compare(b, a, loose);
+    }
+    exports2.sort = sort;
+    function sort(list, loose) {
+      return list.sort(function(a, b) {
+        return exports2.compareBuild(a, b, loose);
+      });
+    }
+    exports2.rsort = rsort;
+    function rsort(list, loose) {
+      return list.sort(function(a, b) {
+        return exports2.compareBuild(b, a, loose);
+      });
+    }
+    exports2.gt = gt2;
+    function gt2(a, b, loose) {
+      return compare(a, b, loose) > 0;
+    }
+    exports2.lt = lt;
+    function lt(a, b, loose) {
+      return compare(a, b, loose) < 0;
+    }
+    exports2.eq = eq;
+    function eq(a, b, loose) {
+      return compare(a, b, loose) === 0;
+    }
+    exports2.neq = neq;
+    function neq(a, b, loose) {
+      return compare(a, b, loose) !== 0;
+    }
+    exports2.gte = gte;
+    function gte(a, b, loose) {
+      return compare(a, b, loose) >= 0;
+    }
+    exports2.lte = lte;
+    function lte(a, b, loose) {
+      return compare(a, b, loose) <= 0;
+    }
+    exports2.cmp = cmp;
+    function cmp(a, op, b, loose) {
+      switch (op) {
+        case "===":
+          if (typeof a === "object")
+            a = a.version;
+          if (typeof b === "object")
+            b = b.version;
+          return a === b;
+        case "!==":
+          if (typeof a === "object")
+            a = a.version;
+          if (typeof b === "object")
+            b = b.version;
+          return a !== b;
+        case "":
+        case "=":
+        case "==":
+          return eq(a, b, loose);
+        case "!=":
+          return neq(a, b, loose);
+        case ">":
+          return gt2(a, b, loose);
+        case ">=":
+          return gte(a, b, loose);
+        case "<":
+          return lt(a, b, loose);
+        case "<=":
+          return lte(a, b, loose);
+        default:
+          throw new TypeError("Invalid operator: " + op);
+      }
+    }
+    exports2.Comparator = Comparator;
+    function Comparator(comp26, options) {
+      if (!options || typeof options !== "object") {
+        options = {
+          loose: !!options,
+          includePrerelease: false
+        };
+      }
+      if (comp26 instanceof Comparator) {
+        if (comp26.loose === !!options.loose) {
+          return comp26;
+        } else {
+          comp26 = comp26.value;
+        }
+      }
+      if (!(this instanceof Comparator)) {
+        return new Comparator(comp26, options);
+      }
+      comp26 = comp26.trim().split(/\s+/).join(" ");
+      debug2("comparator", comp26, options);
+      this.options = options;
+      this.loose = !!options.loose;
+      this.parse(comp26);
+      if (this.semver === ANY) {
+        this.value = "";
+      } else {
+        this.value = this.operator + this.semver.version;
+      }
+      debug2("comp", this);
+    }
+    var ANY = {};
+    Comparator.prototype.parse = function(comp26) {
+      var r = this.options.loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
+      var m = comp26.match(r);
+      if (!m) {
+        throw new TypeError("Invalid comparator: " + comp26);
+      }
+      this.operator = m[1] !== void 0 ? m[1] : "";
+      if (this.operator === "=") {
+        this.operator = "";
+      }
+      if (!m[2]) {
+        this.semver = ANY;
+      } else {
+        this.semver = new SemVer(m[2], this.options.loose);
+      }
+    };
+    Comparator.prototype.toString = function() {
+      return this.value;
+    };
+    Comparator.prototype.test = function(version3) {
+      debug2("Comparator.test", version3, this.options.loose);
+      if (this.semver === ANY || version3 === ANY) {
+        return true;
+      }
+      if (typeof version3 === "string") {
+        try {
+          version3 = new SemVer(version3, this.options);
+        } catch (er) {
+          return false;
+        }
+      }
+      return cmp(version3, this.operator, this.semver, this.options);
+    };
+    Comparator.prototype.intersects = function(comp26, options) {
+      if (!(comp26 instanceof Comparator)) {
+        throw new TypeError("a Comparator is required");
+      }
+      if (!options || typeof options !== "object") {
+        options = {
+          loose: !!options,
+          includePrerelease: false
+        };
+      }
+      var rangeTmp;
+      if (this.operator === "") {
+        if (this.value === "") {
+          return true;
+        }
+        rangeTmp = new Range(comp26.value, options);
+        return satisfies4(this.value, rangeTmp, options);
+      } else if (comp26.operator === "") {
+        if (comp26.value === "") {
+          return true;
+        }
+        rangeTmp = new Range(this.value, options);
+        return satisfies4(comp26.semver, rangeTmp, options);
+      }
+      var sameDirectionIncreasing = (this.operator === ">=" || this.operator === ">") && (comp26.operator === ">=" || comp26.operator === ">");
+      var sameDirectionDecreasing = (this.operator === "<=" || this.operator === "<") && (comp26.operator === "<=" || comp26.operator === "<");
+      var sameSemVer = this.semver.version === comp26.semver.version;
+      var differentDirectionsInclusive = (this.operator === ">=" || this.operator === "<=") && (comp26.operator === ">=" || comp26.operator === "<=");
+      var oppositeDirectionsLessThan = cmp(this.semver, "<", comp26.semver, options) && ((this.operator === ">=" || this.operator === ">") && (comp26.operator === "<=" || comp26.operator === "<"));
+      var oppositeDirectionsGreaterThan = cmp(this.semver, ">", comp26.semver, options) && ((this.operator === "<=" || this.operator === "<") && (comp26.operator === ">=" || comp26.operator === ">"));
+      return sameDirectionIncreasing || sameDirectionDecreasing || sameSemVer && differentDirectionsInclusive || oppositeDirectionsLessThan || oppositeDirectionsGreaterThan;
+    };
+    exports2.Range = Range;
+    function Range(range2, options) {
+      if (!options || typeof options !== "object") {
+        options = {
+          loose: !!options,
+          includePrerelease: false
+        };
+      }
+      if (range2 instanceof Range) {
+        if (range2.loose === !!options.loose && range2.includePrerelease === !!options.includePrerelease) {
+          return range2;
+        } else {
+          return new Range(range2.raw, options);
+        }
+      }
+      if (range2 instanceof Comparator) {
+        return new Range(range2.value, options);
+      }
+      if (!(this instanceof Range)) {
+        return new Range(range2, options);
+      }
+      this.options = options;
+      this.loose = !!options.loose;
+      this.includePrerelease = !!options.includePrerelease;
+      this.raw = range2.trim().split(/\s+/).join(" ");
+      this.set = this.raw.split("||").map(function(range3) {
+        return this.parseRange(range3.trim());
+      }, this).filter(function(c) {
+        return c.length;
+      });
+      if (!this.set.length) {
+        throw new TypeError("Invalid SemVer Range: " + this.raw);
+      }
+      this.format();
+    }
+    Range.prototype.format = function() {
+      this.range = this.set.map(function(comps) {
+        return comps.join(" ").trim();
+      }).join("||").trim();
+      return this.range;
+    };
+    Range.prototype.toString = function() {
+      return this.range;
+    };
+    Range.prototype.parseRange = function(range2) {
+      var loose = this.options.loose;
+      var hr = loose ? safeRe[t.HYPHENRANGELOOSE] : safeRe[t.HYPHENRANGE];
+      range2 = range2.replace(hr, hyphenReplace);
+      debug2("hyphen replace", range2);
+      range2 = range2.replace(safeRe[t.COMPARATORTRIM], comparatorTrimReplace);
+      debug2("comparator trim", range2, safeRe[t.COMPARATORTRIM]);
+      range2 = range2.replace(safeRe[t.TILDETRIM], tildeTrimReplace);
+      range2 = range2.replace(safeRe[t.CARETTRIM], caretTrimReplace);
+      range2 = range2.split(/\s+/).join(" ");
+      var compRe = loose ? safeRe[t.COMPARATORLOOSE] : safeRe[t.COMPARATOR];
+      var set = range2.split(" ").map(function(comp26) {
+        return parseComparator(comp26, this.options);
+      }, this).join(" ").split(/\s+/);
+      if (this.options.loose) {
+        set = set.filter(function(comp26) {
+          return !!comp26.match(compRe);
+        });
+      }
+      set = set.map(function(comp26) {
+        return new Comparator(comp26, this.options);
+      }, this);
+      return set;
+    };
+    Range.prototype.intersects = function(range2, options) {
+      if (!(range2 instanceof Range)) {
+        throw new TypeError("a Range is required");
+      }
+      return this.set.some(function(thisComparators) {
+        return isSatisfiable(thisComparators, options) && range2.set.some(function(rangeComparators) {
+          return isSatisfiable(rangeComparators, options) && thisComparators.every(function(thisComparator) {
+            return rangeComparators.every(function(rangeComparator) {
+              return thisComparator.intersects(rangeComparator, options);
+            });
+          });
+        });
+      });
+    };
+    function isSatisfiable(comparators, options) {
+      var result = true;
+      var remainingComparators = comparators.slice();
+      var testComparator = remainingComparators.pop();
+      while (result && remainingComparators.length) {
+        result = remainingComparators.every(function(otherComparator) {
+          return testComparator.intersects(otherComparator, options);
+        });
+        testComparator = remainingComparators.pop();
+      }
+      return result;
+    }
+    exports2.toComparators = toComparators;
+    function toComparators(range2, options) {
+      return new Range(range2, options).set.map(function(comp26) {
+        return comp26.map(function(c) {
+          return c.value;
+        }).join(" ").trim().split(" ");
+      });
+    }
+    function parseComparator(comp26, options) {
+      debug2("comp", comp26, options);
+      comp26 = replaceCarets(comp26, options);
+      debug2("caret", comp26);
+      comp26 = replaceTildes(comp26, options);
+      debug2("tildes", comp26);
+      comp26 = replaceXRanges(comp26, options);
+      debug2("xrange", comp26);
+      comp26 = replaceStars(comp26, options);
+      debug2("stars", comp26);
+      return comp26;
+    }
+    function isX(id) {
+      return !id || id.toLowerCase() === "x" || id === "*";
+    }
+    function replaceTildes(comp26, options) {
+      return comp26.trim().split(/\s+/).map(function(comp27) {
+        return replaceTilde(comp27, options);
+      }).join(" ");
+    }
+    function replaceTilde(comp26, options) {
+      var r = options.loose ? safeRe[t.TILDELOOSE] : safeRe[t.TILDE];
+      return comp26.replace(r, function(_, M, m, p, pr) {
+        debug2("tilde", comp26, _, M, m, p, pr);
+        var ret;
+        if (isX(M)) {
+          ret = "";
+        } else if (isX(m)) {
+          ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
+        } else if (isX(p)) {
+          ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
+        } else if (pr) {
+          debug2("replaceTilde pr", pr);
+          ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
+        } else {
+          ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
+        }
+        debug2("tilde return", ret);
+        return ret;
+      });
+    }
+    function replaceCarets(comp26, options) {
+      return comp26.trim().split(/\s+/).map(function(comp27) {
+        return replaceCaret(comp27, options);
+      }).join(" ");
+    }
+    function replaceCaret(comp26, options) {
+      debug2("caret", comp26, options);
+      var r = options.loose ? safeRe[t.CARETLOOSE] : safeRe[t.CARET];
+      return comp26.replace(r, function(_, M, m, p, pr) {
+        debug2("caret", comp26, _, M, m, p, pr);
+        var ret;
+        if (isX(M)) {
+          ret = "";
+        } else if (isX(m)) {
+          ret = ">=" + M + ".0.0 <" + (+M + 1) + ".0.0";
+        } else if (isX(p)) {
+          if (M === "0") {
+            ret = ">=" + M + "." + m + ".0 <" + M + "." + (+m + 1) + ".0";
+          } else {
+            ret = ">=" + M + "." + m + ".0 <" + (+M + 1) + ".0.0";
+          }
+        } else if (pr) {
+          debug2("replaceCaret pr", pr);
+          if (M === "0") {
+            if (m === "0") {
+              ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + m + "." + (+p + 1);
+            } else {
+              ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + M + "." + (+m + 1) + ".0";
+            }
+          } else {
+            ret = ">=" + M + "." + m + "." + p + "-" + pr + " <" + (+M + 1) + ".0.0";
+          }
+        } else {
+          debug2("no pr");
+          if (M === "0") {
+            if (m === "0") {
+              ret = ">=" + M + "." + m + "." + p + " <" + M + "." + m + "." + (+p + 1);
+            } else {
+              ret = ">=" + M + "." + m + "." + p + " <" + M + "." + (+m + 1) + ".0";
+            }
+          } else {
+            ret = ">=" + M + "." + m + "." + p + " <" + (+M + 1) + ".0.0";
+          }
+        }
+        debug2("caret return", ret);
+        return ret;
+      });
+    }
+    function replaceXRanges(comp26, options) {
+      debug2("replaceXRanges", comp26, options);
+      return comp26.split(/\s+/).map(function(comp27) {
+        return replaceXRange(comp27, options);
+      }).join(" ");
+    }
+    function replaceXRange(comp26, options) {
+      comp26 = comp26.trim();
+      var r = options.loose ? safeRe[t.XRANGELOOSE] : safeRe[t.XRANGE];
+      return comp26.replace(r, function(ret, gtlt, M, m, p, pr) {
+        debug2("xRange", comp26, ret, gtlt, M, m, p, pr);
+        var xM = isX(M);
+        var xm = xM || isX(m);
+        var xp = xm || isX(p);
+        var anyX = xp;
+        if (gtlt === "=" && anyX) {
+          gtlt = "";
+        }
+        pr = options.includePrerelease ? "-0" : "";
+        if (xM) {
+          if (gtlt === ">" || gtlt === "<") {
+            ret = "<0.0.0-0";
+          } else {
+            ret = "*";
+          }
+        } else if (gtlt && anyX) {
+          if (xm) {
+            m = 0;
+          }
+          p = 0;
+          if (gtlt === ">") {
+            gtlt = ">=";
+            if (xm) {
+              M = +M + 1;
+              m = 0;
+              p = 0;
+            } else {
+              m = +m + 1;
+              p = 0;
+            }
+          } else if (gtlt === "<=") {
+            gtlt = "<";
+            if (xm) {
+              M = +M + 1;
+            } else {
+              m = +m + 1;
+            }
+          }
+          ret = gtlt + M + "." + m + "." + p + pr;
+        } else if (xm) {
+          ret = ">=" + M + ".0.0" + pr + " <" + (+M + 1) + ".0.0" + pr;
+        } else if (xp) {
+          ret = ">=" + M + "." + m + ".0" + pr + " <" + M + "." + (+m + 1) + ".0" + pr;
+        }
+        debug2("xRange return", ret);
+        return ret;
+      });
+    }
+    function replaceStars(comp26, options) {
+      debug2("replaceStars", comp26, options);
+      return comp26.trim().replace(safeRe[t.STAR], "");
+    }
+    function hyphenReplace($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr, tb) {
+      if (isX(fM)) {
+        from = "";
+      } else if (isX(fm)) {
+        from = ">=" + fM + ".0.0";
+      } else if (isX(fp)) {
+        from = ">=" + fM + "." + fm + ".0";
+      } else {
+        from = ">=" + from;
+      }
+      if (isX(tM)) {
+        to = "";
+      } else if (isX(tm)) {
+        to = "<" + (+tM + 1) + ".0.0";
+      } else if (isX(tp)) {
+        to = "<" + tM + "." + (+tm + 1) + ".0";
+      } else if (tpr) {
+        to = "<=" + tM + "." + tm + "." + tp + "-" + tpr;
+      } else {
+        to = "<=" + to;
+      }
+      return (from + " " + to).trim();
+    }
+    Range.prototype.test = function(version3) {
+      if (!version3) {
+        return false;
+      }
+      if (typeof version3 === "string") {
+        try {
+          version3 = new SemVer(version3, this.options);
+        } catch (er) {
+          return false;
+        }
+      }
+      for (var i2 = 0; i2 < this.set.length; i2++) {
+        if (testSet(this.set[i2], version3, this.options)) {
+          return true;
+        }
+      }
+      return false;
+    };
+    function testSet(set, version3, options) {
+      for (var i2 = 0; i2 < set.length; i2++) {
+        if (!set[i2].test(version3)) {
+          return false;
+        }
+      }
+      if (version3.prerelease.length && !options.includePrerelease) {
+        for (i2 = 0; i2 < set.length; i2++) {
+          debug2(set[i2].semver);
+          if (set[i2].semver === ANY) {
+            continue;
+          }
+          if (set[i2].semver.prerelease.length > 0) {
+            var allowed = set[i2].semver;
+            if (allowed.major === version3.major && allowed.minor === version3.minor && allowed.patch === version3.patch) {
+              return true;
+            }
+          }
+        }
+        return false;
+      }
+      return true;
+    }
+    exports2.satisfies = satisfies4;
+    function satisfies4(version3, range2, options) {
+      try {
+        range2 = new Range(range2, options);
+      } catch (er) {
+        return false;
+      }
+      return range2.test(version3);
+    }
+    exports2.maxSatisfying = maxSatisfying3;
+    function maxSatisfying3(versions, range2, options) {
+      var max = null;
+      var maxSV = null;
+      try {
+        var rangeObj = new Range(range2, options);
+      } catch (er) {
+        return null;
+      }
+      versions.forEach(function(v) {
+        if (rangeObj.test(v)) {
+          if (!max || maxSV.compare(v) === -1) {
+            max = v;
+            maxSV = new SemVer(max, options);
+          }
+        }
+      });
+      return max;
+    }
+    exports2.minSatisfying = minSatisfying4;
+    function minSatisfying4(versions, range2, options) {
+      var min = null;
+      var minSV = null;
+      try {
+        var rangeObj = new Range(range2, options);
+      } catch (er) {
+        return null;
+      }
+      versions.forEach(function(v) {
+        if (rangeObj.test(v)) {
+          if (!min || minSV.compare(v) === 1) {
+            min = v;
+            minSV = new SemVer(min, options);
+          }
+        }
+      });
+      return min;
+    }
+    exports2.minVersion = minVersion;
+    function minVersion(range2, loose) {
+      range2 = new Range(range2, loose);
+      var minver = new SemVer("0.0.0");
+      if (range2.test(minver)) {
+        return minver;
+      }
+      minver = new SemVer("0.0.0-0");
+      if (range2.test(minver)) {
+        return minver;
+      }
+      minver = null;
+      for (var i2 = 0; i2 < range2.set.length; ++i2) {
+        var comparators = range2.set[i2];
+        comparators.forEach(function(comparator) {
+          var compver = new SemVer(comparator.semver.version);
+          switch (comparator.operator) {
+            case ">":
+              if (compver.prerelease.length === 0) {
+                compver.patch++;
+              } else {
+                compver.prerelease.push(0);
+              }
+              compver.raw = compver.format();
+            /* fallthrough */
+            case "":
+            case ">=":
+              if (!minver || gt2(minver, compver)) {
+                minver = compver;
+              }
+              break;
+            case "<":
+            case "<=":
+              break;
+            /* istanbul ignore next */
+            default:
+              throw new Error("Unexpected operation: " + comparator.operator);
+          }
+        });
+      }
+      if (minver && range2.test(minver)) {
+        return minver;
+      }
+      return null;
+    }
+    exports2.validRange = validRange;
+    function validRange(range2, options) {
+      try {
+        return new Range(range2, options).range || "*";
+      } catch (er) {
+        return null;
+      }
+    }
+    exports2.ltr = ltr;
+    function ltr(version3, range2, options) {
+      return outside(version3, range2, "<", options);
+    }
+    exports2.gtr = gtr;
+    function gtr(version3, range2, options) {
+      return outside(version3, range2, ">", options);
+    }
+    exports2.outside = outside;
+    function outside(version3, range2, hilo, options) {
+      version3 = new SemVer(version3, options);
+      range2 = new Range(range2, options);
+      var gtfn, ltefn, ltfn, comp26, ecomp;
+      switch (hilo) {
+        case ">":
+          gtfn = gt2;
+          ltefn = lte;
+          ltfn = lt;
+          comp26 = ">";
+          ecomp = ">=";
+          break;
+        case "<":
+          gtfn = lt;
+          ltefn = gte;
+          ltfn = gt2;
+          comp26 = "<";
+          ecomp = "<=";
+          break;
+        default:
+          throw new TypeError('Must provide a hilo val of "<" or ">"');
+      }
+      if (satisfies4(version3, range2, options)) {
+        return false;
+      }
+      for (var i2 = 0; i2 < range2.set.length; ++i2) {
+        var comparators = range2.set[i2];
+        var high = null;
+        var low = null;
+        comparators.forEach(function(comparator) {
+          if (comparator.semver === ANY) {
+            comparator = new Comparator(">=0.0.0");
+          }
+          high = high || comparator;
+          low = low || comparator;
+          if (gtfn(comparator.semver, high.semver, options)) {
+            high = comparator;
+          } else if (ltfn(comparator.semver, low.semver, options)) {
+            low = comparator;
+          }
+        });
+        if (high.operator === comp26 || high.operator === ecomp) {
+          return false;
+        }
+        if ((!low.operator || low.operator === comp26) && ltefn(version3, low.semver)) {
+          return false;
+        } else if (low.operator === ecomp && ltfn(version3, low.semver)) {
+          return false;
+        }
+      }
+      return true;
+    }
+    exports2.prerelease = prerelease;
+    function prerelease(version3, options) {
+      var parsed = parse3(version3, options);
+      return parsed && parsed.prerelease.length ? parsed.prerelease : null;
+    }
+    exports2.intersects = intersects;
+    function intersects(r1, r2, options) {
+      r1 = new Range(r1, options);
+      r2 = new Range(r2, options);
+      return r1.intersects(r2);
+    }
+    exports2.coerce = coerce;
+    function coerce(version3, options) {
+      if (version3 instanceof SemVer) {
+        return version3;
+      }
+      if (typeof version3 === "number") {
+        version3 = String(version3);
+      }
+      if (typeof version3 !== "string") {
+        return null;
+      }
+      options = options || {};
+      var match2 = null;
+      if (!options.rtl) {
+        match2 = version3.match(safeRe[t.COERCE]);
+      } else {
+        var next;
+        while ((next = safeRe[t.COERCERTL].exec(version3)) && (!match2 || match2.index + match2[0].length !== version3.length)) {
+          if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
+            match2 = next;
+          }
+          safeRe[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length;
+        }
+        safeRe[t.COERCERTL].lastIndex = -1;
+      }
+      if (match2 === null) {
+        return null;
+      }
+      return parse3(match2[2] + "." + (match2[3] || "0") + "." + (match2[4] || "0"), options);
+    }
+  }
+});
+
 // src/setup-uv.ts
-var import_node_fs8 = __toESM(require("node:fs"), 1);
-var path15 = __toESM(require("node:path"), 1);
+var import_node_fs7 = __toESM(require("node:fs"), 1);
+var path16 = __toESM(require("node:path"), 1);
 
 // node_modules/@actions/core/lib/command.js
 var os = __toESM(require("os"), 1);
@@ -57945,8 +57945,8 @@ var Pattern = class _Pattern {
 
 // node_modules/@actions/glob/lib/internal-search-state.js
 var SearchState = class {
-  constructor(path16, level) {
-    this.path = path16;
+  constructor(path17, level) {
+    this.path = path17;
     this.level = level;
   }
 };
@@ -62391,15 +62391,15 @@ function getRequestUrl(baseUri, operationSpec, operationArguments, fallbackObjec
   let isAbsolutePath = false;
   let requestUrl = replaceAll(baseUri, urlReplacements);
   if (operationSpec.path) {
-    let path16 = replaceAll(operationSpec.path, urlReplacements);
-    if (operationSpec.path === "/{nextLink}" && path16.startsWith("/")) {
-      path16 = path16.substring(1);
+    let path17 = replaceAll(operationSpec.path, urlReplacements);
+    if (operationSpec.path === "/{nextLink}" && path17.startsWith("/")) {
+      path17 = path17.substring(1);
     }
-    if (isAbsoluteUrl(path16)) {
-      requestUrl = path16;
+    if (isAbsoluteUrl(path17)) {
+      requestUrl = path17;
       isAbsolutePath = true;
     } else {
-      requestUrl = appendPath(requestUrl, path16);
+      requestUrl = appendPath(requestUrl, path17);
     }
   }
   const { queryParams, sequenceParams } = calculateQueryParameters(operationSpec, operationArguments, fallbackObject);
@@ -62445,9 +62445,9 @@ function appendPath(url2, pathToAppend) {
   }
   const searchStart = pathToAppend.indexOf("?");
   if (searchStart !== -1) {
-    const path16 = pathToAppend.substring(0, searchStart);
+    const path17 = pathToAppend.substring(0, searchStart);
     const search = pathToAppend.substring(searchStart + 1);
-    newPath = newPath + path16;
+    newPath = newPath + path17;
     if (search) {
       parsedUrl.search = parsedUrl.search ? `${parsedUrl.search}&${search}` : search;
     }
@@ -67289,9 +67289,9 @@ var StorageSharedKeyCredentialPolicy = class extends CredentialPolicy {
    * @param request -
    */
   getCanonicalizedResourceString(request) {
-    const path16 = getURLPath(request.url) || "/";
+    const path17 = getURLPath(request.url) || "/";
     let canonicalizedResourceString = "";
-    canonicalizedResourceString += `/${this.factory.accountName}${path16}`;
+    canonicalizedResourceString += `/${this.factory.accountName}${path17}`;
     const queries = getURLQueries(request.url);
     const lowercaseQueries = {};
     if (queries) {
@@ -67781,9 +67781,9 @@ function storageSharedKeyCredentialPolicy(options) {
     return canonicalizedHeadersStringToSign;
   }
   function getCanonicalizedResourceString(request) {
-    const path16 = getURLPath(request.url) || "/";
+    const path17 = getURLPath(request.url) || "/";
     let canonicalizedResourceString = "";
-    canonicalizedResourceString += `/${options.accountName}${path16}`;
+    canonicalizedResourceString += `/${options.accountName}${path17}`;
     const queries = getURLQueries(request.url);
     const lowercaseQueries = {};
     if (queries) {
@@ -81724,10 +81724,10 @@ var StorageContextClient = class extends StorageClient {
 // node_modules/@azure/storage-blob/dist/esm/utils/utils.common.js
 function escapeURLPath(url2) {
   const urlParsed = new URL(url2);
-  let path16 = urlParsed.pathname;
-  path16 = path16 || "/";
-  path16 = escape(path16);
-  urlParsed.pathname = path16;
+  let path17 = urlParsed.pathname;
+  path17 = path17 || "/";
+  path17 = escape(path17);
+  urlParsed.pathname = path17;
   return urlParsed.toString();
 }
 function getProxyUriFromDevConnString(connectionString) {
@@ -81812,9 +81812,9 @@ function escape(text) {
 }
 function appendToURLPath(url2, name) {
   const urlParsed = new URL(url2);
-  let path16 = urlParsed.pathname;
-  path16 = path16 ? path16.endsWith("/") ? `${path16}${name}` : `${path16}/${name}` : name;
-  urlParsed.pathname = path16;
+  let path17 = urlParsed.pathname;
+  path17 = path17 ? path17.endsWith("/") ? `${path17}${name}` : `${path17}/${name}` : name;
+  urlParsed.pathname = path17;
   return urlParsed.toString();
 }
 function setURLParameter2(url2, name, value) {
@@ -90525,8 +90525,8 @@ function handleMatchResult(matchedKey, primaryKey, stateKey, outputKey) {
 }
 
 // src/download/download-version.ts
-var import_node_fs3 = require("node:fs");
-var path13 = __toESM(require("node:path"), 1);
+var import_node_fs6 = require("node:fs");
+var path14 = __toESM(require("node:path"), 1);
 
 // node_modules/@actions/tool-cache/lib/tool-cache.js
 var crypto5 = __toESM(require("crypto"), 1);
@@ -90963,10 +90963,6 @@ function _getGlobal(key, defaultValue) {
   return value !== void 0 ? value : defaultValue;
 }
 
-// src/download/download-version.ts
-var pep440 = __toESM(require_pep440(), 1);
-var semver4 = __toESM(require_semver5(), 1);
-
 // src/utils/constants.ts
 var TOOL_CACHE_NAME = "uv";
 var STATE_UV_PATH = "uv-path";
@@ -95692,6 +95688,9 @@ async function getLatestVersion(manifestUrl = VERSIONS_MANIFEST_URL) {
   return latestVersion;
 }
 async function getAllVersions(manifestUrl = VERSIONS_MANIFEST_URL) {
+  info(
+    `Getting available versions from ${manifestSource(manifestUrl)} ...`
+  );
   const versions = await fetchManifest(manifestUrl);
   return versions.map((versionData) => versionData.version);
 }
@@ -95724,6 +95723,12 @@ async function getArtifact(version3, arch3, platform2, manifestUrl = VERSIONS_MA
     downloadUrl: artifact.url
   };
 }
+function manifestSource(manifestUrl) {
+  if (manifestUrl === VERSIONS_MANIFEST_URL) {
+    return VERSIONS_MANIFEST_URL;
+  }
+  return `manifest-file ${manifestUrl}`;
+}
 function isManifestVersion(value) {
   if (!isRecord(value)) {
     return false;
@@ -95744,177 +95749,51 @@ function isRecord(value) {
   return typeof value === "object" && value !== null;
 }
 
-// src/download/download-version.ts
-function tryGetFromToolCache(arch3, version3) {
-  debug(`Trying to get uv from tool cache for ${version3}...`);
-  const cachedVersions = findAllVersions(TOOL_CACHE_NAME, arch3);
-  debug(`Cached versions: ${cachedVersions}`);
-  let resolvedVersion = evaluateVersions(cachedVersions, version3);
-  if (resolvedVersion === "") {
-    resolvedVersion = version3;
+// src/version/resolve.ts
+var pep440 = __toESM(require_pep440(), 1);
+var semver4 = __toESM(require_semver5(), 1);
+
+// src/version/specifier.ts
+function normalizeVersionSpecifier(specifier) {
+  const trimmedSpecifier = specifier.trim();
+  if (trimmedSpecifier.startsWith("==")) {
+    return trimmedSpecifier.slice(2);
   }
-  const installedPath = find(TOOL_CACHE_NAME, resolvedVersion, arch3);
-  return { installedPath, version: resolvedVersion };
+  return trimmedSpecifier;
 }
-async function downloadVersion(platform2, arch3, version3, checksum, githubToken, manifestUrl) {
-  const artifact = await getArtifact(version3, arch3, platform2, manifestUrl);
-  if (!artifact) {
-    throw new Error(
-      getMissingArtifactMessage(version3, arch3, platform2, manifestUrl)
-    );
+function parseVersionSpecifier(specifier) {
+  const raw = specifier.trim();
+  const normalized = normalizeVersionSpecifier(raw);
+  if (normalized === "latest") {
+    return {
+      kind: "latest",
+      normalized: "latest",
+      raw
+    };
   }
-  const resolvedChecksum = manifestUrl === void 0 ? checksum : resolveChecksum(checksum, artifact.checksum);
-  const mirrorUrl = rewriteToMirror(artifact.downloadUrl);
-  const downloadUrl = mirrorUrl ?? artifact.downloadUrl;
-  const downloadToken = mirrorUrl !== void 0 ? void 0 : githubToken;
-  try {
-    return await downloadArtifact(
-      downloadUrl,
-      `uv-${arch3}-${platform2}`,
-      platform2,
-      arch3,
-      version3,
-      resolvedChecksum,
-      downloadToken
-    );
-  } catch (err) {
-    if (mirrorUrl === void 0) {
-      throw err;
-    }
-    warning(
-      `Failed to download from mirror, falling back to GitHub Releases: ${err.message}`
-    );
-    return await downloadArtifact(
-      artifact.downloadUrl,
-      `uv-${arch3}-${platform2}`,
-      platform2,
-      arch3,
-      version3,
-      resolvedChecksum,
-      githubToken
-    );
+  if (isExplicitVersion(normalized)) {
+    return {
+      kind: "exact",
+      normalized,
+      raw
+    };
   }
-}
-function rewriteToMirror(url2) {
-  if (!url2.startsWith(GITHUB_RELEASES_PREFIX)) {
-    return void 0;
-  }
-  return ASTRAL_MIRROR_PREFIX + url2.slice(GITHUB_RELEASES_PREFIX.length);
-}
-async function downloadArtifact(downloadUrl, artifactName, platform2, arch3, version3, checksum, githubToken) {
-  info(`Downloading uv from "${downloadUrl}" ...`);
-  const downloadPath = await downloadTool(
-    downloadUrl,
-    void 0,
-    githubToken
-  );
-  await validateChecksum(checksum, downloadPath, arch3, platform2, version3);
-  let uvDir;
-  if (platform2 === "pc-windows-msvc") {
-    try {
-      uvDir = await extractTar2(downloadPath, void 0, "x");
-    } catch (err) {
-      info(
-        `Extracting with tar failed, falling back to zip extraction: ${err.message}`
-      );
-      const extension = getExtension(platform2);
-      const fullPathWithExtension = `${downloadPath}${extension}`;
-      await import_node_fs3.promises.copyFile(downloadPath, fullPathWithExtension);
-      uvDir = await extractZip(fullPathWithExtension);
-    }
-  } else {
-    const extractedDir = await extractTar2(downloadPath);
-    uvDir = path13.join(extractedDir, artifactName);
-  }
-  const cachedToolDir = await cacheDir(
-    uvDir,
-    TOOL_CACHE_NAME,
-    version3,
-    arch3
-  );
-  return { cachedToolDir, version: version3 };
-}
-function getMissingArtifactMessage(version3, arch3, platform2, manifestUrl) {
-  if (manifestUrl === void 0) {
-    return `Could not find artifact for version ${version3}, arch ${arch3}, platform ${platform2} in ${VERSIONS_MANIFEST_URL} .`;
-  }
-  return `manifest-file does not contain version ${version3}, arch ${arch3}, platform ${platform2}.`;
-}
-function resolveChecksum(checksum, manifestChecksum) {
-  return checksum !== void 0 && checksum !== "" ? checksum : manifestChecksum;
-}
-function getExtension(platform2) {
-  return platform2 === "pc-windows-msvc" ? ".zip" : ".tar.gz";
-}
-async function resolveVersion(versionInput, manifestUrl, resolutionStrategy = "highest") {
-  debug(`Resolving version: ${versionInput}`);
-  const isSimpleMinimumVersionSpecifier = versionInput.includes(">") && !versionInput.includes(",");
-  const resolveVersionSpecifierToLatest = isSimpleMinimumVersionSpecifier && resolutionStrategy === "highest";
-  if (resolveVersionSpecifierToLatest) {
-    info("Found minimum version specifier, using latest version");
-  }
-  const version3 = versionInput === "latest" || resolveVersionSpecifierToLatest ? await getLatestVersion(manifestUrl) : versionInput;
-  if (isExplicitVersion(version3)) {
-    debug(`Version ${version3} is an explicit version.`);
-    if (resolveVersionSpecifierToLatest && !pep440.satisfies(version3, versionInput)) {
-      throw new Error(`No version found for ${versionInput}`);
-    }
-    return version3;
-  }
-  const availableVersions = await getAvailableVersions(manifestUrl);
-  debug(`Available versions: ${availableVersions}`);
-  const resolvedVersion = resolutionStrategy === "lowest" ? minSatisfying3(availableVersions, version3) : maxSatisfying2(availableVersions, version3);
-  if (resolvedVersion === void 0) {
-    throw new Error(`No version found for ${version3}`);
-  }
-  return resolvedVersion;
-}
-async function getAvailableVersions(manifestUrl) {
-  if (manifestUrl !== void 0) {
-    info(
-      `Getting available versions from manifest-file ${manifestUrl} ...`
-    );
-  } else {
-    info(`Getting available versions from ${VERSIONS_MANIFEST_URL} ...`);
-  }
-  return await getAllVersions(manifestUrl);
-}
-function maxSatisfying2(versions, version3) {
-  const maxSemver = evaluateVersions(versions, version3);
-  if (maxSemver !== "") {
-    debug(`Found a version that satisfies the semver range: ${maxSemver}`);
-    return maxSemver;
-  }
-  const maxPep440 = pep440.maxSatisfying(versions, version3);
-  if (maxPep440 !== null) {
-    debug(
-      `Found a version that satisfies the pep440 specifier: ${maxPep440}`
-    );
-    return maxPep440;
-  }
-  return void 0;
-}
-function minSatisfying3(versions, version3) {
-  const minSemver = semver4.minSatisfying(versions, version3);
-  if (minSemver !== null) {
-    debug(`Found a version that satisfies the semver range: ${minSemver}`);
-    return minSemver;
-  }
-  const minPep440 = pep440.minSatisfying(versions, version3);
-  if (minPep440 !== null) {
-    debug(
-      `Found a version that satisfies the pep440 specifier: ${minPep440}`
-    );
-    return minPep440;
-  }
-  return void 0;
+  return {
+    isSimpleMinimumVersionSpecifier: raw.includes(">") && !raw.includes(","),
+    kind: "range",
+    normalized,
+    raw
+  };
 }
 
-// src/utils/inputs.ts
-var import_node_path = __toESM(require("node:path"), 1);
+// src/version/version-request-resolver.ts
+var path13 = __toESM(require("node:path"), 1);
+
+// src/version/file-parser.ts
+var import_node_fs5 = __toESM(require("node:fs"), 1);
 
 // src/utils/config-file.ts
-var import_node_fs4 = __toESM(require("node:fs"), 1);
+var import_node_fs3 = __toESM(require("node:fs"), 1);
 
 // node_modules/smol-toml/dist/error.js
 function getLineColFromPtr(string, ptr) {
@@ -96603,10 +96482,16 @@ function parse2(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
 
 // src/utils/config-file.ts
 function getConfigValueFromTomlFile(filePath, key) {
-  if (!import_node_fs4.default.existsSync(filePath) || !filePath.endsWith(".toml")) {
+  if (!import_node_fs3.default.existsSync(filePath) || !filePath.endsWith(".toml")) {
+    return void 0;
+  }
+  const fileContent = import_node_fs3.default.readFileSync(filePath, "utf-8");
+  return getConfigValueFromTomlContent(filePath, fileContent, key);
+}
+function getConfigValueFromTomlContent(filePath, fileContent, key) {
+  if (!filePath.endsWith(".toml")) {
     return void 0;
   }
-  const fileContent = import_node_fs4.default.readFileSync(filePath, "utf-8");
   if (filePath.endsWith("pyproject.toml")) {
     const tomlContent2 = parse2(fileContent);
     return tomlContent2?.tool?.uv?.[key];
@@ -96615,7 +96500,452 @@ function getConfigValueFromTomlFile(filePath, key) {
   return tomlContent[key];
 }
 
+// src/version/requirements-file.ts
+function getUvVersionFromRequirementsText(fileContent) {
+  return getUvVersionFromAllDependencies(fileContent.split("\n"));
+}
+function getUvVersionFromParsedPyproject(pyproject) {
+  const dependencies = pyproject?.project?.dependencies || [];
+  const optionalDependencies = Object.values(
+    pyproject?.project?.["optional-dependencies"] || {}
+  ).flat();
+  const devDependencies = Object.values(
+    pyproject?.["dependency-groups"] || {}
+  ).flat().filter((item) => typeof item === "string");
+  return getUvVersionFromAllDependencies(
+    dependencies.concat(optionalDependencies, devDependencies)
+  );
+}
+function parsePyprojectContent(pyprojectContent) {
+  return parse2(pyprojectContent);
+}
+function getUvVersionFromAllDependencies(allDependencies) {
+  return allDependencies.find((dep) => dep.match(/^uv[=<>~!]/))?.match(/^uv([=<>~!]+\S*)/)?.[1].trim();
+}
+
+// src/version/tool-versions-file.ts
+var import_node_fs4 = __toESM(require("node:fs"), 1);
+function getUvVersionFromToolVersions(filePath) {
+  if (!filePath.endsWith(".tool-versions")) {
+    return void 0;
+  }
+  const fileContents = import_node_fs4.default.readFileSync(filePath, "utf8");
+  const lines = fileContents.split("\n");
+  for (const line of lines) {
+    if (line.trim().startsWith("#")) {
+      continue;
+    }
+    const match2 = line.match(/^\s*uv\s*v?\s*(?[^\s]+)\s*$/);
+    if (match2) {
+      const matchedVersion = match2.groups?.version.trim();
+      if (matchedVersion?.startsWith("ref")) {
+        warning(
+          "The ref syntax of .tool-versions is not supported. Please use a released version instead."
+        );
+        return void 0;
+      }
+      return matchedVersion;
+    }
+  }
+  return void 0;
+}
+
+// src/version/file-parser.ts
+var VERSION_FILE_PARSERS = [
+  {
+    format: ".tool-versions",
+    parse: (filePath) => getUvVersionFromToolVersions(filePath),
+    supports: (filePath) => filePath.endsWith(".tool-versions")
+  },
+  {
+    format: "uv.toml",
+    parse: (filePath) => {
+      const fileContent = import_node_fs5.default.readFileSync(filePath, "utf-8");
+      return getConfigValueFromTomlContent(
+        filePath,
+        fileContent,
+        "required-version"
+      );
+    },
+    supports: (filePath) => filePath.endsWith("uv.toml")
+  },
+  {
+    format: "pyproject.toml",
+    parse: (filePath) => {
+      const fileContent = import_node_fs5.default.readFileSync(filePath, "utf-8");
+      const pyproject = parsePyprojectContent(fileContent);
+      const requiredVersion = pyproject.tool?.uv?.["required-version"];
+      if (requiredVersion !== void 0) {
+        return requiredVersion;
+      }
+      return getUvVersionFromParsedPyproject(pyproject);
+    },
+    supports: (filePath) => filePath.endsWith("pyproject.toml")
+  },
+  {
+    format: "requirements",
+    parse: (filePath) => {
+      const fileContent = import_node_fs5.default.readFileSync(filePath, "utf-8");
+      return getUvVersionFromRequirementsText(fileContent);
+    },
+    supports: (filePath) => filePath.endsWith(".txt")
+  }
+];
+function getParsedVersionFile(filePath) {
+  info(`Trying to find version for uv in: ${filePath}`);
+  if (!import_node_fs5.default.existsSync(filePath)) {
+    info(`Could not find file: ${filePath}`);
+    return void 0;
+  }
+  const parser = getVersionFileParser(filePath);
+  if (parser === void 0) {
+    return void 0;
+  }
+  try {
+    const specifier = parser.parse(filePath);
+    if (specifier === void 0) {
+      return void 0;
+    }
+    const normalizedSpecifier = normalizeVersionSpecifier(specifier);
+    info(`Found version for uv in ${filePath}: ${normalizedSpecifier}`);
+    return {
+      format: parser.format,
+      specifier: normalizedSpecifier
+    };
+  } catch (error2) {
+    warning(
+      `Error while parsing ${filePath}: ${error2.message}`
+    );
+    return void 0;
+  }
+}
+function getVersionFileParser(filePath) {
+  return VERSION_FILE_PARSERS.find((parser) => parser.supports(filePath));
+}
+
+// src/version/version-request-resolver.ts
+var VersionRequestContext = class {
+  version;
+  versionFile;
+  workingDirectory;
+  parsedFiles = /* @__PURE__ */ new Map();
+  constructor(version3, versionFile, workingDirectory) {
+    this.version = version3;
+    this.versionFile = versionFile;
+    this.workingDirectory = workingDirectory;
+  }
+  getVersionFile(filePath) {
+    const cachedResult = this.parsedFiles.get(filePath);
+    if (cachedResult !== void 0 || this.parsedFiles.has(filePath)) {
+      return cachedResult;
+    }
+    const result = getParsedVersionFile(filePath);
+    this.parsedFiles.set(filePath, result);
+    return result;
+  }
+  getWorkspaceCandidates() {
+    return [
+      {
+        source: "uv.toml",
+        sourcePath: path13.join(this.workingDirectory, "uv.toml")
+      },
+      {
+        source: "pyproject.toml",
+        sourcePath: path13.join(this.workingDirectory, "pyproject.toml")
+      }
+    ];
+  }
+};
+var ExplicitInputVersionResolver = class {
+  resolve(context3) {
+    if (context3.version === void 0) {
+      return void 0;
+    }
+    return {
+      source: "input",
+      specifier: normalizeVersionSpecifier(context3.version)
+    };
+  }
+};
+var VersionFileVersionResolver = class {
+  resolve(context3) {
+    if (context3.versionFile === void 0) {
+      return void 0;
+    }
+    const versionFile = context3.getVersionFile(context3.versionFile);
+    if (versionFile === void 0) {
+      throw new Error(
+        `Could not determine uv version from file: ${context3.versionFile}`
+      );
+    }
+    return {
+      format: versionFile.format,
+      source: "version-file",
+      sourcePath: context3.versionFile,
+      specifier: versionFile.specifier
+    };
+  }
+};
+var WorkspaceVersionResolver = class {
+  resolve(context3) {
+    for (const candidate of context3.getWorkspaceCandidates()) {
+      const versionFile = context3.getVersionFile(candidate.sourcePath);
+      if (versionFile === void 0) {
+        continue;
+      }
+      return {
+        format: versionFile.format,
+        source: candidate.source,
+        sourcePath: candidate.sourcePath,
+        specifier: versionFile.specifier
+      };
+    }
+    info(
+      "Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest."
+    );
+    return void 0;
+  }
+};
+var LatestVersionResolver = class {
+  resolve() {
+    return {
+      source: "default",
+      specifier: "latest"
+    };
+  }
+};
+var VERSION_REQUEST_RESOLVERS = [
+  new ExplicitInputVersionResolver(),
+  new VersionFileVersionResolver(),
+  new WorkspaceVersionResolver(),
+  new LatestVersionResolver()
+];
+function resolveVersionRequest(options) {
+  const context3 = new VersionRequestContext(
+    emptyToUndefined(options.version),
+    emptyToUndefined(options.versionFile),
+    options.workingDirectory
+  );
+  for (const resolver of VERSION_REQUEST_RESOLVERS) {
+    const request = resolver.resolve(context3);
+    if (request !== void 0) {
+      return request;
+    }
+  }
+  throw new Error("Could not resolve a requested uv version.");
+}
+function emptyToUndefined(value) {
+  return value === void 0 || value === "" ? void 0 : value;
+}
+
+// src/version/resolve.ts
+var ExactVersionResolver = class {
+  async resolve(context3) {
+    if (context3.parsedSpecifier.kind !== "exact") {
+      return void 0;
+    }
+    debug(
+      `Version ${context3.parsedSpecifier.normalized} is an explicit version.`
+    );
+    return context3.parsedSpecifier.normalized;
+  }
+};
+var LatestVersionResolver2 = class {
+  async resolve(context3) {
+    const shouldUseLatestVersion = context3.parsedSpecifier.kind === "latest" || context3.parsedSpecifier.kind === "range" && context3.parsedSpecifier.isSimpleMinimumVersionSpecifier && context3.resolutionStrategy === "highest";
+    if (!shouldUseLatestVersion) {
+      return void 0;
+    }
+    if (context3.parsedSpecifier.kind === "range" && context3.parsedSpecifier.isSimpleMinimumVersionSpecifier) {
+      info("Found minimum version specifier, using latest version");
+    }
+    const latestVersion = await getLatestVersion(context3.manifestUrl);
+    if (context3.parsedSpecifier.kind === "range" && context3.parsedSpecifier.isSimpleMinimumVersionSpecifier && !pep440.satisfies(latestVersion, context3.parsedSpecifier.raw)) {
+      throw new Error(`No version found for ${context3.parsedSpecifier.raw}`);
+    }
+    return latestVersion;
+  }
+};
+var RangeVersionResolver = class {
+  async resolve(context3) {
+    if (context3.parsedSpecifier.kind !== "range") {
+      return void 0;
+    }
+    const availableVersions = await getAllVersions(context3.manifestUrl);
+    debug(`Available versions: ${availableVersions}`);
+    const resolvedVersion = context3.resolutionStrategy === "lowest" ? minSatisfying3(availableVersions, context3.parsedSpecifier.normalized) : maxSatisfying2(availableVersions, context3.parsedSpecifier.normalized);
+    if (resolvedVersion === void 0) {
+      throw new Error(`No version found for ${context3.parsedSpecifier.raw}`);
+    }
+    return resolvedVersion;
+  }
+};
+var CONCRETE_VERSION_RESOLVERS = [
+  new ExactVersionResolver(),
+  new LatestVersionResolver2(),
+  new RangeVersionResolver()
+];
+async function resolveUvVersion(options) {
+  const request = resolveVersionRequest(options);
+  const resolutionStrategy = options.resolutionStrategy ?? "highest";
+  const version3 = await resolveVersion(
+    request.specifier,
+    options.manifestFile,
+    resolutionStrategy
+  );
+  return version3;
+}
+async function resolveVersion(versionInput, manifestUrl, resolutionStrategy = "highest") {
+  debug(`Resolving version: ${versionInput}`);
+  const context3 = {
+    manifestUrl,
+    parsedSpecifier: parseVersionSpecifier(versionInput),
+    resolutionStrategy
+  };
+  for (const resolver of CONCRETE_VERSION_RESOLVERS) {
+    const version3 = await resolver.resolve(context3);
+    if (version3 !== void 0) {
+      return version3;
+    }
+  }
+  throw new Error(`No version found for ${versionInput}`);
+}
+function maxSatisfying2(versions, version3) {
+  const maxSemver = evaluateVersions(versions, version3);
+  if (maxSemver !== "") {
+    debug(`Found a version that satisfies the semver range: ${maxSemver}`);
+    return maxSemver;
+  }
+  const maxPep440 = pep440.maxSatisfying(versions, version3);
+  if (maxPep440 !== null) {
+    debug(
+      `Found a version that satisfies the pep440 specifier: ${maxPep440}`
+    );
+    return maxPep440;
+  }
+  return void 0;
+}
+function minSatisfying3(versions, version3) {
+  const minSemver = semver4.minSatisfying(versions, version3);
+  if (minSemver !== null) {
+    debug(`Found a version that satisfies the semver range: ${minSemver}`);
+    return minSemver;
+  }
+  const minPep440 = pep440.minSatisfying(versions, version3);
+  if (minPep440 !== null) {
+    debug(
+      `Found a version that satisfies the pep440 specifier: ${minPep440}`
+    );
+    return minPep440;
+  }
+  return void 0;
+}
+
+// src/download/download-version.ts
+function tryGetFromToolCache(arch3, version3) {
+  debug(`Trying to get uv from tool cache for ${version3}...`);
+  const cachedVersions = findAllVersions(TOOL_CACHE_NAME, arch3);
+  debug(`Cached versions: ${cachedVersions}`);
+  let resolvedVersion = evaluateVersions(cachedVersions, version3);
+  if (resolvedVersion === "") {
+    resolvedVersion = version3;
+  }
+  const installedPath = find(TOOL_CACHE_NAME, resolvedVersion, arch3);
+  return { installedPath, version: resolvedVersion };
+}
+async function downloadVersion(platform2, arch3, version3, checksum, githubToken, manifestUrl) {
+  const artifact = await getArtifact(version3, arch3, platform2, manifestUrl);
+  if (!artifact) {
+    throw new Error(
+      getMissingArtifactMessage(version3, arch3, platform2, manifestUrl)
+    );
+  }
+  const resolvedChecksum = manifestUrl === void 0 ? checksum : resolveChecksum(checksum, artifact.checksum);
+  const mirrorUrl = rewriteToMirror(artifact.downloadUrl);
+  const downloadUrl = mirrorUrl ?? artifact.downloadUrl;
+  const downloadToken = mirrorUrl !== void 0 ? void 0 : githubToken;
+  try {
+    return await downloadArtifact(
+      downloadUrl,
+      `uv-${arch3}-${platform2}`,
+      platform2,
+      arch3,
+      version3,
+      resolvedChecksum,
+      downloadToken
+    );
+  } catch (err) {
+    if (mirrorUrl === void 0) {
+      throw err;
+    }
+    warning(
+      `Failed to download from mirror, falling back to GitHub Releases: ${err.message}`
+    );
+    return await downloadArtifact(
+      artifact.downloadUrl,
+      `uv-${arch3}-${platform2}`,
+      platform2,
+      arch3,
+      version3,
+      resolvedChecksum,
+      githubToken
+    );
+  }
+}
+function rewriteToMirror(url2) {
+  if (!url2.startsWith(GITHUB_RELEASES_PREFIX)) {
+    return void 0;
+  }
+  return ASTRAL_MIRROR_PREFIX + url2.slice(GITHUB_RELEASES_PREFIX.length);
+}
+async function downloadArtifact(downloadUrl, artifactName, platform2, arch3, version3, checksum, githubToken) {
+  info(`Downloading uv from "${downloadUrl}" ...`);
+  const downloadPath = await downloadTool(
+    downloadUrl,
+    void 0,
+    githubToken
+  );
+  await validateChecksum(checksum, downloadPath, arch3, platform2, version3);
+  let uvDir;
+  if (platform2 === "pc-windows-msvc") {
+    try {
+      uvDir = await extractTar2(downloadPath, void 0, "x");
+    } catch (err) {
+      info(
+        `Extracting with tar failed, falling back to zip extraction: ${err.message}`
+      );
+      const extension = getExtension(platform2);
+      const fullPathWithExtension = `${downloadPath}${extension}`;
+      await import_node_fs6.promises.copyFile(downloadPath, fullPathWithExtension);
+      uvDir = await extractZip(fullPathWithExtension);
+    }
+  } else {
+    const extractedDir = await extractTar2(downloadPath);
+    uvDir = path14.join(extractedDir, artifactName);
+  }
+  const cachedToolDir = await cacheDir(
+    uvDir,
+    TOOL_CACHE_NAME,
+    version3,
+    arch3
+  );
+  return { cachedToolDir, version: version3 };
+}
+function getMissingArtifactMessage(version3, arch3, platform2, manifestUrl) {
+  if (manifestUrl === void 0) {
+    return `Could not find artifact for version ${version3}, arch ${arch3}, platform ${platform2} in ${VERSIONS_MANIFEST_URL} .`;
+  }
+  return `manifest-file does not contain version ${version3}, arch ${arch3}, platform ${platform2}.`;
+}
+function resolveChecksum(checksum, manifestChecksum) {
+  return checksum !== void 0 && checksum !== "" ? checksum : manifestChecksum;
+}
+function getExtension(platform2) {
+  return platform2 === "pc-windows-msvc" ? ".zip" : ".tar.gz";
+}
+
 // src/utils/inputs.ts
+var import_node_path = __toESM(require("node:path"), 1);
 function loadInputs() {
   const workingDirectory = getInput("working-directory");
   const version3 = getInput("version");
@@ -96862,91 +97192,6 @@ function getResolutionStrategy() {
   );
 }
 
-// src/version/resolve.ts
-var import_node_fs7 = __toESM(require("node:fs"), 1);
-
-// src/version/requirements-file.ts
-var import_node_fs5 = __toESM(require("node:fs"), 1);
-function getUvVersionFromRequirementsFile(filePath) {
-  const fileContent = import_node_fs5.default.readFileSync(filePath, "utf-8");
-  if (filePath.endsWith(".txt")) {
-    return getUvVersionFromAllDependencies(fileContent.split("\n"));
-  }
-  const dependencies = parsePyprojectDependencies(fileContent);
-  return getUvVersionFromAllDependencies(dependencies);
-}
-function getUvVersionFromAllDependencies(allDependencies) {
-  return allDependencies.find((dep) => dep.match(/^uv[=<>~!]/))?.match(/^uv([=<>~!]+\S*)/)?.[1].trim();
-}
-function parsePyprojectDependencies(pyprojectContent) {
-  const pyproject = parse2(pyprojectContent);
-  const dependencies = pyproject?.project?.dependencies || [];
-  const optionalDependencies = Object.values(
-    pyproject?.project?.["optional-dependencies"] || {}
-  ).flat();
-  const devDependencies = Object.values(
-    pyproject?.["dependency-groups"] || {}
-  ).flat().filter((item) => typeof item === "string");
-  return dependencies.concat(optionalDependencies, devDependencies);
-}
-
-// src/version/tool-versions-file.ts
-var import_node_fs6 = __toESM(require("node:fs"), 1);
-function getUvVersionFromToolVersions(filePath) {
-  if (!filePath.endsWith(".tool-versions")) {
-    return void 0;
-  }
-  const fileContents = import_node_fs6.default.readFileSync(filePath, "utf8");
-  const lines = fileContents.split("\n");
-  for (const line of lines) {
-    if (line.trim().startsWith("#")) {
-      continue;
-    }
-    const match2 = line.match(/^\s*uv\s*v?\s*(?[^\s]+)\s*$/);
-    if (match2) {
-      const matchedVersion = match2.groups?.version.trim();
-      if (matchedVersion?.startsWith("ref")) {
-        warning(
-          "The ref syntax of .tool-versions is not supported. Please use a released version instead."
-        );
-        return void 0;
-      }
-      return matchedVersion;
-    }
-  }
-  return void 0;
-}
-
-// src/version/resolve.ts
-function getUvVersionFromFile(filePath) {
-  info(`Trying to find version for uv in: ${filePath}`);
-  if (!import_node_fs7.default.existsSync(filePath)) {
-    info(`Could not find file: ${filePath}`);
-    return void 0;
-  }
-  let uvVersion;
-  try {
-    uvVersion = getUvVersionFromToolVersions(filePath);
-    if (uvVersion === void 0) {
-      uvVersion = getConfigValueFromTomlFile(filePath, "required-version");
-    }
-    if (uvVersion === void 0) {
-      uvVersion = getUvVersionFromRequirementsFile(filePath);
-    }
-  } catch (err) {
-    const message = err.message;
-    warning(`Error while parsing ${filePath}: ${message}`);
-    return void 0;
-  }
-  if (uvVersion?.startsWith("==")) {
-    uvVersion = uvVersion.slice(2);
-  }
-  if (uvVersion !== void 0) {
-    info(`Found version for uv in ${filePath}: ${uvVersion}`);
-  }
-  return uvVersion;
-}
-
 // src/setup-uv.ts
 var sourceDir = __dirname;
 async function getPythonVersion(inputs) {
@@ -97011,7 +97256,7 @@ async function run() {
   }
 }
 function detectEmptyWorkdir(inputs) {
-  if (import_node_fs8.default.readdirSync(inputs.workingDirectory).length === 0) {
+  if (import_node_fs7.default.readdirSync(inputs.workingDirectory).length === 0) {
     if (inputs.ignoreEmptyWorkdir) {
       info(
         "Empty workdir detected. Ignoring because ignore-empty-workdir is enabled"
@@ -97024,7 +97269,13 @@ function detectEmptyWorkdir(inputs) {
   }
 }
 async function setupUv(inputs, platform2, arch3) {
-  const resolvedVersion = await determineVersion(inputs);
+  const resolvedVersion = await resolveUvVersion({
+    manifestFile: inputs.manifestFile,
+    resolutionStrategy: inputs.resolutionStrategy,
+    version: inputs.version,
+    versionFile: inputs.versionFile,
+    workingDirectory: inputs.workingDirectory
+  });
   const toolCacheResult = tryGetFromToolCache(arch3, resolvedVersion);
   if (toolCacheResult.installedPath) {
     info(`Found uv in tool-cache for ${toolCacheResult.version}`);
@@ -97046,43 +97297,10 @@ async function setupUv(inputs, platform2, arch3) {
     version: downloadResult.version
   };
 }
-async function determineVersion(inputs) {
-  return await resolveVersion(
-    getRequestedVersion(inputs),
-    inputs.manifestFile,
-    inputs.resolutionStrategy
-  );
-}
-function getRequestedVersion(inputs) {
-  if (inputs.version !== "") {
-    return inputs.version;
-  }
-  if (inputs.versionFile !== "") {
-    const versionFromFile = getUvVersionFromFile(inputs.versionFile);
-    if (versionFromFile === void 0) {
-      throw new Error(
-        `Could not determine uv version from file: ${inputs.versionFile}`
-      );
-    }
-    return versionFromFile;
-  }
-  const versionFromUvToml = getUvVersionFromFile(
-    `${inputs.workingDirectory}${path15.sep}uv.toml`
-  );
-  const versionFromPyproject = getUvVersionFromFile(
-    `${inputs.workingDirectory}${path15.sep}pyproject.toml`
-  );
-  if (versionFromUvToml === void 0 && versionFromPyproject === void 0) {
-    info(
-      "Could not determine uv version from uv.toml or pyproject.toml. Falling back to latest."
-    );
-  }
-  return versionFromUvToml || versionFromPyproject || "latest";
-}
 function addUvToPathAndOutput(cachedPath) {
-  setOutput("uv-path", `${cachedPath}${path15.sep}uv`);
-  saveState(STATE_UV_PATH, `${cachedPath}${path15.sep}uv`);
-  setOutput("uvx-path", `${cachedPath}${path15.sep}uvx`);
+  setOutput("uv-path", `${cachedPath}${path16.sep}uv`);
+  saveState(STATE_UV_PATH, `${cachedPath}${path16.sep}uv`);
+  setOutput("uvx-path", `${cachedPath}${path16.sep}uvx`);
   if (process.env.UV_NO_MODIFY_PATH !== void 0) {
     info("UV_NO_MODIFY_PATH is set, not modifying PATH");
   } else {
@@ -97156,11 +97374,11 @@ async function activateEnvironment(inputs) {
       inputs.workingDirectory,
       "--clear"
     ]);
-    let venvBinPath = `${inputs.venvPath}${path15.sep}bin`;
+    let venvBinPath = `${inputs.venvPath}${path16.sep}bin`;
     if (process.platform === "win32") {
-      venvBinPath = `${inputs.venvPath}${path15.sep}Scripts`;
+      venvBinPath = `${inputs.venvPath}${path16.sep}Scripts`;
     }
-    addPath(path15.resolve(venvBinPath));
+    addPath(path16.resolve(venvBinPath));
     exportVariable("VIRTUAL_ENV", inputs.venvPath);
     setOutput("venv", inputs.venvPath);
   }
@@ -97179,8 +97397,8 @@ function setCacheDir(inputs) {
 }
 function addMatchers(inputs) {
   if (inputs.addProblemMatchers) {
-    const matchersPath = path15.join(sourceDir, "..", "..", ".github");
-    info(`##[add-matcher]${path15.join(matchersPath, "python.json")}`);
+    const matchersPath = path16.join(sourceDir, "..", "..", ".github");
+    info(`##[add-matcher]${path16.join(matchersPath, "python.json")}`);
   }
 }
 run();
diff --git a/src/download/download-version.ts b/src/download/download-version.ts
index 29f40d3..fc86170 100644
--- a/src/download/download-version.ts
+++ b/src/download/download-version.ts
@@ -2,8 +2,6 @@ import { promises as fs } from "node:fs";
 import * as path from "node:path";
 import * as core from "@actions/core";
 import * as tc from "@actions/tool-cache";
-import * as pep440 from "@renovatebot/pep440";
-import * as semver from "semver";
 import {
   ASTRAL_MIRROR_PREFIX,
   GITHUB_RELEASES_PREFIX,
@@ -12,7 +10,9 @@ import {
 } from "../utils/constants";
 import type { Architecture, Platform } from "../utils/platforms";
 import { validateChecksum } from "./checksum/checksum";
-import { getAllVersions, getArtifact, getLatestVersion } from "./manifest";
+import { getArtifact } from "./manifest";
+
+export { resolveVersion } from "../version/resolve";
 
 export function tryGetFromToolCache(
   arch: Architecture,
@@ -172,102 +172,3 @@ function resolveChecksum(
 function getExtension(platform: Platform): string {
   return platform === "pc-windows-msvc" ? ".zip" : ".tar.gz";
 }
-
-export async function resolveVersion(
-  versionInput: string,
-  manifestUrl: string | undefined,
-  resolutionStrategy: "highest" | "lowest" = "highest",
-): Promise {
-  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 {
-  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;
-}
diff --git a/src/download/manifest.ts b/src/download/manifest.ts
index a033334..6144042 100644
--- a/src/download/manifest.ts
+++ b/src/download/manifest.ts
@@ -111,6 +111,9 @@ export async function getLatestVersion(
 export async function getAllVersions(
   manifestUrl: string = VERSIONS_MANIFEST_URL,
 ): Promise {
+  core.info(
+    `Getting available versions from ${manifestSource(manifestUrl)} ...`,
+  );
   const versions = await fetchManifest(manifestUrl);
   return versions.map((versionData) => versionData.version);
 }
@@ -165,6 +168,14 @@ export function clearManifestCache(manifestUrl?: string): void {
   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 {
   if (!isRecord(value)) {
     return false;
diff --git a/src/setup-uv.ts b/src/setup-uv.ts
index e1d40c2..33d9d9b 100644
--- a/src/setup-uv.ts
+++ b/src/setup-uv.ts
@@ -5,7 +5,6 @@ import * as exec from "@actions/exec";
 import { restoreCache } from "./cache/restore-cache";
 import {
   downloadVersion,
-  resolveVersion,
   tryGetFromToolCache,
 } from "./download/download-version";
 import { STATE_UV_PATH, STATE_UV_VERSION } from "./utils/constants";
@@ -16,7 +15,7 @@ import {
   getPlatform,
   type Platform,
 } from "./utils/platforms";
-import { getUvVersionFromFile } from "./version/resolve";
+import { resolveUvVersion } from "./version/resolve";
 
 const sourceDir = __dirname;
 
@@ -112,7 +111,13 @@ async function setupUv(
   platform: Platform,
   arch: Architecture,
 ): Promise<{ uvDir: string; version: string }> {
-  const resolvedVersion = await determineVersion(inputs);
+  const resolvedVersion = await resolveUvVersion({
+    manifestFile: inputs.manifestFile,
+    resolutionStrategy: inputs.resolutionStrategy,
+    version: inputs.version,
+    versionFile: inputs.versionFile,
+    workingDirectory: inputs.workingDirectory,
+  });
   const toolCacheResult = tryGetFromToolCache(arch, resolvedVersion);
   if (toolCacheResult.installedPath) {
     core.info(`Found uv in tool-cache for ${toolCacheResult.version}`);
@@ -137,45 +142,6 @@ async function setupUv(
   };
 }
 
-async function determineVersion(inputs: SetupInputs): Promise {
-  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 {
   core.setOutput("uv-path", `${cachedPath}${path.sep}uv`);
   core.saveState(STATE_UV_PATH, `${cachedPath}${path.sep}uv`);
diff --git a/src/utils/config-file.ts b/src/utils/config-file.ts
index 1633431..958705f 100644
--- a/src/utils/config-file.ts
+++ b/src/utils/config-file.ts
@@ -8,7 +8,19 @@ export function getConfigValueFromTomlFile(
   if (!fs.existsSync(filePath) || !filePath.endsWith(".toml")) {
     return undefined;
   }
+
   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")) {
     const tomlContent = toml.parse(fileContent) as {
@@ -16,6 +28,7 @@ export function getConfigValueFromTomlFile(
     };
     return tomlContent?.tool?.uv?.[key];
   }
+
   const tomlContent = toml.parse(fileContent) as Record<
     string,
     string | undefined
diff --git a/src/version/file-parser.ts b/src/version/file-parser.ts
new file mode 100644
index 0000000..2df7348
--- /dev/null
+++ b/src/version/file-parser.ts
@@ -0,0 +1,103 @@
+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));
+}
diff --git a/src/version/requirements-file.ts b/src/version/requirements-file.ts
index 2ef3904..b21728a 100644
--- a/src/version/requirements-file.ts
+++ b/src/version/requirements-file.ts
@@ -5,31 +5,23 @@ export function getUvVersionFromRequirementsFile(
   filePath: string,
 ): string | undefined {
   const fileContent = fs.readFileSync(filePath, "utf-8");
+
   if (filePath.endsWith(".txt")) {
-    return getUvVersionFromAllDependencies(fileContent.split("\n"));
+    return getUvVersionFromRequirementsText(fileContent);
   }
-  const dependencies = parsePyprojectDependencies(fileContent);
-  return getUvVersionFromAllDependencies(dependencies);
+
+  return getUvVersionFromPyprojectContent(fileContent);
 }
-function getUvVersionFromAllDependencies(
-  allDependencies: string[],
+
+export function getUvVersionFromRequirementsText(
+  fileContent: string,
 ): string | undefined {
-  return allDependencies
-    .find((dep: string) => dep.match(/^uv[=<>~!]/))
-    ?.match(/^uv([=<>~!]+\S*)/)?.[1]
-    .trim();
+  return getUvVersionFromAllDependencies(fileContent.split("\n"));
 }
 
-interface Pyproject {
-  project?: {
-    dependencies?: string[];
-    "optional-dependencies"?: Record;
-  };
-  "dependency-groups"?: Record>;
-}
-
-function parsePyprojectDependencies(pyprojectContent: string): string[] {
-  const pyproject: Pyproject = toml.parse(pyprojectContent);
+export function getUvVersionFromParsedPyproject(
+  pyproject: Pyproject,
+): string | undefined {
   const dependencies: string[] = pyproject?.project?.dependencies || [];
   const optionalDependencies: string[] = Object.values(
     pyproject?.project?.["optional-dependencies"] || {},
@@ -39,5 +31,39 @@ function parsePyprojectDependencies(pyprojectContent: string): string[] {
   )
     .flat()
     .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;
+  };
+  "dependency-groups"?: Record>;
+  tool?: {
+    uv?: Record;
+  };
+}
+
+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();
 }
diff --git a/src/version/resolve.ts b/src/version/resolve.ts
index 42106cb..babf678 100644
--- a/src/version/resolve.ts
+++ b/src/version/resolve.ts
@@ -1,34 +1,183 @@
-import fs from "node:fs";
 import * as core from "@actions/core";
-import { getConfigValueFromTomlFile } from "../utils/config-file";
-import { getUvVersionFromRequirementsFile } from "./requirements-file";
-import { getUvVersionFromToolVersions } from "./tool-versions-file";
+import * as tc from "@actions/tool-cache";
+import * as pep440 from "@renovatebot/pep440";
+import * as semver from "semver";
+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";
 
-export function getUvVersionFromFile(filePath: string): string | undefined {
-  core.info(`Trying to find version for uv in: ${filePath}`);
-  if (!fs.existsSync(filePath)) {
-    core.info(`Could not find file: ${filePath}`);
-    return undefined;
-  }
-  let uvVersion: string | undefined;
-  try {
-    uvVersion = getUvVersionFromToolVersions(filePath);
-    if (uvVersion === undefined) {
-      uvVersion = getConfigValueFromTomlFile(filePath, "required-version");
-    }
-    if (uvVersion === undefined) {
-      uvVersion = getUvVersionFromRequirementsFile(filePath);
-    }
-  } catch (err) {
-    const message = (err as Error).message;
-    core.warning(`Error while parsing ${filePath}: ${message}`);
-    return undefined;
-  }
-  if (uvVersion?.startsWith("==")) {
-    uvVersion = uvVersion.slice(2);
-  }
-  if (uvVersion !== undefined) {
-    core.info(`Found version for uv in ${filePath}: ${uvVersion}`);
-  }
-  return uvVersion;
+interface ConcreteVersionResolutionContext {
+  manifestUrl?: string;
+  parsedSpecifier: ParsedVersionSpecifier;
+  resolutionStrategy: ResolutionStrategy;
+}
+
+interface ConcreteVersionResolver {
+  resolve(
+    context: ConcreteVersionResolutionContext,
+  ): Promise;
+}
+
+class ExactVersionResolver implements ConcreteVersionResolver {
+  async resolve(
+    context: ConcreteVersionResolutionContext,
+  ): Promise {
+    if (context.parsedSpecifier.kind !== "exact") {
+      return undefined;
+    }
+
+    core.debug(
+      `Version ${context.parsedSpecifier.normalized} is an explicit version.`,
+    );
+    return context.parsedSpecifier.normalized;
+  }
+}
+
+class LatestVersionResolver implements ConcreteVersionResolver {
+  async resolve(
+    context: ConcreteVersionResolutionContext,
+  ): Promise {
+    const shouldUseLatestVersion =
+      context.parsedSpecifier.kind === "latest" ||
+      (context.parsedSpecifier.kind === "range" &&
+        context.parsedSpecifier.isSimpleMinimumVersionSpecifier &&
+        context.resolutionStrategy === "highest");
+
+    if (!shouldUseLatestVersion) {
+      return undefined;
+    }
+
+    if (
+      context.parsedSpecifier.kind === "range" &&
+      context.parsedSpecifier.isSimpleMinimumVersionSpecifier
+    ) {
+      core.info("Found minimum version specifier, using latest version");
+    }
+
+    const latestVersion = await getLatestVersion(context.manifestUrl);
+
+    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;
+  }
+}
+
+class RangeVersionResolver implements ConcreteVersionResolver {
+  async resolve(
+    context: ConcreteVersionResolutionContext,
+  ): Promise {
+    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 {
+  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 {
+  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;
 }
diff --git a/src/version/specifier.ts b/src/version/specifier.ts
new file mode 100644
index 0000000..bb042d9
--- /dev/null
+++ b/src/version/specifier.ts
@@ -0,0 +1,59 @@
+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,
+  };
+}
diff --git a/src/version/types.ts b/src/version/types.ts
new file mode 100644
index 0000000..f7666fe
--- /dev/null
+++ b/src/version/types.ts
@@ -0,0 +1,34 @@
+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;
+}
diff --git a/src/version/version-request-resolver.ts b/src/version/version-request-resolver.ts
new file mode 100644
index 0000000..12ca84a
--- /dev/null
+++ b/src/version/version-request-resolver.ts
@@ -0,0 +1,158 @@
+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;
+}