Skip to content

Commit

Permalink
Merge pull request #1337 from effigies/fix/doctest
Browse files Browse the repository at this point in the history
FIX: Use legacy numpy printing during doc builds/tests
  • Loading branch information
effigies authored Jul 6, 2024
2 parents 30a5f3f + 170b20c commit 0a700fe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
import tomli as tomllib

# Check for external Sphinx extensions we depend on
try:
import numpy as np
except ImportError:
raise RuntimeError('Need to install "numpy" package for doc build')
try:
import numpydoc
except ImportError:
Expand All @@ -45,6 +49,11 @@
'Need nibabel on Python PATH; consider "make htmldoc" from nibabel root directory'
)

from packaging.version import Version

if Version(np.__version__) >= Version('1.22'):
np.set_printoptions(legacy='1.21')

# -- General configuration ----------------------------------------------------

# We load the nibabel release info into a dict by explicit execution
Expand Down

0 comments on commit 0a700fe

Please sign in to comment.