Skip to content

Commit

Permalink
docs: fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmueller committed Jan 15, 2024
1 parent dc6f308 commit ac9bacb
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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.
#
Expand Down

0 comments on commit ac9bacb

Please sign in to comment.