Skip to content

Commit

Permalink
Merge pull request #127 from effigies/fix/numpy2
Browse files Browse the repository at this point in the history
test: Numpy 2.0 compatibility
  • Loading branch information
effigies authored Aug 19, 2024
2 parents c980e13 + 449edfa commit e0a30e6
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 e0a30e6

Please sign in to comment.