From 81e270b44b52d4af5a25b97b05456f42aa511ba9 Mon Sep 17 00:00:00 2001 From: Adam Dangoor Date: Fri, 21 Feb 2025 21:15:59 +0000 Subject: [PATCH] Use SphinxConfig to avoid some 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 924fc9d4..8c7e78f0 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" -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 67cb564b..11e82235 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -71,6 +71,7 @@ optional-dependencies.dev = [ "sphinx==8.2.0", "sphinx-copybutton==0.5.2", "sphinx-lint==1.0.0", + "sphinx-pyproject==0.3.0", "sphinx-substitution-extensions==2025.2.19", "sphinxcontrib-spelling==8.0.1", "sybil==9.1.0",