Skip to content

Commit

Permalink
Merge pull request #1161 from ZviBaratz/docs
Browse files Browse the repository at this point in the history
MRG: update doc build

Fixes for configuration change.
  • Loading branch information
matthew-brett authored Dec 28, 2022
2 parents 557a7f2 + e6477cb commit 0a6e73e
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Thumbs.db
# Things specific to this project #
###################################
doc/source/reference
doc/source/generated
venv/
.buildbot.patch
.vscode
Expand Down
19 changes: 8 additions & 11 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
# All configuration values have a default; values that are commented out
# serve to show the default.

import sys
import os
from pathlib import Path
from runpy import run_path
from configparser import ConfigParser

import toml

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

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

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

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

# Load metadata from setup.cfg
config = ConfigParser()
config.read(os.path.join('..', '..', 'setup.cfg'))
metadata = config['metadata']
pyproject_dict = toml.load(Path("../../pyproject.toml"))
metadata = pyproject_dict["project"]

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

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

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down
10 changes: 3 additions & 7 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@ build-backend = "setuptools.build_meta:__legacy__"
[project]
name = "nibabel"
description = "Access a multitude of neuroimaging data formats"
authors = [
{ name = "nibabel developers", email = "neuroimaging@python.org" },
]
maintainers = [
{ name = "Christopher Markiewicz" },
]
authors = [{ name = "NiBabel developers", email = "neuroimaging@python.org" }]
maintainers = [{ name = "Christopher Markiewicz" }]
readme = "README.rst"
license = { text="MIT License" }
license = { text = "MIT License" }
requires-python = ">=3.7"
dependencies = ["numpy >=1.17", "packaging >=17", "setuptools"]
classifiers = [
Expand Down
3 changes: 2 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ dev =
doc =
matplotlib >= 1.5.3
numpydoc
sphinx >=0.3,<3
sphinx ~= 5.3
texext
toml
minc2 =
h5py
spm =
Expand Down

0 comments on commit 0a6e73e

Please sign in to comment.