Skip to content

Commit 4601db6

Browse files
committed
ci: Install pytest via apt(8)
With Ubuntu 24.04 installing it via pip gave this error error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installed. See /usr/share/doc/python3.12/README.venv for more information. Installing it via the package manager is the better option anyway... Under Ubuntu 22.04 it only installs a /usr/bin/pytest-3 binary, rather than installing a /usr/bin/pytest binary and symlink for pytest-3, so use pytest-3 as the command. Signed-off-by: Andrew Clayton <[email protected]>
1 parent e03697b commit 4601db6

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

.github/workflows/ci.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -360,18 +360,15 @@ jobs:
360360

361361
- name: Install pytest
362362
run: |
363-
if [ "${{ matrix.build }}" == "wasm-wasi-component" ]; then
364-
pip install pytest
365-
else
366-
sudo -H pip install pytest
367-
fi
363+
sudo apt install -y python3-pytest
364+
368365
if: steps.metadata.outputs.module != 'wasm'
369366

370367
- name: Run ${{ steps.metadata.outputs.module }} tests
371368
run: |
372369
if [ "${{ matrix.build }}" == "wasm-wasi-component" ]; then
373-
pytest --print-log ${{ steps.metadata.outputs.testpath }}
370+
pytest-3 --print-log ${{ steps.metadata.outputs.testpath }}
374371
else
375-
sudo -E pytest --print-log ${{ steps.metadata.outputs.testpath }}
372+
sudo -E pytest-3 --print-log ${{ steps.metadata.outputs.testpath }}
376373
fi
377374
if: steps.metadata.outputs.module != 'wasm'

0 commit comments

Comments
 (0)