Skip to content

Allow recent pytest versions to be used with Spack#25371

Merged
alalazo merged 7 commits intospack:developfrom
alalazo:qa/allow_to_use_recent_pytest
Nov 18, 2021
Merged

Allow recent pytest versions to be used with Spack#25371
alalazo merged 7 commits intospack:developfrom
alalazo:qa/allow_to_use_recent_pytest

Conversation

@alalazo
Copy link
Copy Markdown
Member

@alalazo alalazo commented Aug 11, 2021

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 [email protected] 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

@alalazo alalazo force-pushed the qa/allow_to_use_recent_pytest branch from 5ad3419 to 9be123d Compare August 11, 2021 21:34
@alalazo alalazo force-pushed the qa/allow_to_use_recent_pytest branch from 9be123d to 874f951 Compare August 12, 2021 10:50
tgamblin pushed a commit that referenced this pull request Aug 17, 2021
Spack is internally using a patched version of `argparse` mainly to backport Python 3 functionality
into Python 2. This PR makes it such that for the supported Python 3 versions we use `argparse`
from the standard Python library. This PR has been extracted from #25371 where it was needed
to be able to use recent versions of `pytest`.

* Fixed formatting issues when using a pristine argparse.py
* Fix error message for Python 3.X when missing positional arguments
* Account for the change of API in Python 3.7
* Layout multi-valued args into columns in error messages
* Seamless transition in develop if argparse.pyc is in external
* Be more defensive in case we can't remove the file.
@alalazo alalazo added ci Issues related to Continuous Integration maintainers vendored-dependencies labels Aug 18, 2021
@alalazo alalazo force-pushed the qa/allow_to_use_recent_pytest branch from 874f951 to 8e53d6c Compare August 18, 2021 17:42
@alalazo alalazo mentioned this pull request Aug 20, 2021
2 tasks
@alalazo alalazo force-pushed the qa/allow_to_use_recent_pytest branch from 8e53d6c to 4613028 Compare November 17, 2021 17:27
@alalazo alalazo marked this pull request as ready for review November 18, 2021 07:47
@haampie
Copy link
Copy Markdown
Member

haampie commented Nov 18, 2021

Works for me, notice that output has changed its format in github actions, but that's not a big deal.

@alalazo alalazo merged commit f981682 into spack:develop Nov 18, 2021
@alalazo alalazo deleted the qa/allow_to_use_recent_pytest branch November 18, 2021 14:09
linsword13 added a commit to linsword13/ramble that referenced this pull request May 6, 2025
Newer pytest changed its `--collect-only` output, which then busts the
assumption in our code's regex matching. (Spack's corresponding change a
while back: spack/spack#25371.) In this case,
instead of relying on explicit regex parsing, use pytest's `--quiet`
flag to get the `path::test_name` pair.

Also add in test coverage for the unit-test command.
linsword13 added a commit to linsword13/ramble that referenced this pull request May 6, 2025
Newer pytest changed its `--collect-only` output, which then busts the
assumption in our code's regex matching. (Spack's corresponding change a
while back: spack/spack#25371.) In this case,
instead of relying on explicit regex parsing, use pytest's `--quiet`
flag to get the `path::test_name` pair.

Also add in test coverage for the unit-test command.
linsword13 added a commit to linsword13/ramble that referenced this pull request May 6, 2025
Newer pytest changed its `--collect-only` output, which then busts the
assumption in our code's regex matching. (Spack's corresponding change a
while back: spack/spack#25371.) In this case,
instead of relying on explicit regex parsing, use pytest's `--quiet`
flag to get the `path::test_name` pair.

Also add in test coverage for the unit-test command.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Issues related to Continuous Integration maintainers vendored-dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants