diff --git a/0001-Replace-deprecated-mne.utils.requires_version.patch b/0001-Replace-deprecated-mne.utils.requires_version.patch new file mode 100644 index 0000000..63147be --- /dev/null +++ b/0001-Replace-deprecated-mne.utils.requires_version.patch @@ -0,0 +1,45 @@ +From 3cca6cb85f24a00d50796fb7cca43ef13ef81bbc Mon Sep 17 00:00:00 2001 +From: "Benjamin A. Beasley" +Date: Tue, 26 Sep 2023 09:41:18 -0400 +Subject: [PATCH] Replace deprecated mne.utils.requires_version + +This function is deprecated and will be removed in a future release; see: + +https://github.com/mne-tools/mne-python/commit/84da5551c77a05596dc35362f004f98375f1a8de + +Use the recommended replacement pytest.importorskip() instead. +--- + pybv/tests/test_bv_writer.py | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/pybv/tests/test_bv_writer.py b/pybv/tests/test_bv_writer.py +index 01c2c23..89189a8 100644 +--- a/pybv/tests/test_bv_writer.py ++++ b/pybv/tests/test_bv_writer.py +@@ -19,7 +19,6 @@ from datetime import datetime, timezone + import mne + import numpy as np + import pytest +-from mne.utils import requires_version + from numpy.testing import assert_allclose, assert_array_equal + + from pybv.io import (SUPPORTED_FORMATS, SUPPORTED_VOLTAGE_SCALINGS, +@@ -162,7 +161,6 @@ def test_bad_meas_date(tmpdir, meas_date, match): + meas_date=meas_date) + + +-@requires_version("mne", min_version="0.22") + @pytest.mark.parametrize("ch_names_tricky", + [[ch + ' f o o' for ch in ch_names], + [ch + ',foo' for ch in ch_names], +@@ -170,6 +168,7 @@ def test_bad_meas_date(tmpdir, meas_date, match): + ) + def test_comma_in_ch_name(tmpdir, ch_names_tricky): + """Test that writing channel names with special characters works.""" ++ mne = pytest.importorskip("mne", minversion="0.22") + # write and read data to BV format + write_brainvision(data=data, sfreq=sfreq, ch_names=ch_names_tricky, + fname_base=fname, folder_out=tmpdir) +-- +2.41.0 + diff --git a/python-pybv.spec b/python-pybv.spec index f7988db..fb4ef49 100644 --- a/python-pybv.spec +++ b/python-pybv.spec @@ -21,6 +21,11 @@ License: BSD URL: https://pybv.readthedocs.io/en/stable/ Source0: https://github.com/bids-standard/pybv/archive/v%{version}/pybv-%{version}.tar.gz +# Replace deprecated mne.utils.requires_version +# https://github.com/bids-standard/pybv/pull/105 +# Rebased to v0.6.0. +Patch: 0001-Replace-deprecated-mne.utils.requires_version.patch + BuildArch: noarch ExcludeArch: %{ix86} @@ -34,7 +39,7 @@ BuildRequires: %{py3_dist mne} %description -n python3-pybv %_description %prep -%autosetup -n pybv-%{version} +%autosetup -n pybv-%{version} -p1 rm -rf pybv.egg-info find . -type f -name "*.py" -exec sed -i '/^#![ ]*\/usr\/bin\/env.*$/ d' {} 2>/dev/null ';'