diff --git a/README.md b/README.md index 62dd373..df17cdc 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ For details and best practices, refer to the [tuf docs][2]. Based on the intended use, the `notsotuf` package supports only the top-level roles offered by `tuf`. At this time we do not support delegations. Hence the name *"notsotuf"*. -*Disclaimer: It turns out there was once another package called [No-So-TUF][9] created by the author of PyUpdater. +*Disclaimer: It turns out there was once another package called [Not-So-TUF][9] created by the author of PyUpdater. These packages are not related, and the matching name is a pure coincidence. The name did not appear on PyPI at the time our repo was created, nor did it appear on GitHub, as far as I know.* diff --git a/docs/source/conf.py b/docs/source/conf.py index d7a7cc0..46d8b9f 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -10,19 +10,27 @@ # 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. # -import os +import configparser +from datetime import date +import notsotuf +from urllib import parse +import pathlib import sys -sys.path.insert(0, os.path.abspath('../../src/')) +ROOT_DIR = pathlib.Path(__file__).resolve().parent.parent.parent +SRC_DIR = ROOT_DIR / 'src' +sys.path.insert(0, str(SRC_DIR)) -# -- Project information ----------------------------------------------------- -project = 'notsotuf' -copyright = '2022, dennisvang' -author = 'dennisvang' +# -- Project information ----------------------------------------------------- +config = configparser.ConfigParser() +config.read(ROOT_DIR / 'setup.cfg') +project = config['metadata']['name'] +author = config['metadata']['author'] +copyright = f'{date.today().year}, {author}' # The full version, including alpha/beta/rc tags -release = '2022.0' +release = notsotuf.__version__ # -- General configuration --------------------------------------------------- @@ -79,5 +87,11 @@ 'inherited-members': True, } -html_baseurl = 'https://notsotuf.readthedocs.io' +# find documentation url +project_urls = config['metadata']['project_urls'].split('\n') +html_baseurl = '' +for line in project_urls: + if 'readthedocs' in line: + parsed_url = parse.urlparse(line.split('=')[1].strip()) + html_baseurl = f'{parsed_url.scheme}://{parsed_url.netloc}' html_extra_path = ['robots.txt']