diff options
author | Andrew Clayton <a.clayton@nginx.com> | 2024-10-15 22:29:51 +0100 |
---|---|---|
committer | Andrew Clayton <a.clayton@nginx.com> | 2024-10-17 00:05:43 +0100 |
commit | 4601db6480b65e6ff00351a42fa9278a8b30fab4 (patch) | |
tree | c8cceb3b22c6e78de7b4d85bcf4a300506b1bb5e /.github/workflows | |
parent | e03697bade96eb19faf43e90e2ed8da86e07b4cc (diff) | |
download | unit-4601db6480b65e6ff00351a42fa9278a8b30fab4.tar.gz unit-4601db6480b65e6ff00351a42fa9278a8b30fab4.tar.bz2 |
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 <a.clayton@nginx.com>
Diffstat (limited to '.github/workflows')
-rw-r--r-- | .github/workflows/ci.yml | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a7d0e715..672b82e0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -360,18 +360,15 @@ jobs: - name: Install pytest run: | - if [ "${{ matrix.build }}" == "wasm-wasi-component" ]; then - pip install pytest - else - sudo -H pip install pytest - fi + sudo apt install -y python3-pytest + if: steps.metadata.outputs.module != 'wasm' - name: Run ${{ steps.metadata.outputs.module }} tests run: | if [ "${{ matrix.build }}" == "wasm-wasi-component" ]; then - pytest --print-log ${{ steps.metadata.outputs.testpath }} + pytest-3 --print-log ${{ steps.metadata.outputs.testpath }} else - sudo -E pytest --print-log ${{ steps.metadata.outputs.testpath }} + sudo -E pytest-3 --print-log ${{ steps.metadata.outputs.testpath }} fi if: steps.metadata.outputs.module != 'wasm' |