From d53c3d290f704bff4860985403079b9cd2029748 Mon Sep 17 00:00:00 2001 From: cfdaily Date: Thu, 11 Jun 2026 11:15:47 +0800 Subject: [PATCH] fix(ci): install pytest when pyproject.toml is missing Root cause: ci.yml test job creates .venv but skips dev install when pyproject.toml is absent, leaving pytest uninstalled. Then .venv/bin/pytest fails with 'No such file or directory'. Fix: Install pytest directly when no pyproject.toml, and use /tmp path to avoid workspace pollution. --- .gitea/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 1514dea..c779fff 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -47,17 +47,17 @@ jobs: - name: Setup Python run: | - python3 -m venv .venv + python3 -m venv /tmp/ci-venv-test if [ -f pyproject.toml ]; then - .venv/bin/pip install --quiet -e ".[dev]" + /tmp/ci-venv-test/bin/pip install --quiet -e ".[dev]" else - echo "No pyproject.toml, skipping dev install" + /tmp/ci-venv-test/bin/pip install --quiet pytest fi - name: Run tests (exclude E2E) run: | if [ -d tests ]; then - .venv/bin/pytest tests/ -m "not e2e" -x -q + /tmp/ci-venv-test/bin/pytest tests/ -m "not e2e" -x -q else echo "No tests/ directory, skipping tests" fi