From 327e6c8a3064743eb073128d5cc5c4044be30561 Mon Sep 17 00:00:00 2001 From: Ben Creech Date: Sat, 12 Oct 2024 14:50:16 -0400 Subject: [PATCH] Use venv for tests https://github.com/adrienverge/localstripe/pull/232 is failing with a "This environment is externally managed" error from pip because it's trying to install to the system Python. For some reason this doesn't happen on a fork, e.g., https://github.com/bpcreech/localstripe/pull/2. I assume this is due to a Github probably runner change; I'm not sure whether intentional. Anyway we can fix this by using a venv, which is best practice anyway. --- .github/workflows/tests.yaml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a6938ab..018287a 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -41,10 +41,19 @@ jobs: uses: actions/setup-python@v4 with: python-version: ${{ matrix.pyver }} - - run: pip install 'pip >=23' build - - run: python -m build - - run: pip install dist/localstripe-*.tar.gz - - run: python -m localstripe & + - run: python -m venv venv + - run: | + source venv/bin/activate + pip install 'pip >=23' build + - run: | + source venv/bin/activate + python -m build + - run: | + source venv/bin/activate + pip install dist/localstripe-*.tar.gz + - run: | + source venv/bin/activate + python -m localstripe & # Wait for server to be up: - run: > timeout=5; while [ $((timeout--)) -ge 0 ]; do