Skip to content

Commit 0a6e73e

Browse files
Merge pull request #1161 from ZviBaratz/docs
MRG: update doc build Fixes for configuration change.
2 parents 557a7f2 + e6477cb commit 0a6e73e

File tree

4 files changed

+14
-19
lines changed

4 files changed

+14
-19
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ Thumbs.db
8383
# Things specific to this project #
8484
###################################
8585
doc/source/reference
86+
doc/source/generated
8687
venv/
8788
.buildbot.patch
8889
.vscode

doc/source/conf.py

+8-11
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,11 @@
1919
# All configuration values have a default; values that are commented out
2020
# serve to show the default.
2121

22-
import sys
2322
import os
23+
from pathlib import Path
2424
from runpy import run_path
25-
from configparser import ConfigParser
25+
26+
import toml
2627

2728
# Check for external Sphinx extensions we depend on
2829
try:
@@ -41,11 +42,6 @@
4142
raise RuntimeError('Need nibabel on Python PATH; consider "make htmldoc" '
4243
'from nibabel root directory')
4344

44-
# If extensions (or modules to document with autodoc) are in another directory,
45-
# add these directories to sys.path here. If the directory is relative to the
46-
# documentation root, use os.path.abspath to make it absolute, like shown here.
47-
# sys.path.append(os.path.abspath('../sphinxext'))
48-
4945
# -- General configuration ----------------------------------------------------
5046

5147
# We load the nibabel release info into a dict by explicit execution
@@ -56,9 +52,8 @@
5652
fobj.write(rel['long_description'])
5753

5854
# Load metadata from setup.cfg
59-
config = ConfigParser()
60-
config.read(os.path.join('..', '..', 'setup.cfg'))
61-
metadata = config['metadata']
55+
pyproject_dict = toml.load(Path("../../pyproject.toml"))
56+
metadata = pyproject_dict["project"]
6257

6358
# Add any Sphinx extension module names here, as strings. They can be
6459
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
@@ -92,7 +87,9 @@
9287

9388
# General information about the project.
9489
project = u'NiBabel'
95-
copyright = f"2006-2022, {metadata['maintainer']} <{metadata['author_email']}>"
90+
author_name = metadata["authors"][0]["name"]
91+
author_email = metadata["authors"][0]["email"]
92+
copyright = f"2006-2022, {author_name} <{author_email}>"
9693

9794
# The version info for the project you're documenting, acts as replacement for
9895
# |version| and |release|, also used in various other places throughout the

pyproject.toml

+3-7
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,10 @@ build-backend = "setuptools.build_meta:__legacy__"
55
[project]
66
name = "nibabel"
77
description = "Access a multitude of neuroimaging data formats"
8-
authors = [
9-
{ name = "nibabel developers", email = "[email protected]" },
10-
]
11-
maintainers = [
12-
{ name = "Christopher Markiewicz" },
13-
]
8+
authors = [{ name = "NiBabel developers", email = "[email protected]" }]
9+
maintainers = [{ name = "Christopher Markiewicz" }]
1410
readme = "README.rst"
15-
license = { text="MIT License" }
11+
license = { text = "MIT License" }
1612
requires-python = ">=3.7"
1713
dependencies = ["numpy >=1.17", "packaging >=17", "setuptools"]
1814
classifiers = [

setup.cfg

+2-1
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ dev =
1010
doc =
1111
matplotlib >= 1.5.3
1212
numpydoc
13-
sphinx >=0.3,<3
13+
sphinx ~= 5.3
1414
texext
15+
toml
1516
minc2 =
1617
h5py
1718
spm =

0 commit comments

Comments
 (0)