diff --git a/docs/conf.py b/docs/conf.py index 6485d12..15035b5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,12 +17,14 @@ # 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. -# Get version number from nanite._version file import pathlib import matplotlib import mock import os.path as op import sys +import tomllib +import nanite + # parent directory pdir = op.dirname(op.dirname(op.abspath(__file__))) # include extensions @@ -91,14 +93,12 @@ # General information about the project. project = 'nanite' github_project = 'AFM-Analysis/' + project -credits_path = pathlib.Path(__file__).parent.parent / "CREDITS" -if credits_path.exists(): - authors = [c.strip() for c in credits_path.read_text().split("\n") - if c and not c.startswith("#")] -else: - authors = ["Paul Müller"] -copyright = '2018, Paul Müller' + +with (pathlib.Path(__file__).parent.parent / "pyproject.toml").open("rb") as f: + data = tomllib.load(f) +authors = [a["name"] for a in data["project"]["authors"]] author = ", ".join(authors) +copyright = '2015, ' + author # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -108,8 +108,7 @@ # # The full version, including alpha/beta/rc tags. # This gets 'version' -exec(open(op.join(pdir, "nanite/_version.py")).read()) -release = version # noqa: F821 +release = nanite.__version__ # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #