CosmoStat / wf-psf

Data-driven wavefront-based PSF modelling framework.
MIT License
19 stars 9 forks source link

Bug: CI fails with pytest 8.1.dev #125

Open jeipollack opened 9 months ago

jeipollack commented 9 months ago

Related issue: https://github.com/pytest-dev/pytest/issues/11779 opened by astropy developer.

Response: https://github.com/pytest-dev/pytest/issues/11779#issuecomment-1879387034

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.