feature: update configuration parser to TOML v1.1.0

Signed-off-by: squidfunk <martin.donath@squidfunk.com>
This commit is contained in:
Martin Donath
2026-04-18 17:17:59 +02:00
committed by GitHub
parent 50aa8a5eb8
commit 8f5f584b9a
2 changed files with 3 additions and 7 deletions
+2 -6
View File
@@ -26,6 +26,7 @@ from __future__ import annotations
import hashlib
import importlib
import os
from tomli import load as toml_load
import pickle
from importlib.util import find_spec
from pathlib import Path
@@ -42,11 +43,6 @@ from zensical.compat.autorefs import get_autorefs_extension
from zensical.compat.mkdocstrings import get_mkdocstrings_extension
from zensical.extensions.emoji import to_svg, twemoji
try:
import tomllib
except ModuleNotFoundError:
import tomli as tomllib # type: ignore[no-redef]
if TYPE_CHECKING:
from collections.abc import Iterator
@@ -92,7 +88,7 @@ def parse_zensical_config(path: str) -> dict:
"""Parse zensical.toml configuration file."""
global _CONFIG # noqa: PLW0603
with open(path, "rb") as f:
config = tomllib.load(f)
config = toml_load(f)
if "project" in config:
config = config["project"]