Skip to content

Commit

Permalink
Use venv for tests
Browse files Browse the repository at this point in the history
adrienverge#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.,
#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.
  • Loading branch information
Ben Creech committed Oct 12, 2024
1 parent 6c99bee commit 327e6c8
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 327e6c8

Please sign in to comment.