From 1c196feba725b15f7a14d2de6cdc3ab7070a1f57 Mon Sep 17 00:00:00 2001 From: Christoph Reiter Date: Fri, 28 Jun 2024 06:46:33 +0200 Subject: [PATCH] CI: run pytest without arguments to avoid stdlib distutils being imported distutils currently doesn't support pytest collection that doesn't start at least at the distutils dir or above (and not distutils/tests) since it requires the local distutils being imported before the tests are run, otherwise the stdlib distutils takes precedence. Adjust the pytest call to not pass a path to work around this. Since pytest currently fails to skip collecting venvs with mingw python (see https://github.com/pytest-dev/pytest/issues/12544) move the venv to /tmp instead. --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d4c7a392e6..9e4bf5bb40 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -146,8 +146,8 @@ jobs: run: | export VIRTUALENV_NO_SETUPTOOLS=1 - python -m virtualenv venv - source venv/bin/activate + python -m virtualenv /tmp/venv + source /tmp/venv/bin/activate # python-ruff doesn't work without rust sed -i '/pytest-ruff/d' pyproject.toml @@ -156,8 +156,8 @@ jobs: - name: Run tests shell: msys2 {0} run: | - source venv/bin/activate - pytest distutils/tests + source /tmp/venv/bin/activate + pytest ci_setuptools: # Integration testing with setuptools