fix: drop PyYAML dep so verify job pytest passes
CI & Release / Verify documentation (push) Skipped
CI & Release / Verify simulator (push) Skipped
CI & Release / Trivy scan (push) Skipped
CI & Release / Semantic Release (push) Skipped
CI & Release / Verify documentation (pull_request) Successful in 4s
CI & Release / Verify simulator (pull_request) Successful in 11s
CI & Release / Trivy scan (pull_request) Successful in 8s
CI & Release / Semantic Release (pull_request) Skipped

Store doc rules in bin/docs_rules.json (stdlib json). test_check_docs no
longer fails in the simulator job that only installs simulator/requirements.txt.
This commit is contained in:
2026-07-10 11:02:55 +01:00
parent df04736336
commit 826cef0c3e
7 changed files with 61 additions and 72 deletions
+3 -10
View File
@@ -4,17 +4,13 @@
from __future__ import annotations
import argparse
import json
import re
import sys
from pathlib import Path
try:
import yaml
except ImportError: # pragma: no cover - stdlib fallback for minimal envs
yaml = None # type: ignore[assignment]
ROOT = Path(__file__).resolve().parents[1]
RULES_PATH = Path(__file__).with_name("docs_rules.yaml")
RULES_PATH = Path(__file__).with_name("docs_rules.json")
LINK_RE = re.compile(r"!?\[[^\]]*\]\(([^)]+)\)")
BARE_SEE_RE = re.compile(r"(?<![\[(/])see\s+(\d{2})(?![\w-])", re.IGNORECASE)
@@ -22,10 +18,7 @@ SKIP_SCHEMES = ("http://", "https://", "mailto:", "tel:", "#")
def load_rules(path: Path = RULES_PATH) -> dict:
text = path.read_text(encoding="utf-8")
if yaml is not None:
return yaml.safe_load(text)
raise RuntimeError("PyYAML is required to load docs_rules.yaml")
return json.loads(path.read_text(encoding="utf-8"))
def slug_heading(text: str) -> str: