From 8a465ea30481cde94d4076b9d72311e28856c5e1 Mon Sep 17 00:00:00 2001 From: gcroci2 Date: Mon, 18 Sep 2023 10:40:02 +0200 Subject: [PATCH] fix docs config --- docs/conf.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 2961b86e8..a3255c1f2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,16 +18,9 @@ # 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 toml import sys -config = configparser.ConfigParser() -config.read('./../setup.cfg') -CONFIG = {} -for section in config.sections(): - CONFIG[section] = {} - for option in config.options(section): - CONFIG[section][option] = config.get(section, option) - autodoc_mock_imports = [ 'numpy', 'scipy', @@ -107,7 +100,9 @@ # built documents. # # The short X.Y version. -version = CONFIG['metadata']['version'] +with open('./../pyproject.toml', 'r') as f: + toml_file = toml.load(f) + version = toml_file['project']['version'] # The full version, including alpha/beta/rc tags. release = version