From 284e19ef88cc615f3473e33e35a6ed084d11b07d Mon Sep 17 00:00:00 2001 From: mr-forust Date: Sun, 27 Sep 2026 10:19:27 +0200 Subject: [PATCH] ci: pin uv, the tool that builds the pytest venv The panel backend has 25 pytest tests that no workflow has ever run. Making them run needs a throwaway virtualenv, and uv is what builds it in seconds against the pinned requirements-dev.txt. Installing it through install-ci-tools.sh rather than assuming it is on the runner keeps the version in one place, where the other three tools already live, and where the Renovate regex manager can move it. Co-Authored-By: Claude Opus 4.8 (1M context) --- .gitea/workflows/install-ci-tools.sh | 15 +++++++++++++++ .gitea/workflows/tool-versions.env | 2 ++ renovate/k8s/configmap.yaml | 8 ++++++++ renovate/renovate.json | 8 ++++++++ 4 files changed, 33 insertions(+) diff --git a/.gitea/workflows/install-ci-tools.sh b/.gitea/workflows/install-ci-tools.sh index 091778b..04873bc 100755 --- a/.gitea/workflows/install-ci-tools.sh +++ b/.gitea/workflows/install-ci-tools.sh @@ -93,6 +93,20 @@ install_shellcheck() { rm -rf "$tmp" } +install_uv() { + if at_version uv "${UV_VERSION}"; then + return 0 + fi + local tmp + tmp="$(mktemp -d)" + # uv release tags carry no leading v, unlike every other tool installed here. + fetch "https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/uv-${sharch}-unknown-linux-gnu.tar.gz" \ + "$tmp/uv.tar.gz" + tar -xzf "$tmp/uv.tar.gz" -C "$tmp" --strip-components=1 "uv-${sharch}-unknown-linux-gnu/uv" + install -m 0755 "$tmp/uv" "$BIN_DIR/uv" + rm -rf "$tmp" +} + install_actionlint() { if at_version actionlint "${ACTIONLINT_VERSION}"; then return 0 @@ -116,6 +130,7 @@ for tool in "${wanted[@]}"; do kubeconform) install_kubeconform ;; shellcheck) install_shellcheck ;; actionlint) install_actionlint ;; + uv) install_uv ;; *) echo "install-ci-tools: unknown tool: $tool" >&2 exit 1 diff --git a/.gitea/workflows/tool-versions.env b/.gitea/workflows/tool-versions.env index ade7ec2..ecc9926 100644 --- a/.gitea/workflows/tool-versions.env +++ b/.gitea/workflows/tool-versions.env @@ -7,3 +7,5 @@ ACTIONLINT_VERSION="1.7.7" SHELLCHECK_VERSION="0.11.0" KUBECONFORM_VERSION="0.8.0" +# uv builds the throwaway venv the pytest job runs in. +UV_VERSION="0.12.17" diff --git a/renovate/k8s/configmap.yaml b/renovate/k8s/configmap.yaml index a77b0aa..a30d0c5 100644 --- a/renovate/k8s/configmap.yaml +++ b/renovate/k8s/configmap.yaml @@ -93,6 +93,14 @@ data: "datasourceTemplate": "github-tags", "depNameTemplate": "yannh/kubeconform" }, + { + "customType": "regex", + "description": "uv version used to build the pytest venv", + "managerFilePatterns": ["^\\.gitea/workflows/tool-versions\\.env$"], + "matchStrings": ["(?:^|\\n)UV_VERSION=\"(?[0-9.]+)\""], + "datasourceTemplate": "github-tags", + "depNameTemplate": "astral-sh/uv" + }, { "customType": "regex", "description": "stakater/reloader chart version pinned in the deploy workflow", diff --git a/renovate/renovate.json b/renovate/renovate.json index cd30501..9c7e490 100644 --- a/renovate/renovate.json +++ b/renovate/renovate.json @@ -82,6 +82,14 @@ "datasourceTemplate": "github-tags", "depNameTemplate": "yannh/kubeconform" }, + { + "customType": "regex", + "description": "uv version used to build the pytest venv", + "managerFilePatterns": ["^\\.gitea/workflows/tool-versions\\.env$"], + "matchStrings": ["(?:^|\\n)UV_VERSION=\"(?[0-9.]+)\""], + "datasourceTemplate": "github-tags", + "depNameTemplate": "astral-sh/uv" + }, { "customType": "regex", "description": "stakater/reloader chart version pinned in the deploy workflow",