From a45d0b07509b40ac0701ba72d9d892c46b9ec386 Mon Sep 17 00:00:00 2001 From: Eliah Kagan Date: Tue, 13 Feb 2024 18:31:24 -0500 Subject: [PATCH] Use venv on Alpine Linux To overcome "This environment is externally managed" blocker. --- .github/workflows/alpine-test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/alpine-test.yml b/.github/workflows/alpine-test.yml index 6de18d306..46b5f139d 100644 --- a/.github/workflows/alpine-test.yml +++ b/.github/workflows/alpine-test.yml @@ -38,17 +38,24 @@ jobs: # and cause subsequent tests to fail cat test/fixtures/.gitconfig >> ~/.gitconfig + - name: Create Python virtual environment + run: | + python -m venv .venv + - name: Update PyPA packages run: | # Get the latest pip, wheel, and prior to Python 3.12, setuptools. + . .venv/bin/activate python -m pip install -U pip $(pip freeze --all | grep -ow ^setuptools) wheel - name: Install project and test dependencies run: | + . .venv/bin/activate pip install ".[test]" - name: Show version and platform information run: | + . .venv/bin/activate uname -a command -v git python git version @@ -57,4 +64,5 @@ jobs: - name: Test with pytest run: | + . .venv/bin/activate pytest --color=yes -p no:sugar --instafail -vv