Skip to content

Commit b1558a0

Browse files
committed
More tweaks.
1 parent 0055bee commit b1558a0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

python/doc/source/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import mpi4py
1010

1111
import numpy as np
12+
import packaging
1213

1314
import basix
1415
import dolfinx
@@ -159,11 +160,14 @@
159160

160161
codeautolink_concat_default = True
161162

163+
# Could be reimplemented using packaging.version
162164
dolfinx_version = "main" if "dev0" in dolfinx.__version__ else "v" + dolfinx.__version__
163165
basix_version = "main" if "dev0" in basix.__version__ else "v" + basix.__version__
164166
ffcx_version = "main" if "dev0" in ffcx.__version__ else "v" + ffcx.__version__
165167
ufl_version = "main" if "dev0" in ufl.__version__ else ufl.__version__
166-
numpy_version = "".join(np.__version__.split(".")[:-1]) # major.minor
168+
169+
numpy_version = packaging.version.parse(np.__version__)
170+
numpy_doc_version = f"{numpy_version.major}.{numpy_version.minor}"
167171

168172
# Note that as of late 2025 pyvista and petsc4py only have docs for the latest
169173
# releases.
@@ -173,7 +177,7 @@
173177
None,
174178
),
175179
"numpy": (
176-
f"https://numpy.org/doc/{numpy_version}",
180+
f"https://numpy.org/doc/{numpy_doc_version}",
177181
None,
178182
),
179183
"pyvista": (

0 commit comments

Comments
 (0)