diff --git a/docs/source/conf.py b/docs/source/conf.py index 2c1c9f4..320ee99 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -10,15 +10,13 @@ import sys from pathlib import Path -# parse info from project files +import sigmf -root = Path(__file__).parent.parent.parent -with open(root / "sigmf" / "__init__.py", "r") as handle: - init = handle.read() - toolversion = re.search(r'__version__\s*=\s*[\'"]([^\'"]*)[\'"]', init).group(1) - specversion = re.search(r'__specification__\s*=\s*[\'"]([^\'"]*)[\'"]', init).group(1) +toolversion = sigmf.__version__ +specversion = sigmf.__specification__ # autodoc needs special pathing +root = Path(__file__).parent.parent.parent sys.path.append(str(root)) # -- Project information @@ -68,4 +66,4 @@ ] frozen_locals = dict(locals()) rst_epilog = '\n'.join(map(lambda x: f".. |{x}| replace:: {frozen_locals[x]}", variables_to_export)) -del frozen_locals \ No newline at end of file +del frozen_locals