From 678f8035677612ca4a064f6ce121393b8731c1cb Mon Sep 17 00:00:00 2001 From: Philipp Temminghoff Date: Mon, 4 Nov 2024 07:47:02 +0100 Subject: [PATCH] build: add yamling dep --- mkdocs_mknodes/builders/configbuilder.py | 4 ++-- mkdocs_mknodes/cli/__init__.py | 4 ++-- mkdocs_mknodes/commands/serve.py | 4 ++-- pyproject.toml | 3 ++- 4 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mkdocs_mknodes/builders/configbuilder.py b/mkdocs_mknodes/builders/configbuilder.py index 49d3df9..eba57b8 100644 --- a/mkdocs_mknodes/builders/configbuilder.py +++ b/mkdocs_mknodes/builders/configbuilder.py @@ -4,10 +4,10 @@ import os from typing import Any -from jinjarope import yamltools from mkdocs.config import load_config from mkdocs.config.defaults import MkDocsConfig from mknodes.info import mkdocsconfigfile +import yamling from mkdocs_mknodes import telemetry @@ -47,7 +47,7 @@ def build_mkdocs_config( if self.clone_depth is not None: plugin["mknodes"]["clone_depth"] = self.clone_depth # cfg = {**cfg, **kwargs} - text = yamltools.dump_yaml(dict(cfg)) + text = yamling.dump_yaml(dict(cfg)) buffer = io.StringIO(text) buffer.name = cfg.path config = load_config(buffer, **kwargs) diff --git a/mkdocs_mknodes/cli/__init__.py b/mkdocs_mknodes/cli/__init__.py index e4e1b43..27054cc 100644 --- a/mkdocs_mknodes/cli/__init__.py +++ b/mkdocs_mknodes/cli/__init__.py @@ -8,9 +8,9 @@ import typer as t -from jinjarope import yamltools from mknodes.utils import classhelpers, log import mknodes as mk +import yamling from mkdocs_mknodes import buildcollector, paths from mkdocs_mknodes.cli import richstate @@ -171,7 +171,7 @@ def create_config( config["site_name"] = info.distribution_name config["site_author"] = info.author_name config["copyright"] = f"Copyright © {datetime.now().year} {info.author_name}" - result = yamltools.dump_yaml(config) + result = yamling.dump_yaml(config) print(result) diff --git a/mkdocs_mknodes/commands/serve.py b/mkdocs_mknodes/commands/serve.py index b438e1a..9e9484e 100644 --- a/mkdocs_mknodes/commands/serve.py +++ b/mkdocs_mknodes/commands/serve.py @@ -10,10 +10,10 @@ from urllib.parse import urlsplit # from mkdocs.commands import serve as serve_ -from jinjarope import yamltools from mkdocs.config import load_config from mknodes.info import mkdocsconfigfile from mknodes.utils import log +import yamling from mkdocs_mknodes import liveserver, paths from mkdocs_mknodes.commands import build_page @@ -53,7 +53,7 @@ def serve( config.remove_plugin("social") config.remove_plugin("tags") kwargs["theme"] = theme - text = yamltools.dump_yaml(dict(config)) + text = yamling.dump_yaml(dict(config)) stream = io.StringIO(text) stream.name = str(config_path) _serve(config_file=stream, livereload=False, **kwargs) # type: ignore[arg-type] diff --git a/pyproject.toml b/pyproject.toml index 9756636..96209d6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,7 +41,8 @@ dependencies = [ "typer", # Tools "jinja2", - "jinjarope[yaml]", + "jinjarope", + "yamling", "universal_pathlib", "pydantic", "logfire[requests,aiohttp,system-metrics]",