From ab08402af9125efb4b1a667b2943259b5765c534 Mon Sep 17 00:00:00 2001 From: Aleksandr Meshchriakov Date: Tue, 28 Apr 2026 16:22:53 +0200 Subject: [PATCH] ci: ignore stale project venv in runner --- .gitea/workflows/ci-cd.yml | 1 + scripts/ensure-ci-python.sh | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/.gitea/workflows/ci-cd.yml b/.gitea/workflows/ci-cd.yml index 0214394..b930892 100644 --- a/.gitea/workflows/ci-cd.yml +++ b/.gitea/workflows/ci-cd.yml @@ -84,6 +84,7 @@ jobs: - name: Install Python and uv run: | set -euo pipefail + rm -rf .venv .ci-python-env PROJECT_PYTHON_VERSION="$(cat .python-version 2>/dev/null || printf '%s' "${PYTHON_VERSION}")" PYTHON_BIN="$(./scripts/ensure-ci-python.sh "${PROJECT_PYTHON_VERSION}")" diff --git a/scripts/ensure-ci-python.sh b/scripts/ensure-ci-python.sh index d63c9b1..09f4b2c 100755 --- a/scripts/ensure-ci-python.sh +++ b/scripts/ensure-ci-python.sh @@ -33,6 +33,11 @@ python_has_venv() { print_if_usable() { local candidate="$1" + case "${candidate}" in + "${PWD}/.venv/"*) + return 1 + ;; + esac if python_matches "${candidate}" && python_has_venv "${candidate}"; then printf '%s\n' "${candidate}" exit 0