sh2/d2ypp2/tests/test_project_metadata.py
eric 9888f1daad Harden YouTube unmanned live stack and hide advanced console panels.
Fix Pro config SSOT, event FSM, FFmpeg error tiers, relay heartbeat, and ingest auth while keeping relay snapshot, quality guard, and event hub hidden in the UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-23 06:31:31 -05:00

44 lines
1.2 KiB
Python

from __future__ import annotations
import tomllib
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
def _dependency_names(items: list[str]) -> set[str]:
names: set[str] = set()
for item in items:
head = item.split(";", 1)[0].strip()
name = head.split("[", 1)[0]
for marker in (">=", "<=", "==", "~=", "!=", ">", "<"):
name = name.split(marker, 1)[0]
if name:
names.add(name.lower())
return names
def test_pyproject_declares_control_plane_runtime_dependencies() -> None:
pyproject = tomllib.loads((ROOT / "pyproject.toml").read_text(encoding="utf-8"))
pyproject_deps = _dependency_names(pyproject["project"]["dependencies"])
requirements = _dependency_names(
[
line.strip()
for line in (ROOT / "requirements.txt").read_text(encoding="utf-8").splitlines()
if line.strip() and not line.lstrip().startswith("#")
]
)
required = {
"fastapi",
"starlette",
"pydantic",
"uvicorn",
"python-multipart",
"httpx",
"pyyaml",
}
assert required <= pyproject_deps
assert required <= requirements