From 09eb06a54732b9777c7a57e53efb32f1e7c779fc Mon Sep 17 00:00:00 2001 From: ProtocolWarden <32967198+ProtocolWarden@users.noreply.github.com> Date: Thu, 4 Jun 2026 16:25:52 -0400 Subject: [PATCH] fix(ci): run pytest inside .venv to satisfy conftest venv guard The Test (pytest) job installed into the runner's system Python and invoked pytest directly. tests/conftest.py enforces that pytest runs from the project's .venv (exiting 2 otherwise), so CI failed before collecting any tests. Create a .venv in the test job and run install + pytest through it, satisfying the guard's contract without weakening the local-dev safety check (the CUSTODIAN_SKIP_VENV_GUARD escape hatch is left intact). Co-Authored-By: Claude Opus 4.8 --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9f66924..fc9469a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,7 +42,11 @@ jobs: - uses: actions/setup-python@v5 with: python-version: "3.11" + - name: Create virtual environment + run: python -m venv .venv - name: Install dependencies - run: pip install -e ".[dev]" + run: | + .venv/bin/python -m pip install --upgrade pip + .venv/bin/python -m pip install -e ".[dev]" - name: Run tests - run: pytest -q + run: .venv/bin/pytest -q