Skip to content

Commit b5e80af

Browse files
committed
Use sphinx-pyproject to remove duplication
1 parent 35a439e commit b5e80af

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

docs/source/conf.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,19 @@
44
"""
55

66
import importlib.metadata
7+
from pathlib import Path
78

89
from packaging.specifiers import SpecifierSet
10+
from sphinx_pyproject import SphinxConfig
911

10-
project = "VWS-Python-Mock"
11-
author = "Adam Dangoor"
12+
_pyproject_file = Path(__file__).parent.parent.parent / "pyproject.toml"
13+
_pyproject_config = SphinxConfig(
14+
pyproject_file=_pyproject_file,
15+
config_overrides={"version": None},
16+
)
17+
18+
project = _pyproject_config.name
19+
author = _pyproject_config.author
1220

1321
extensions = [
1422
"sphinx_copybutton",

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ optional-dependencies.dev = [
9191
"sphinx-copybutton==0.5.2",
9292
"sphinx-lint==1.0.0",
9393
"sphinx-paramlinks==0.6",
94+
"sphinx-pyproject==0.3.0",
9495
"sphinx-substitution-extensions==2025.2.19",
9596
"sphinx-toolbox==3.8.3",
9697
"sphinxcontrib-httpdomain==1.8.1",

0 commit comments

Comments
 (0)