From b5e80af4e0f34b8b03cde4db1be0cff71c4890af Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 21 Feb 2025 22:11:05 +0000 Subject: [PATCH] Use sphinx-pyproject to remove duplication --- docs/source/conf.py | 12 ++++++++++-- pyproject.toml | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index db335120..3c1e6a83 100755 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -4,11 +4,19 @@ """ import importlib.metadata +from pathlib import Path from packaging.specifiers import SpecifierSet +from sphinx_pyproject import SphinxConfig -project = "VWS-Python-Mock" -author = "Adam Dangoor" +_pyproject_file = Path(__file__).parent.parent.parent / "pyproject.toml" +_pyproject_config = SphinxConfig( + pyproject_file=_pyproject_file, + config_overrides={"version": None}, +) + +project = _pyproject_config.name +author = _pyproject_config.author extensions = [ "sphinx_copybutton", diff --git a/pyproject.toml b/pyproject.toml index e37edfe3..17a79abc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,6 +91,7 @@ optional-dependencies.dev = [ "sphinx-copybutton==0.5.2", "sphinx-lint==1.0.0", "sphinx-paramlinks==0.6", + "sphinx-pyproject==0.3.0", "sphinx-substitution-extensions==2025.2.19", "sphinx-toolbox==3.8.3", "sphinxcontrib-httpdomain==1.8.1",