diff --git a/nireports/conftest.py b/nireports/conftest.py index c67ff257..4fb25190 100644 --- a/nireports/conftest.py +++ b/nireports/conftest.py @@ -41,6 +41,14 @@ test_workdir = os.getenv("TEST_WORK_DIR") +@pytest.fixture(scope="session", autouse=True) +def legacy_printoptions(): + from packaging.version import Version + + if Version(np.__version__) >= Version("1.22"): + np.set_printoptions(legacy="1.21") + + @pytest.fixture(autouse=True) def expand_namespace(doctest_namespace): doctest_namespace["PY_VERSION"] = version_info diff --git a/pyproject.toml b/pyproject.toml index 297e4bc5..b67d93e9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,7 +24,7 @@ dependencies = [ "nibabel >= 3.0.1", "nilearn >= 0.5.2", "nipype", - "numpy < 2.0", + "numpy", "pandas", "pybids", "pyyaml", @@ -57,6 +57,7 @@ dev = [ test = [ "coverage", "matplotlib", + "packaging", "pytest", "pytest-cov", "pytest-env",