From f981682bdc0ca0235d04629c358643be610a860d Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Thu, 18 Nov 2021 15:08:59 +0100 Subject: Allow recent pytest versions to be used with Spack (#25371) Currently Spack vendors `pytest` at a version which is three major versions behind the latest (3.2.5 vs. 6.2.4). We do that since v3.2.5 is the latest version supporting Python 2.6. Remaining so much behind the currently supported versions though might introduce some incompatibilities and is surely a technical debt. This PR modifies Spack to: - Use the vendored `pytest@3.2.5` only as a fallback solution, if the Python interpreter used for Spack doesn't provide a newer one - Be able to parse `pytest --collect-only` in all the different output formats from v3.2.5 to v6.2.4 and use it consistently for `spack unit-test --list-*` - Updating the unit tests in Github Actions to use a more recent `pytest` version --- .github/workflows/unit_tests.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to '.github') diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index 764a9cdcf0..2e8f9deef6 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -114,7 +114,7 @@ jobs: patchelf cmake bison libbison-dev kcov - name: Install Python packages run: | - pip install --upgrade pip six setuptools codecov coverage[toml] + pip install --upgrade pip six setuptools pytest codecov coverage[toml] # ensure style checks are not skipped in unit tests for python >= 3.6 # note that true/false (i.e., 1/0) are opposite in conditions in python and bash if python -c 'import sys; sys.exit(not sys.version_info >= (3, 6))'; then @@ -173,7 +173,7 @@ jobs: sudo apt-get install -y coreutils kcov csh zsh tcsh fish dash bash - name: Install Python packages run: | - pip install --upgrade pip six setuptools codecov coverage[toml] + pip install --upgrade pip six setuptools pytest codecov coverage[toml] - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -274,7 +274,7 @@ jobs: patchelf kcov - name: Install Python packages run: | - pip install --upgrade pip six setuptools codecov coverage[toml] clingo + pip install --upgrade pip six setuptools pytest codecov coverage[toml] clingo - name: Setup git configuration run: | # Need this for the git tests to succeed. @@ -317,7 +317,7 @@ jobs: - name: Install Python packages run: | pip install --upgrade pip six setuptools - pip install --upgrade codecov coverage[toml] + pip install --upgrade pytest codecov coverage[toml] - name: Setup Homebrew packages run: | brew install dash fish gcc gnupg2 kcov -- cgit v1.2.3-60-g2f50