Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: CI fails with pytest 8.1.dev #125

Open
jeipollack opened this issue Mar 4, 2024 · 0 comments
Open

Bug: CI fails with pytest 8.1.dev #125

jeipollack opened this issue Mar 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jeipollack
Copy link
Contributor

jeipollack commented Mar 4, 2024

Related issue: pytest-dev/pytest#11779 opened by astropy developer.

Response: pytest-dev/pytest#11779 (comment)

py.path -> pathlib.Path transition, the py.path hook parameters have been deprecated in the 7.x series, changed to an error in 8.0, and finally removed in 8.1. It seems like the pytest_ignore_collect hook implementation in the pytest_filter_subpackage plugin still uses the deprecated path argument, should use collection_path instead (available since pytest 7.0.0).

If you can require pytest>=7, then can just replace path -> collection_path (and possibly adjust for py.path.local -> Path).

If you still need to support pytest<7, you'll have to do something like the following I'm afraid:

if PYTEST_GTE_7:
def pytest_ignore_collect(collection_path):
...
else:
def pytest_ignore_collect(path):
...

Run python -m pytest
...
Argument(s) {'path'} are declared in the hookimpl but can not be found in the hookspec
[49](https://github.com/jeipollack/wf-psf/actions/runs/8139196676/job/22241824219#step:5:50)
Error: Process completed with exit code 1.

I saw someone add it to their conftest.py but I don't fully understand the implementation as it seems to go a bit deep into pytest packages and wrappers I'm unfamiliar with. The other solution I've seen is to lock pytest <8.0.0 until needed pytest-plugin updates. However, we know we can use pytest==8.0.x, so perhaps we do the same.

@jeipollack jeipollack added the bug Something isn't working label Mar 4, 2024
@jeipollack jeipollack changed the title CI fails with pytest 8.1.dev Bug: CI fails with pytest 8.1.dev Mar 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant