From a670d151c97fb3559d78bca13049c6352377c6d4 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 22 Jan 2024 13:44:04 -0500 Subject: [PATCH 1/9] MAINT: Work around pytest issue --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index abb2e1b3f1b..2e4451fe606 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -109,7 +109,7 @@ full = [ # Dependencies for running the test infrastructure test = [ - "pytest!=8.0.0rc1", + "pytest!=8.0.0rc1,!=8.0.0rc2", "pytest-cov", "pytest-timeout", "pytest-harvest", From 6d08e388075e18477f022006f603fca478bc45b4 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 22 Jan 2024 14:02:48 -0500 Subject: [PATCH 2/9] FIX: More --- pyproject.toml | 1 + tools/azure_dependencies.sh | 7 +------ tools/github_actions_dependencies.sh | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 2e4451fe606..824f3155148 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -72,6 +72,7 @@ full = [ "numba", "h5py", "pandas", + "pyarrow", # only needed to avoid a deprecation warning in pandas "numexpr", "jupyter", "python-picard", diff --git a/tools/azure_dependencies.sh b/tools/azure_dependencies.sh index cce220a8188..b90d42bc5b5 100755 --- a/tools/azure_dependencies.sh +++ b/tools/azure_dependencies.sh @@ -8,12 +8,7 @@ elif [ "${TEST_MODE}" == "pip-pre" ]; then STD_ARGS="$STD_ARGS --pre" python -m pip install $STD_ARGS --only-binary ":all:" --extra-index-url "https://www.riverbankcomputing.com/pypi/simple" "PyQt6!=6.6.1" PyQt6-sip PyQt6-Qt6 "PyQt6-Qt6!=6.6.1" echo "Numpy etc." - # See github_actions_dependencies.sh for comments - # Until https://github.com/scipy/scipy/issues/19605 and - # https://github.com/scipy/scipy/issues/19713 are resolved, we can't use the NumPy - # 2.0 wheels :( - python -m pip install $STD_ARGS --only-binary numpy scipy h5py - python -m pip install $STD_ARGS --only-binary ":all:" --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" scikit-learn matplotlib statsmodels + python -m pip install $STD_ARGS --only-binary ":all:" --default-timeout=60 --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" "numpy>=2.0.0.dev0" "scipy>=1.12.0.dev0" "scikit-learn>=1.5.dev0" matplotlib pillow statsmodels # echo "dipy" # python -m pip install $STD_ARGS --only-binary ":all:" --extra-index-url "https://pypi.anaconda.org/scipy-wheels-nightly/simple" dipy # echo "OpenMEEG" diff --git a/tools/github_actions_dependencies.sh b/tools/github_actions_dependencies.sh index 4c4fb9eb3c2..6beb5b6d726 100755 --- a/tools/github_actions_dependencies.sh +++ b/tools/github_actions_dependencies.sh @@ -28,7 +28,7 @@ else echo "PyQt6" pip install $STD_ARGS --only-binary ":all:" --default-timeout=60 --extra-index-url https://www.riverbankcomputing.com/pypi/simple "PyQt6!=6.6.1" "PyQt6-Qt6!=6.6.1" echo "NumPy/SciPy/pandas etc." - pip install $STD_ARGS --only-binary ":all:" --default-timeout=60 --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" "numpy>=2.0.0.dev0" "scipy>=1.12.0.dev0" "scikit-learn==1.4.dev0" matplotlib pillow statsmodels + pip install $STD_ARGS --only-binary ":all:" --default-timeout=60 --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" "numpy>=2.0.0.dev0" "scipy>=1.12.0.dev0" "scikit-learn>=1.5.dev0" matplotlib pillow statsmodels # No pandas, dipy, h5py, openmeeg, python-picard (needs numexpr) until they update to NumPy 2.0 compat INSTALL_KIND="test_extra" # echo "dipy" From 27b8ebc21d9ffbb17d9074f80108f81e3bb404ef Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 22 Jan 2024 14:41:31 -0500 Subject: [PATCH 3/9] FIX: More --- environment.yml | 1 + tools/github_actions_dependencies.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/environment.yml b/environment.yml index 96c89fe472b..56a5cf37523 100644 --- a/environment.yml +++ b/environment.yml @@ -14,6 +14,7 @@ dependencies: - packaging - numba - pandas + - pyarrow - xlrd - scikit-learn - h5py diff --git a/tools/github_actions_dependencies.sh b/tools/github_actions_dependencies.sh index 6beb5b6d726..b801b458dc8 100755 --- a/tools/github_actions_dependencies.sh +++ b/tools/github_actions_dependencies.sh @@ -28,7 +28,7 @@ else echo "PyQt6" pip install $STD_ARGS --only-binary ":all:" --default-timeout=60 --extra-index-url https://www.riverbankcomputing.com/pypi/simple "PyQt6!=6.6.1" "PyQt6-Qt6!=6.6.1" echo "NumPy/SciPy/pandas etc." - pip install $STD_ARGS --only-binary ":all:" --default-timeout=60 --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" "numpy>=2.0.0.dev0" "scipy>=1.12.0.dev0" "scikit-learn>=1.5.dev0" matplotlib pillow statsmodels + pip install $STD_ARGS --only-binary ":all:" --default-timeout=60 --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" "numpy>=2.0.0.dev0" "scipy>=1.12.0.dev0" "scikit-learn>=1.5.dev0" matplotlib pillow statsmodels pyarrow # No pandas, dipy, h5py, openmeeg, python-picard (needs numexpr) until they update to NumPy 2.0 compat INSTALL_KIND="test_extra" # echo "dipy" From 2c36ff6e108b060a06853de77996e3295394401e Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 22 Jan 2024 14:50:07 -0500 Subject: [PATCH 4/9] FIX: Ignore it --- mne/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mne/conftest.py b/mne/conftest.py index f41bfa1374c..d54930d560f 100644 --- a/mne/conftest.py +++ b/mne/conftest.py @@ -196,6 +196,8 @@ def pytest_configure(config): ignore:ast\.NameConstant is deprecated and will be removed in Python 3\.14.*:DeprecationWarning # pooch ignore:Python 3\.14 will, by default, filter extracted tar archives.*:DeprecationWarning + # pandas + ignore:Pyarrow will become a required dependency of pandas.*:DeprecationWarning """ # noqa: E501 for warning_line in warning_lines.split("\n"): warning_line = warning_line.strip() From 7ad46ccaa8e9e9f91805760510184402dc76e1de Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 22 Jan 2024 15:08:21 -0500 Subject: [PATCH 5/9] FIX: More --- mne/conftest.py | 2 +- tools/azure_dependencies.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mne/conftest.py b/mne/conftest.py index d54930d560f..6c122245f3d 100644 --- a/mne/conftest.py +++ b/mne/conftest.py @@ -197,7 +197,7 @@ def pytest_configure(config): # pooch ignore:Python 3\.14 will, by default, filter extracted tar archives.*:DeprecationWarning # pandas - ignore:Pyarrow will become a required dependency of pandas.*:DeprecationWarning + ignore:\n*Pyarrow will become a required dependency of pandas[\n.]*:DeprecationWarning """ # noqa: E501 for warning_line in warning_lines.split("\n"): warning_line = warning_line.strip() diff --git a/tools/azure_dependencies.sh b/tools/azure_dependencies.sh index b90d42bc5b5..9ee566f3c30 100755 --- a/tools/azure_dependencies.sh +++ b/tools/azure_dependencies.sh @@ -8,7 +8,7 @@ elif [ "${TEST_MODE}" == "pip-pre" ]; then STD_ARGS="$STD_ARGS --pre" python -m pip install $STD_ARGS --only-binary ":all:" --extra-index-url "https://www.riverbankcomputing.com/pypi/simple" "PyQt6!=6.6.1" PyQt6-sip PyQt6-Qt6 "PyQt6-Qt6!=6.6.1" echo "Numpy etc." - python -m pip install $STD_ARGS --only-binary ":all:" --default-timeout=60 --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" "numpy>=2.0.0.dev0" "scipy>=1.12.0.dev0" "scikit-learn>=1.5.dev0" matplotlib pillow statsmodels + python -m pip install $STD_ARGS --only-binary ":all:" --default-timeout=60 --extra-index-url "https://pypi.anaconda.org/scientific-python-nightly-wheels/simple" "numpy>=2.0.0.dev0" "scipy>=1.12.0.dev0" "scikit-learn>=1.5.dev0" matplotlib pillow statsmodels pyarrow # echo "dipy" # python -m pip install $STD_ARGS --only-binary ":all:" --extra-index-url "https://pypi.anaconda.org/scipy-wheels-nightly/simple" dipy # echo "OpenMEEG" From e500750bf1afd0046a32431557ba29401759ce2a Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 22 Jan 2024 15:09:14 -0500 Subject: [PATCH 6/9] FIX: Simplify --- mne/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mne/conftest.py b/mne/conftest.py index 6c122245f3d..84623bd4d7e 100644 --- a/mne/conftest.py +++ b/mne/conftest.py @@ -197,7 +197,7 @@ def pytest_configure(config): # pooch ignore:Python 3\.14 will, by default, filter extracted tar archives.*:DeprecationWarning # pandas - ignore:\n*Pyarrow will become a required dependency of pandas[\n.]*:DeprecationWarning + ignore:\n*Pyarrow will become a required dependency of pandas.*:DeprecationWarning """ # noqa: E501 for warning_line in warning_lines.split("\n"): warning_line = warning_line.strip() From 93673a02f17b74ed034a5f17ef84afc770967066 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 22 Jan 2024 16:26:43 -0500 Subject: [PATCH 7/9] FIX: One more? --- mne/conftest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mne/conftest.py b/mne/conftest.py index 84623bd4d7e..42f1e26c1e7 100644 --- a/mne/conftest.py +++ b/mne/conftest.py @@ -198,6 +198,8 @@ def pytest_configure(config): ignore:Python 3\.14 will, by default, filter extracted tar archives.*:DeprecationWarning # pandas ignore:\n*Pyarrow will become a required dependency of pandas.*:DeprecationWarning + # pyvista <-> NumPy 2.0 + ignore:__array_wrap__ must accept context and return_scalar arguments.*:DeprecationWarning """ # noqa: E501 for warning_line in warning_lines.split("\n"): warning_line = warning_line.strip() From f1d5d76edb8df05feb2b2b99e2cf3ece7173e07c Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 22 Jan 2024 19:32:49 -0500 Subject: [PATCH 8/9] FIX: args --- mne/annotations.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mne/annotations.py b/mne/annotations.py index cc4209bf898..f0f88783b68 100644 --- a/mne/annotations.py +++ b/mne/annotations.py @@ -1616,9 +1616,7 @@ def events_from_annotations( inds = values = np.array([]).astype(int) for annot in annotations[event_sel]: annot_offset = annot["onset"] + annot["duration"] - _onsets = np.arange( - start=annot["onset"], stop=annot_offset, step=chunk_duration - ) + _onsets = np.arange(annot["onset"], annot_offset, chunk_duration) good_events = annot_offset - _onsets >= chunk_duration if good_events.any(): _onsets = _onsets[good_events] From 4046e70329d7903b6345eb00515146e49d7c43b3 Mon Sep 17 00:00:00 2001 From: Eric Larson Date: Mon, 22 Jan 2024 21:59:09 -0500 Subject: [PATCH 9/9] FIX: Two skips --- mne/io/fiff/tests/test_raw_fiff.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mne/io/fiff/tests/test_raw_fiff.py b/mne/io/fiff/tests/test_raw_fiff.py index fa3f04be0c7..f2269b0cb51 100644 --- a/mne/io/fiff/tests/test_raw_fiff.py +++ b/mne/io/fiff/tests/test_raw_fiff.py @@ -7,6 +7,7 @@ import os import pathlib import pickle +import platform import shutil import sys from copy import deepcopy @@ -42,6 +43,7 @@ assert_and_remove_boundary_annot, assert_object_equal, catch_logging, + check_version, requires_mne, run_subprocess, ) @@ -1023,6 +1025,8 @@ def test_proj(tmp_path): @pytest.mark.parametrize("preload", [False, True, "memmap.dat"]) def test_preload_modify(preload, tmp_path): """Test preloading and modifying data.""" + if platform.system() == "Windows" and check_version("numpy", "2.0.0dev"): + pytest.skip("Problem on Windows, see numpy/issues/25665") rng = np.random.RandomState(0) raw = read_raw_fif(fif_fname, preload=preload) @@ -1926,6 +1930,8 @@ def test_equalize_channels(): def test_memmap(tmp_path): """Test some interesting memmapping cases.""" # concatenate_raw + if platform.system() == "Windows" and check_version("numpy", "2.0.0dev"): + pytest.skip("Problem on Windows, see numpy/issues/25665") memmaps = [str(tmp_path / str(ii)) for ii in range(3)] raw_0 = read_raw_fif(test_fif_fname, preload=memmaps[0]) assert raw_0._data.filename == memmaps[0]