Skip to content

Commit

Permalink
test: Numpy 2.0 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Aug 19, 2024
1 parent c980e13 commit 449edfa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions nireports/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ dependencies = [
"nibabel >= 3.0.1",
"nilearn >= 0.5.2",
"nipype",
"numpy < 2.0",
"numpy",
"pandas",
"pybids",
"pyyaml",
Expand Down Expand Up @@ -57,6 +57,7 @@ dev = [
test = [
"coverage",
"matplotlib",
"packaging",
"pytest",
"pytest-cov",
"pytest-env",
Expand Down

0 comments on commit 449edfa

Please sign in to comment.