Use pytest config in pyproject.toml in CI#7555
Conversation
This should be safe, as the pytest documentation [1] states that "rootdir is NOT used to modify sys.path/PYTHONPATH". So while the `--config-file` option affects the `rootdir`, it's not adding that directory to the PYTHONPATH where it could accidentally overwrite the installed package. This solution is somewhat unsatisfying. Personally, I think a better approach would be to switch to the src-layout. [1] https://docs.pytest.org/en/7.1.x/reference/customize.html?highlight=rootdir#initialization-determining-rootdir-and-configfile
1099802 to
5eb180a
Compare
I believe this warning disappeared with tifffile 2024.4.24 which added support for NumPy 2.
|
During the meeting @stefanv suggested to use a different approach and just not step out of the project directory. It was suggested that that may be outdated behavior from a long time ago. 😅 |
|
Close in favor of #7670. |
acc76ca to
0f86606
Compare
33840e9 to
af51522
Compare
98ebcc5 to
30cd057
Compare
c42b347 to
7ddd77f
Compare
|
May not look like it, but we're close 😅 |
7ddd77f to
816328a
Compare
|
The remaining failure is pyamg related. |
|
Looks like pytest is turning the innocuous warning raised by pyamg into an exception. |
8564112 to
f50c1e2
Compare
f50c1e2 to
012137c
Compare
Leaving this commented is probably an oversight from scikit-imagegh-7576 / a7b54a8.
| CIBW_TEST_COMMAND: > | ||
| pip list --pre --format=freeze | grep -q 'numpy==2' && | ||
| pytest --pyargs skimage | ||
| (cd .. && $PYTEST --pyargs skimage) |
There was a problem hiding this comment.
Should check if this actually works after merging this.
| 'sphinx-copybutton', | ||
| 'matplotlib>=3.7', | ||
| 'dask[array]>=2022.9.2', | ||
| 'dask[array]>=2023.2.0', |
There was a problem hiding this comment.
Guessing that this is done in accordance with SPEC0?
| @pytest.mark.xfail( | ||
| Version(np.__version__) >= Version('2.0.0.dev0'), | ||
| reason='tifffile uses deprecated attribute `ndarray.newbyteorder`', | ||
| ) |
There was a problem hiding this comment.
I guess this issue cgohlke/tifffile#238 was addressed in tifffile 2024.1.30.
Should we update to tifffile 2024.1.30? I guess it might be possible that there are some combinations of our dependencies that still raise this warning or even fail but probably rare and fix-able with bumping tifffile or downgrading NumPy.
So I think we can leave tifffile be.
| # Don't use the cache provider plugin, as it doesn't work with Pyodide | ||
| # right now: https://github.com/pypa/cibuildwheel/issues/1966 | ||
| # pytest -svra -p no:cacheprovider --pyargs skimage | ||
| $PYTEST -svra -p no:cacheprovider --pyargs skimage |
There was a problem hiding this comment.
I uncommented this line in c3e6af1. Feel free to revert if I missed something here.
|
Merged since it seems like 2 core devs approved. |
…ailure * origin/main: Add zizmor to pre-commit; address GH workflow issues raised (scikit-image#7662) Reenable test marked as flaky on Azure. (scikit-image#7694) Simultaneously resolve all dependencies; add pip caching (scikit-image#7690) Copy keypoints if necessary to preserve contiguity (scikit-image#7692) CI cleanup (scikit-image#7693) Port CI testing from Azure to GitHub (scikit-image#7687) Lower CI build verbosity Use pytest config in pyproject.toml in CI (scikit-image#7555) Improve docstring for rolling_ball function. (scikit-image#7682)
Description
Closes #7554.
This should be safe, as the pytest documentation states that
So while the
--config-fileoption affects therootdir, it's not adding that directory to the PYTHONPATH where it could accidentally overwrite the installed package.Checklist
./doc/examplesfor new featuresRelease note
For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.