Skip to content

Commit 9329f70

Browse files
committed
docs: docs can be built on python 3.10
1 parent b060ca4 commit 9329f70

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

docs/source/conf.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,17 @@
1919
#
2020
import os
2121
import sys
22-
import tomllib
22+
if sys.version_info < (3, 11):
23+
from tomli import load as load_toml
24+
else:
25+
from tomllib import load as load_toml
26+
2327

2428
sys.path.insert(0, os.path.abspath('../..'))
2529
def get_project_metadata():
2630
path = os.path.abspath(os.path.join(os.path.dirname(__file__), "../../pyproject.toml"))
2731
with open(path, "rb") as f:
28-
return tomllib.load(f)['project']
32+
return load_toml(f)['project']
2933

3034
metadata = get_project_metadata()
3135

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ classifiers = [
2323
]
2424

2525
[dependency-groups]
26-
docs = ["sphinx"]
26+
docs = ["sphinx", "tomli ; python_full_version < '3.11'"]
2727
type_checking = [
2828
"mypy",
2929
"lxml",

uv.lock

Lines changed: 10 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)