feat(infra): check_pyproject and --repo flag in project-status (#240)
* feat(infra): add check_pyproject and --repo flag to project-status * feat(infra): add repo flag to project-status ts wrapper * test(infra): add check_pyproject and repo flag tests * fix(infra): accept packages=["src"] as valid hatchling wheel config * fix(ci): apply ruff format to project-status.py and tests --------- Co-authored-by: opencode-agent <agent@opencode.local>
This commit is contained in:
parent
52343e2a78
commit
1e9ee49a1d
6 changed files with 1401 additions and 39 deletions
|
|
@ -12,6 +12,7 @@ Usage:
|
||||||
python3 .opencode/scripts/project-status.py # non-blocking (exit 0)
|
python3 .opencode/scripts/project-status.py # non-blocking (exit 0)
|
||||||
python3 .opencode/scripts/project-status.py --check # strict (exit 1 on FAIL)
|
python3 .opencode/scripts/project-status.py --check # strict (exit 1 on FAIL)
|
||||||
python3 .opencode/scripts/project-status.py --fast # skip slow/remote checks
|
python3 .opencode/scripts/project-status.py --fast # skip slow/remote checks
|
||||||
|
python3 .opencode/scripts/project-status.py --repo /path/to/repo
|
||||||
|
|
||||||
Project types (auto-detected):
|
Project types (auto-detected):
|
||||||
fullstack — ``frontend/`` dir (SvelteKit) + ``backend/`` dir
|
fullstack — ``frontend/`` dir (SvelteKit) + ``backend/`` dir
|
||||||
|
|
@ -24,6 +25,7 @@ Project types (auto-detected):
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
import argparse
|
||||||
import ast
|
import ast
|
||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
@ -37,8 +39,15 @@ from typing import Any
|
||||||
# ── repo root + config ───────────────────────────────────────────────────────
|
# ── repo root + config ───────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
def _resolve_repo_root() -> Path:
|
def _resolve_repo_root(repo_override: str | None = None) -> Path:
|
||||||
"""Resolve repo root via git (cwd-aware), fallback to script location."""
|
"""Resolve repo root.
|
||||||
|
|
||||||
|
If ``repo_override`` is given, resolve it (relative to cwd) and return.
|
||||||
|
Otherwise, resolve via git (cwd-aware), fallback to script location.
|
||||||
|
"""
|
||||||
|
if repo_override:
|
||||||
|
p = Path(repo_override).resolve()
|
||||||
|
return p
|
||||||
result = subprocess.run(
|
result = subprocess.run(
|
||||||
["git", "rev-parse", "--show-toplevel"], capture_output=True, text=True, check=False
|
["git", "rev-parse", "--show-toplevel"], capture_output=True, text=True, check=False
|
||||||
)
|
)
|
||||||
|
|
@ -183,17 +192,23 @@ def parse_remote_url(url: str) -> tuple[str, str, str]:
|
||||||
raise ValueError(f"Cannot parse remote URL: {url}")
|
raise ValueError(f"Cannot parse remote URL: {url}")
|
||||||
|
|
||||||
|
|
||||||
def get_repo_full_name() -> str | None:
|
def get_repo_full_name(repo: Path | None = None) -> str | None:
|
||||||
"""Return ``org/repo`` from git remote, or None on error (read-only)."""
|
"""Return ``org/repo`` from git remote, or None on error (read-only).
|
||||||
rc, out, _ = run_cmd(["git", "remote", "get-url", "origin"])
|
|
||||||
|
If ``repo`` is given, use ``git -C <repo>`` to locate the remote.
|
||||||
|
"""
|
||||||
|
git_cmd = ["git"]
|
||||||
|
if repo is not None:
|
||||||
|
git_cmd = [*git_cmd, "-C", str(repo)]
|
||||||
|
rc, out, _ = run_cmd([*git_cmd, "remote", "get-url", "origin"])
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
return None
|
return None
|
||||||
try:
|
try:
|
||||||
_host, org, repo = parse_remote_url(out.strip())
|
_host, org, repo_name = parse_remote_url(out.strip())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
return None
|
return None
|
||||||
else:
|
else:
|
||||||
return f"{org}/{repo}"
|
return f"{org}/{repo_name}"
|
||||||
|
|
||||||
|
|
||||||
# ── auto-detect ──────────────────────────────────────────────────────────────
|
# ── auto-detect ──────────────────────────────────────────────────────────────
|
||||||
|
|
@ -303,15 +318,63 @@ def _check_cli_package() -> CheckResult:
|
||||||
return CheckResult(CheckStatus.FAIL, "src/<package>/", "пакет не найден")
|
return CheckResult(CheckStatus.FAIL, "src/<package>/", "пакет не найден")
|
||||||
|
|
||||||
|
|
||||||
|
def _normalize_package_name(name: str) -> str:
|
||||||
|
"""Normalize a project name to a Python package name.
|
||||||
|
|
||||||
|
Per PEP 503 / packaging: lowercase + replace runs of ``-_.`` with ``_``.
|
||||||
|
Example: ``my-project`` → ``my_project``.
|
||||||
|
"""
|
||||||
|
return re.sub(r"[-_.]+", "_", name).lower()
|
||||||
|
|
||||||
|
|
||||||
|
def _check_flat_layout(ptype: ProjectType) -> CheckResult | None:
|
||||||
|
"""Check for flat ``src/`` layout (no nested package dir).
|
||||||
|
|
||||||
|
Applies only to CLI/UNKNOWN types (publishable-package ambitions). For
|
||||||
|
backend/bot/worker the ``src/api/``, ``src/bot.py`` layout is an app
|
||||||
|
contract, not a deprecated flat layout.
|
||||||
|
|
||||||
|
Returns None if ``src/`` does not exist, has a nested package with
|
||||||
|
``__init__.py``, or has a subdir matching ``[project].name`` (normalized).
|
||||||
|
Returns a WARN CheckResult if flat layout detected.
|
||||||
|
"""
|
||||||
|
if ptype not in {ProjectType.CLI, ProjectType.UNKNOWN}:
|
||||||
|
return None
|
||||||
|
src = REPO_ROOT / "src"
|
||||||
|
if not src.exists() or not src.is_dir():
|
||||||
|
return None
|
||||||
|
pyproject = parse_pyproject()
|
||||||
|
project = pyproject.get("project", {}) if isinstance(pyproject, dict) else {}
|
||||||
|
proj_name = project.get("name") if isinstance(project, dict) else None
|
||||||
|
expected_pkg = _normalize_package_name(str(proj_name)) if proj_name else None
|
||||||
|
subdirs = [p for p in src.iterdir() if p.is_dir()]
|
||||||
|
if not subdirs:
|
||||||
|
return None
|
||||||
|
has_nested_pkg = any((p / "__init__.py").exists() or p.name == expected_pkg for p in subdirs)
|
||||||
|
if has_nested_pkg:
|
||||||
|
return None
|
||||||
|
return CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"flat src/ layout",
|
||||||
|
"deprecated — рекомендуется src/<package>/ (publishable, reusable as git-dep)",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def _check_type_specific_structure(ptype: ProjectType) -> list[CheckResult]:
|
def _check_type_specific_structure(ptype: ProjectType) -> list[CheckResult]:
|
||||||
"""Type-specific extra checks beyond the expected dirs list."""
|
"""Type-specific extra checks beyond the expected dirs list."""
|
||||||
|
results: list[CheckResult] = []
|
||||||
if ptype == ProjectType.BACKEND:
|
if ptype == ProjectType.BACKEND:
|
||||||
return [_check_backend_lifespan()]
|
results.append(_check_backend_lifespan())
|
||||||
if ptype == ProjectType.FULLSTACK and not path_exists("frontend/package.json"):
|
elif ptype == ProjectType.FULLSTACK and not path_exists("frontend/package.json"):
|
||||||
return [CheckResult(CheckStatus.WARN, "frontend/package.json", "SvelteKit не обнаружен")]
|
results.append(
|
||||||
if ptype == ProjectType.CLI:
|
CheckResult(CheckStatus.WARN, "frontend/package.json", "SvelteKit не обнаружен")
|
||||||
return [_check_cli_package()]
|
)
|
||||||
return []
|
elif ptype == ProjectType.CLI:
|
||||||
|
results.append(_check_cli_package())
|
||||||
|
flat = _check_flat_layout(ptype)
|
||||||
|
if flat is not None:
|
||||||
|
results.append(flat)
|
||||||
|
return results
|
||||||
|
|
||||||
|
|
||||||
def check_structure(ptype: ProjectType) -> GroupResult:
|
def check_structure(ptype: ProjectType) -> GroupResult:
|
||||||
|
|
@ -575,8 +638,14 @@ def _check_branch_protection(repo: str) -> CheckResult:
|
||||||
return CheckResult(CheckStatus.WARN, "branch protection", "правила найдены, но набор неполный")
|
return CheckResult(CheckStatus.WARN, "branch protection", "правила найдены, но набор неполный")
|
||||||
|
|
||||||
|
|
||||||
def check_infra(ptype: ProjectType, fast: bool = False) -> GroupResult:
|
def check_infra(
|
||||||
"""Group 6: Infra — branch protection, ci.yml, dependabot, LICENSE, pre-commit."""
|
ptype: ProjectType, fast: bool = False, repo_root: Path | None = None
|
||||||
|
) -> GroupResult:
|
||||||
|
"""Group 6: Infra — branch protection, ci.yml, dependabot, LICENSE, pre-commit.
|
||||||
|
|
||||||
|
If ``repo_root`` is given, uses ``git -C <repo_root>`` to locate the remote
|
||||||
|
for branch protection detection.
|
||||||
|
"""
|
||||||
group = GroupResult(name="Infra")
|
group = GroupResult(name="Infra")
|
||||||
if path_exists(".github/workflows/ci.yml"):
|
if path_exists(".github/workflows/ci.yml"):
|
||||||
group.checks.append(CheckResult(CheckStatus.OK, ".github/workflows/ci.yml", "есть"))
|
group.checks.append(CheckResult(CheckStatus.OK, ".github/workflows/ci.yml", "есть"))
|
||||||
|
|
@ -609,10 +678,12 @@ def check_infra(ptype: ProjectType, fast: bool = False) -> GroupResult:
|
||||||
CheckResult(CheckStatus.WARN, "branch protection", "пропущено (--fast)")
|
CheckResult(CheckStatus.WARN, "branch protection", "пропущено (--fast)")
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
repo = get_repo_full_name()
|
repo = get_repo_full_name(repo_root)
|
||||||
if repo is None:
|
if repo is None:
|
||||||
group.checks.append(
|
group.checks.append(
|
||||||
CheckResult(CheckStatus.WARN, "branch protection", "git remote недоступен")
|
CheckResult(
|
||||||
|
CheckStatus.WARN, "branch protection", "git remote недоступен (не git repo?)"
|
||||||
|
)
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
group.checks.append(_check_branch_protection(repo))
|
group.checks.append(_check_branch_protection(repo))
|
||||||
|
|
@ -648,6 +719,412 @@ def check_coverage(ptype: ProjectType) -> GroupResult:
|
||||||
return group
|
return group
|
||||||
|
|
||||||
|
|
||||||
|
# ── check group 8: pyproject.toml validity (13 checks) ───────────────────────
|
||||||
|
|
||||||
|
|
||||||
|
DEFAULT_COVERAGE_EXCLUDE_LINES: list[str] = [
|
||||||
|
"pragma: no cover",
|
||||||
|
"if __name__ == .__main__.:",
|
||||||
|
"if TYPE_CHECKING:",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def _has_ruff_config(pyproject: dict[str, Any], repo_root: Path) -> bool:
|
||||||
|
"""True if [tool.ruff] section exists or ruff.toml file is present."""
|
||||||
|
if "ruff" in pyproject.get("tool", {}):
|
||||||
|
return True
|
||||||
|
return (repo_root / "ruff.toml").exists()
|
||||||
|
|
||||||
|
|
||||||
|
def _has_mypy_config(pyproject: dict[str, Any], repo_root: Path) -> bool:
|
||||||
|
"""True if [tool.mypy] section exists or mypy.ini file is present."""
|
||||||
|
if "mypy" in pyproject.get("tool", {}):
|
||||||
|
return True
|
||||||
|
return (repo_root / "mypy.ini").exists() or (repo_root / ".mypy.ini").exists()
|
||||||
|
|
||||||
|
|
||||||
|
def _mypy_strict(pyproject: dict[str, Any]) -> bool:
|
||||||
|
"""True if mypy is strict (strict=true or disallow_untyped_defs=true)."""
|
||||||
|
mypy = pyproject.get("tool", {}).get("mypy", {})
|
||||||
|
if not isinstance(mypy, dict):
|
||||||
|
return False
|
||||||
|
return bool(mypy.get("strict")) or bool(mypy.get("disallow_untyped_defs"))
|
||||||
|
|
||||||
|
|
||||||
|
def _check_python_version_compat(requires_python: str, python_version_file: str) -> CheckResult:
|
||||||
|
"""Check 13: requires-python vs .python-version compatibility.
|
||||||
|
|
||||||
|
Uses ``packaging.specifiers.SpecifierSet.contains()``. FAIL if the pinned
|
||||||
|
version in ``.python-version`` is not contained in the requires-python set.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
from packaging.specifiers import SpecifierSet # noqa: PLC0415
|
||||||
|
except ImportError:
|
||||||
|
return CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"requires-python vs .python-version",
|
||||||
|
"packaging не установлен — проверка пропущена",
|
||||||
|
)
|
||||||
|
pinned = python_version_file.strip()
|
||||||
|
# Strip possible prefix like "3.13" from "python3.13"
|
||||||
|
m = re.search(r"(\d+\.\d+)", pinned)
|
||||||
|
if not m:
|
||||||
|
return CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"requires-python vs .python-version",
|
||||||
|
f"не удалось распарсить версию из .python-version: {pinned!r}",
|
||||||
|
)
|
||||||
|
version = m.group(1)
|
||||||
|
try:
|
||||||
|
spec = SpecifierSet(requires_python)
|
||||||
|
except ValueError as e:
|
||||||
|
return CheckResult(
|
||||||
|
CheckStatus.FAIL,
|
||||||
|
"requires-python vs .python-version",
|
||||||
|
f"неверный requires-python: {e}",
|
||||||
|
)
|
||||||
|
if spec.contains(version, prereleases=True):
|
||||||
|
return CheckResult(
|
||||||
|
CheckStatus.OK,
|
||||||
|
"requires-python vs .python-version",
|
||||||
|
f"requires-python={requires_python!r} включает {version}",
|
||||||
|
)
|
||||||
|
return CheckResult(
|
||||||
|
CheckStatus.FAIL,
|
||||||
|
"requires-python vs .python-version",
|
||||||
|
f"requires-python={requires_python!r} не включает {version}",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def check_pyproject(ptype: ProjectType) -> GroupResult: # noqa: C901, PLR0912, PLR0915
|
||||||
|
"""Group 8: pyproject.toml — 13 checks (FAIL/WARN).
|
||||||
|
|
||||||
|
Parses ``pyproject.toml`` via ``tomllib`` (stdlib, Python 3.11+). If the
|
||||||
|
file is missing → single WARN and skip. See issue #234 for the full spec.
|
||||||
|
"""
|
||||||
|
group = GroupResult(name="Pyproject")
|
||||||
|
pyproject_path = REPO_ROOT / "pyproject.toml"
|
||||||
|
if not pyproject_path.exists():
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(CheckStatus.WARN, "pyproject.toml", "нет — skip Python checks")
|
||||||
|
)
|
||||||
|
return group
|
||||||
|
try:
|
||||||
|
with pyproject_path.open("rb") as f:
|
||||||
|
data = tomllib.load(f)
|
||||||
|
except (OSError, ValueError) as e:
|
||||||
|
group.checks.append(CheckResult(CheckStatus.FAIL, "pyproject.toml", f"парсинг failed: {e}"))
|
||||||
|
return group
|
||||||
|
|
||||||
|
tools = data.get("tool", {}) if isinstance(data, dict) else {}
|
||||||
|
project = data.get("project", {}) if isinstance(data, dict) else {}
|
||||||
|
build = data.get("build-system", {}) if isinstance(data, dict) else {}
|
||||||
|
|
||||||
|
# ── Check 1: [build-system] ──
|
||||||
|
requires = build.get("requires", []) if isinstance(build, dict) else []
|
||||||
|
build_backend = build.get("build-backend", "") if isinstance(build, dict) else ""
|
||||||
|
requires_ok = isinstance(requires, list) and any("hatchling" in str(r) for r in requires)
|
||||||
|
if requires_ok and build_backend == "hatchling.build":
|
||||||
|
group.checks.append(CheckResult(CheckStatus.OK, "[build-system]", "hatchling настроен"))
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.FAIL,
|
||||||
|
"[build-system]",
|
||||||
|
f"требуется hatchling (requires={requires!r}, backend={build_backend!r})",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 2: [tool.hatch.build.targets.wheel] packages ──
|
||||||
|
proj_name = project.get("name", "") if isinstance(project, dict) else ""
|
||||||
|
expected_pkg = _normalize_package_name(str(proj_name)) if proj_name else ""
|
||||||
|
src_pkg_path = f"src/{expected_pkg}"
|
||||||
|
src_pkg_dir_exists = expected_pkg and (REPO_ROOT / "src" / expected_pkg).is_dir()
|
||||||
|
hatch_targets = (
|
||||||
|
tools.get("hatch", {}).get("build", {}).get("targets", {}).get("wheel", {})
|
||||||
|
if isinstance(tools, dict)
|
||||||
|
else {}
|
||||||
|
)
|
||||||
|
hatch_packages = hatch_targets.get("packages", []) if isinstance(hatch_targets, dict) else []
|
||||||
|
src_dir_exists = (REPO_ROOT / "src").exists()
|
||||||
|
if src_pkg_dir_exists:
|
||||||
|
# nested-layout: packages must reference src/<pkg> OR src (hatchling
|
||||||
|
# accepts both — `["src"]` treats src/ as package root when it
|
||||||
|
# contains a single package dir matching [project].name).
|
||||||
|
valid_packages = {src_pkg_path, "src"}
|
||||||
|
if isinstance(hatch_packages, list) and any(p in valid_packages for p in hatch_packages):
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.OK,
|
||||||
|
"[tool.hatch.build.targets.wheel]",
|
||||||
|
f"packages={hatch_packages!r}",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.FAIL,
|
||||||
|
"[tool.hatch.build.targets.wheel]",
|
||||||
|
f'ожидается packages=["{src_pkg_path}"] или ["src"], got={hatch_packages!r}',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
elif src_dir_exists:
|
||||||
|
# src/ exists but no src/<pkg>/ — app-layout (backend/bot/worker) or
|
||||||
|
# flat-layout CLI. WARN: not a publishable package layout.
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"[tool.hatch.build.targets.wheel]",
|
||||||
|
f"нет src/{expected_pkg}/ — app-layout (OK для backend/bot/worker)",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
# No src/ — CLI without library-ambitions
|
||||||
|
elif isinstance(hatch_packages, list) and hatch_packages:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.OK,
|
||||||
|
"[tool.hatch.build.targets.wheel]",
|
||||||
|
f"packages={hatch_packages!r}",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"[tool.hatch.build.targets.wheel]",
|
||||||
|
"нет src/ и нет packages — OK для CLI без library-ambitions",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 3: [project] name, version, description, requires-python ──
|
||||||
|
required_project = ["name", "version", "description", "requires-python"]
|
||||||
|
missing_project = [
|
||||||
|
f for f in required_project if not project.get(f) if isinstance(project, dict)
|
||||||
|
]
|
||||||
|
if not missing_project:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.OK,
|
||||||
|
"[project]",
|
||||||
|
f"name={project.get('name')!r}, version={project.get('version')!r}",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.FAIL,
|
||||||
|
"[project]",
|
||||||
|
f"отсутствуют поля: {', '.join(missing_project)}",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 4: [tool.ruff] or ruff.toml ──
|
||||||
|
ruff_section = tools.get("ruff", {}) if isinstance(tools, dict) else {}
|
||||||
|
if _has_ruff_config(data, REPO_ROOT):
|
||||||
|
if isinstance(ruff_section, dict) and ruff_section:
|
||||||
|
has_ll = "line-length" in ruff_section
|
||||||
|
has_tv = "target-version" in ruff_section
|
||||||
|
if has_ll and has_tv:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.OK, "[tool.ruff]", "line-length + target-version настроены"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"[tool.ruff]",
|
||||||
|
f"минимум: line-length, target-version (есть: "
|
||||||
|
f"{'ll' if has_ll else ''}{'+' if has_ll and has_tv else ''}"
|
||||||
|
f"{'tv' if has_tv else ''})",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(CheckResult(CheckStatus.OK, "[tool.ruff]", "ruff.toml обнаружен"))
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(CheckStatus.FAIL, "[tool.ruff]", "секция отсутствует (и нет ruff.toml)")
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 5: [tool.mypy] or mypy.ini ──
|
||||||
|
has_mypy_ini = (REPO_ROOT / "mypy.ini").exists() or (REPO_ROOT / ".mypy.ini").exists()
|
||||||
|
if "mypy" in tools or has_mypy_ini:
|
||||||
|
if has_mypy_ini and "mypy" not in tools:
|
||||||
|
# mypy.ini present, [tool.mypy] absent — assume strict in ini
|
||||||
|
group.checks.append(CheckResult(CheckStatus.OK, "[tool.mypy]", "mypy.ini обнаружен"))
|
||||||
|
elif _mypy_strict(data):
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.OK,
|
||||||
|
"[tool.mypy]",
|
||||||
|
"strict=true (или disallow_untyped_defs)",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(CheckStatus.WARN, "[tool.mypy]", "не strict — добавьте strict=true")
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(CheckStatus.FAIL, "[tool.mypy]", "секция отсутствует (и нет mypy.ini)")
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 6: [tool.pytest.ini_options] ──
|
||||||
|
pytest_opts = tools.get("pytest", {}).get("ini_options", {}) if isinstance(tools, dict) else {}
|
||||||
|
if isinstance(pytest_opts, dict) and pytest_opts:
|
||||||
|
asyncio_mode = pytest_opts.get("asyncio_mode", "")
|
||||||
|
testpaths = pytest_opts.get("testpaths", [])
|
||||||
|
if asyncio_mode == "auto" and testpaths == ["tests"]:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.OK,
|
||||||
|
"[tool.pytest.ini_options]",
|
||||||
|
'asyncio_mode=auto, testpaths=["tests"]',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"[tool.pytest.ini_options]",
|
||||||
|
f"asyncio_mode={asyncio_mode!r}, testpaths={testpaths!r} "
|
||||||
|
'(рекомендуется auto + ["tests"])',
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(CheckStatus.FAIL, "[tool.pytest.ini_options]", "секция отсутствует")
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 7: [tool.coverage.run] ──
|
||||||
|
cov_run = tools.get("coverage", {}).get("run", {}) if isinstance(tools, dict) else {}
|
||||||
|
if isinstance(cov_run, dict) and cov_run.get("source") and cov_run.get("branch") is True:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.OK,
|
||||||
|
"[tool.coverage.run]",
|
||||||
|
f"source={cov_run.get('source')!r}, branch=true",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"[tool.coverage.run]",
|
||||||
|
"нужны source и branch=true",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 8: [tool.coverage.report] exclude_lines ──
|
||||||
|
cov_report = tools.get("coverage", {}).get("report", {}) if isinstance(tools, dict) else {}
|
||||||
|
exclude_lines = cov_report.get("exclude_lines", []) if isinstance(cov_report, dict) else []
|
||||||
|
exclude_strs = [str(e) for e in exclude_lines] if isinstance(exclude_lines, list) else []
|
||||||
|
missing_exclude = [
|
||||||
|
e for e in DEFAULT_COVERAGE_EXCLUDE_LINES if not any(e in s for s in exclude_strs)
|
||||||
|
]
|
||||||
|
if not missing_exclude and exclude_strs:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.OK,
|
||||||
|
"[tool.coverage.report]",
|
||||||
|
f"exclude_lines содержит {len(exclude_strs)} паттернов",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"[tool.coverage.report]",
|
||||||
|
f"exclude_lines не хватает: {', '.join(missing_exclude)}",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 9: addopts --cov-fail-under=N ──
|
||||||
|
addopts_val = pytest_opts.get("addopts", "") if isinstance(pytest_opts, dict) else ""
|
||||||
|
m_cov = re.search(r"--cov-fail-under=(\d+)", str(addopts_val))
|
||||||
|
if m_cov:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(CheckStatus.OK, "addopts --cov-fail-under", f"порог={m_cov.group(1)}%")
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(CheckStatus.WARN, "addopts --cov-fail-under", "порог coverage не задан")
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 10: [tool.project-status] thresholds ──
|
||||||
|
ps_section = tools.get("project-status", {}) if isinstance(tools, dict) else {}
|
||||||
|
expected_keys = ["thin_routes_max_lines", "cov_fail_under", "required_dirs_backend"]
|
||||||
|
if isinstance(ps_section, dict) and ps_section:
|
||||||
|
missing_keys = [k for k in expected_keys if k not in ps_section]
|
||||||
|
if not missing_keys:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.OK, "[tool.project-status]", "пороги заданы (uses defaults)"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"[tool.project-status]",
|
||||||
|
f"не заданы пороги: {', '.join(missing_keys)} (uses defaults)",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"[tool.project-status]",
|
||||||
|
"секция отсутствует — uses defaults",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 11: .pre-commit-config.yaml ──
|
||||||
|
if (REPO_ROOT / ".pre-commit-config.yaml").exists():
|
||||||
|
group.checks.append(CheckResult(CheckStatus.OK, ".pre-commit-config.yaml", "настроен"))
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(CheckStatus.WARN, ".pre-commit-config.yaml", "отсутствует (Python-проект)")
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 12: uv.lock exists ──
|
||||||
|
if (REPO_ROOT / "uv.lock").exists():
|
||||||
|
group.checks.append(CheckResult(CheckStatus.OK, "uv.lock", "существует"))
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(CheckStatus.WARN, "uv.lock", "отсутствует — запусти `uv lock` и закоммить")
|
||||||
|
)
|
||||||
|
|
||||||
|
# ── Check 13: requires-python vs .python-version ──
|
||||||
|
python_version_path = REPO_ROOT / ".python-version"
|
||||||
|
requires_python_val = project.get("requires-python", "") if isinstance(project, dict) else ""
|
||||||
|
if python_version_path.exists() and requires_python_val:
|
||||||
|
try:
|
||||||
|
pv_content = python_version_path.read_text(encoding="utf-8-sig")
|
||||||
|
except OSError:
|
||||||
|
pv_content = ""
|
||||||
|
group.checks.append(_check_python_version_compat(str(requires_python_val), pv_content))
|
||||||
|
elif not python_version_path.exists():
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"requires-python vs .python-version",
|
||||||
|
".python-version отсутствует — skip",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
group.checks.append(
|
||||||
|
CheckResult(
|
||||||
|
CheckStatus.WARN,
|
||||||
|
"requires-python vs .python-version",
|
||||||
|
"requires-python не задан — skip",
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
return group
|
||||||
|
|
||||||
|
|
||||||
# ── orchestration ────────────────────────────────────────────────────────────
|
# ── orchestration ────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -659,19 +1136,27 @@ CHECK_GROUPS: list[str] = [
|
||||||
"README",
|
"README",
|
||||||
"Infra",
|
"Infra",
|
||||||
"Coverage",
|
"Coverage",
|
||||||
|
"Pyproject",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
def run_all_checks(ptype: ProjectType, fast: bool = False) -> list[GroupResult]:
|
def run_all_checks(
|
||||||
"""Run all 7 check groups, return results in order."""
|
ptype: ProjectType, fast: bool = False, repo_root: Path | None = None
|
||||||
|
) -> list[GroupResult]:
|
||||||
|
"""Run all 8 check groups, return results in order.
|
||||||
|
|
||||||
|
If ``repo_root`` is given, it is forwarded to ``check_infra`` for
|
||||||
|
``git -C`` based remote detection (used with ``--repo`` flag).
|
||||||
|
"""
|
||||||
return [
|
return [
|
||||||
check_structure(ptype),
|
check_structure(ptype),
|
||||||
check_thin_routes(ptype, fast=fast),
|
check_thin_routes(ptype, fast=fast),
|
||||||
check_quality(ptype),
|
check_quality(ptype),
|
||||||
check_tests(ptype),
|
check_tests(ptype),
|
||||||
check_readme(ptype),
|
check_readme(ptype),
|
||||||
check_infra(ptype, fast=fast),
|
check_infra(ptype, fast=fast, repo_root=repo_root),
|
||||||
check_coverage(ptype),
|
check_coverage(ptype),
|
||||||
|
check_pyproject(ptype),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -713,13 +1198,49 @@ def format_output(ptype: ProjectType, groups: list[GroupResult]) -> str:
|
||||||
return "\n".join(lines)
|
return "\n".join(lines)
|
||||||
|
|
||||||
|
|
||||||
|
def _parse_args(argv: list[str]) -> argparse.Namespace:
|
||||||
|
"""Parse CLI args."""
|
||||||
|
parser = argparse.ArgumentParser(
|
||||||
|
prog="project-status.py",
|
||||||
|
description="Read-only check of repo architecture conformance.",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--check",
|
||||||
|
action="store_true",
|
||||||
|
help="strict mode — exit 1 on any FAIL",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--fast",
|
||||||
|
action="store_true",
|
||||||
|
help="skip slow/remote checks (branch protection via gh)",
|
||||||
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--repo",
|
||||||
|
type=str,
|
||||||
|
default=None,
|
||||||
|
help="path to repo to check (default: cwd / current repo)",
|
||||||
|
)
|
||||||
|
return parser.parse_args(argv)
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
"""Entry point: parse args, run checks, print report, set exit code."""
|
"""Entry point: parse args, run checks, print report, set exit code."""
|
||||||
args = sys.argv[1:]
|
global REPO_ROOT, CONFIG # noqa: PLW0603
|
||||||
strict = "--check" in args
|
args = _parse_args(sys.argv[1:])
|
||||||
fast = "--fast" in args
|
strict = args.check
|
||||||
|
fast = args.fast
|
||||||
|
repo_arg = args.repo
|
||||||
|
|
||||||
|
if repo_arg:
|
||||||
|
repo_path = Path(repo_arg).resolve()
|
||||||
|
if not repo_path.exists():
|
||||||
|
print(f"FAIL: repo path not found: {repo_path}")
|
||||||
|
sys.exit(1)
|
||||||
|
REPO_ROOT = repo_path
|
||||||
|
CONFIG = load_config()
|
||||||
|
|
||||||
ptype = detect_project_type()
|
ptype = detect_project_type()
|
||||||
groups = run_all_checks(ptype, fast=fast)
|
groups = run_all_checks(ptype, fast=fast, repo_root=REPO_ROOT if repo_arg else None)
|
||||||
print(format_output(ptype, groups))
|
print(format_output(ptype, groups))
|
||||||
if strict and any(g.overall() == CheckStatus.FAIL for g in groups):
|
if strict and any(g.overall() == CheckStatus.FAIL for g in groups):
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
|
||||||
|
|
@ -4,19 +4,22 @@ import { tool } from "@opencode-ai/plugin"
|
||||||
|
|
||||||
export default tool({
|
export default tool({
|
||||||
description:
|
description:
|
||||||
"Project status oracle. Read-only check of repo architecture conformance. Auto-detects project type (frontend→fullstack, fastapi→backend, typer→cli, aiogram→bot, prefect→worker) and runs 7 check groups: Структура, Тонкие роуты (AST ≤50 lines), Качество кода (mypy/ruff/pytest), Тесты (conftest, stub-detector, no @pytest.mark.asyncio), README (12 delimiter tags), Infra (branch protection, ci.yml, dependabot, LICENSE, pre-commit), Coverage (non-blocking). Non-blocking default (exit 0); pass check=true for strict (exit 1 on FAIL); pass fast=true to skip slow/remote checks (branch protection).",
|
"Project status oracle. Read-only check of repo architecture conformance. Auto-detects project type (frontend→fullstack, fastapi→backend, typer→cli, aiogram→bot, prefect→worker) and runs 8 check groups: Структура, Тонкие роуты (AST ≤50 lines), Качество кода (mypy/ruff/pytest), Тесты (conftest, stub-detector, no @pytest.mark.asyncio), README (12 delimiter tags), Infra (branch protection, ci.yml, dependabot, LICENSE, pre-commit), Coverage (non-blocking), Pyproject (13 checks: build-system, hatch wheel, project fields, ruff/mypy/pytest config, coverage, pre-commit, uv.lock, requires-python vs .python-version). Non-blocking default (exit 0); pass check=true for strict (exit 1 on FAIL); pass fast=true to skip slow/remote checks (branch protection); pass repo=<path> to check an arbitrary repo instead of the current worktree.",
|
||||||
args: {
|
args: {
|
||||||
check: tool.schema.boolean().optional().describe("If true, strict mode — exit 1 on any FAIL"),
|
check: tool.schema.boolean().optional().describe("If true, strict mode — exit 1 on any FAIL"),
|
||||||
fast: tool.schema.boolean().optional().describe("If true, skip slow/remote checks (branch protection via gh)"),
|
fast: tool.schema.boolean().optional().describe("If true, skip slow/remote checks (branch protection via gh)"),
|
||||||
|
repo: tool.schema.string().optional().describe("Path to repo to check (default: current worktree). Use to run against an arbitrary repo without switching cwd, e.g. project-status --repo /root/workspace/youtube-kit"),
|
||||||
},
|
},
|
||||||
async execute(args, context) {
|
async execute(args, context) {
|
||||||
const script = path.join(import.meta.dir, "..", "scripts", "project-status.py")
|
const script = path.join(import.meta.dir, "..", "scripts", "project-status.py")
|
||||||
const cmdArgs: string[] = []
|
const cmdArgs: string[] = []
|
||||||
if (args.check) cmdArgs.push("--check")
|
if (args.check) cmdArgs.push("--check")
|
||||||
if (args.fast) cmdArgs.push("--fast")
|
if (args.fast) cmdArgs.push("--fast")
|
||||||
|
if (args.repo) cmdArgs.push("--repo", args.repo)
|
||||||
|
const cwd = args.repo ? path.resolve(args.repo) : context.worktree
|
||||||
const r = spawnSync("python3", [script, ...cmdArgs], {
|
const r = spawnSync("python3", [script, ...cmdArgs], {
|
||||||
encoding: "utf-8",
|
encoding: "utf-8",
|
||||||
cwd: context.worktree,
|
cwd,
|
||||||
})
|
})
|
||||||
if (r.status === null) {
|
if (r.status === null) {
|
||||||
return `⚠️ project_status failed (no exit): ${r.stderr || r.stdout}`
|
return `⚠️ project_status failed (no exit): ${r.stderr || r.stdout}`
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@ classifiers = [
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"httpx",
|
"httpx",
|
||||||
"numpy",
|
"numpy",
|
||||||
|
"packaging>=24.0",
|
||||||
"tenacity",
|
"tenacity",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -207,24 +207,30 @@ function loadTool(spawnSyncImpl, fsImpl) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildExecArgs(tool, rawValue) {
|
function buildExecArgs(tool, rawValue) {
|
||||||
// Interpret ``rawValue`` (argv string) as the tool's first declared arg.
|
// Interpret ``rawValue`` (argv string) as the tool's declared args.
|
||||||
// - pipeline-status.ts: ``pr_number`` (int) → parseInt
|
// - pipeline-status.ts: ``pr_number`` (int) → parseInt
|
||||||
// - spec-status.ts: ``validate`` (bool) → /true/i match
|
// - spec-status.ts: ``validate`` (bool) → /true/i match
|
||||||
// - project-status.ts: ``check`` (bool) + ``fast`` (bool) — multi-arg
|
// - project-status.ts: ``check`` (bool) + ``fast`` (bool) + ``repo`` (str) —
|
||||||
// boolean tool. ``rawValue`` encodes both as "check|fast" (e.g. "true|false").
|
// multi-arg tool. ``rawValue`` encodes the booleans as "check|fast" and an
|
||||||
// Detected dynamically: if the tool declares ``check`` AND ``fast``, split
|
// optional third pipe-separated part carries the ``repo`` string:
|
||||||
// the raw value on ``|`` and map each to a boolean.
|
// "true|false|/path/to/repo". Detected dynamically: if the tool declares
|
||||||
|
// ``check`` AND ``fast``, split on ``|`` and map the first two to booleans;
|
||||||
|
// if a third part exists and the tool declares ``repo``, pass it as string.
|
||||||
// Detection is dynamic so the harness works for any single-arg tool
|
// Detection is dynamic so the harness works for any single-arg tool
|
||||||
// without hardcoding tool names. If the tool declares no args, return {}.
|
// without hardcoding tool names. If the tool declares no args, return {}.
|
||||||
const keys = Object.keys(tool.args || {})
|
const keys = Object.keys(tool.args || {})
|
||||||
if (keys.length === 0) return {}
|
if (keys.length === 0) return {}
|
||||||
// Multi-arg boolean tool (project-status.ts: check + fast).
|
// Multi-arg tool (project-status.ts: check + fast [+ repo]).
|
||||||
if (keys.includes("check") && keys.includes("fast")) {
|
if (keys.includes("check") && keys.includes("fast")) {
|
||||||
const parts = String(rawValue || "").split("|")
|
const parts = String(rawValue || "").split("|")
|
||||||
return {
|
const args = {
|
||||||
check: /^true$/i.test(parts[0] || ""),
|
check: /^true$/i.test(parts[0] || ""),
|
||||||
fast: /^true$/i.test(parts[1] || ""),
|
fast: /^true$/i.test(parts[1] || ""),
|
||||||
}
|
}
|
||||||
|
if (keys.includes("repo") && parts[2] !== undefined && parts[2] !== "") {
|
||||||
|
args.repo = parts[2]
|
||||||
|
}
|
||||||
|
return args
|
||||||
}
|
}
|
||||||
const first = keys[0]
|
const first = keys[0]
|
||||||
if (first === "pr_number") return { pr_number: parseInt(rawValue, 10) }
|
if (first === "pr_number") return { pr_number: parseInt(rawValue, 10) }
|
||||||
|
|
|
||||||
|
|
@ -62,20 +62,28 @@ def _tool_sections(
|
||||||
"""Build the [tool.*] section lines for pyproject.toml."""
|
"""Build the [tool.*] section lines for pyproject.toml."""
|
||||||
lines: list[str] = []
|
lines: list[str] = []
|
||||||
if has_ruff:
|
if has_ruff:
|
||||||
lines.extend(["[tool.ruff]", 'target-version = "py312"', ""])
|
lines.extend(["[tool.ruff]", 'target-version = "py312"', "line-length = 100", ""])
|
||||||
if has_mypy:
|
if has_mypy:
|
||||||
lines.extend(["[tool.mypy]", 'python_version = "3.12"', ""])
|
lines.extend(["[tool.mypy]", 'python_version = "3.12"', "strict = true", ""])
|
||||||
if has_pytest:
|
if has_pytest:
|
||||||
lines.append("[tool.pytest.ini_options]")
|
lines.append("[tool.pytest.ini_options]")
|
||||||
addopts = "--cov=src --cov-report=term-missing --timeout=120"
|
addopts = "--cov=src --cov-report=term-missing --timeout=120"
|
||||||
if cov_fail:
|
if cov_fail:
|
||||||
addopts += f" --cov-fail-under={cov_fail}"
|
addopts += f" --cov-fail-under={cov_fail}"
|
||||||
lines.append(f'addopts = "{addopts}"')
|
lines.append(f'addopts = "{addopts}"')
|
||||||
lines.extend(['testpaths = ["tests"]', ""])
|
lines.extend(['asyncio_mode = "auto"', 'testpaths = ["tests"]', ""])
|
||||||
if cov_source is not None:
|
if cov_source is not None:
|
||||||
lines.append("[tool.coverage.run]")
|
lines.append("[tool.coverage.run]")
|
||||||
source_str = ", ".join(f'"{s}"' for s in cov_source)
|
source_str = ", ".join(f'"{s}"' for s in cov_source)
|
||||||
lines.append(f"source = [{source_str}]")
|
lines.append(f"source = [{source_str}]")
|
||||||
|
lines.append("branch = true")
|
||||||
|
lines.append("")
|
||||||
|
lines.append("[tool.coverage.report]")
|
||||||
|
lines.append("exclude_lines = [")
|
||||||
|
lines.append(' "pragma: no cover",')
|
||||||
|
lines.append(' "if __name__ == .__main__.:",')
|
||||||
|
lines.append(' "if TYPE_CHECKING:",')
|
||||||
|
lines.append("]")
|
||||||
lines.append("")
|
lines.append("")
|
||||||
return lines
|
return lines
|
||||||
|
|
||||||
|
|
@ -90,16 +98,27 @@ def _write_pyproject(
|
||||||
has_pytest: bool = True,
|
has_pytest: bool = True,
|
||||||
cov_source: list | None = None,
|
cov_source: list | None = None,
|
||||||
cov_fail: str | None = None,
|
cov_fail: str | None = None,
|
||||||
|
name: str = "test-repo",
|
||||||
|
description: str = "test repo for project-status",
|
||||||
|
requires_python: str = ">=3.12",
|
||||||
|
hatch_packages: list | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Write a minimal pyproject.toml with the requested [tool.*] sections."""
|
"""Write a minimal pyproject.toml with the requested [tool.*] sections."""
|
||||||
|
norm_name = (
|
||||||
|
ps._normalize_package_name(name)
|
||||||
|
if hasattr(ps, "_normalize_package_name")
|
||||||
|
else name.replace("-", "_")
|
||||||
|
)
|
||||||
lines = [
|
lines = [
|
||||||
"[build-system]",
|
"[build-system]",
|
||||||
'requires = ["hatchling"]',
|
'requires = ["hatchling"]',
|
||||||
'build-backend = "hatchling.build"',
|
'build-backend = "hatchling.build"',
|
||||||
"",
|
"",
|
||||||
"[project]",
|
"[project]",
|
||||||
'name = "test-repo"',
|
f'name = "{name}"',
|
||||||
'version = "0.1.0"',
|
'version = "0.1.0"',
|
||||||
|
f'description = "{description}"',
|
||||||
|
f'requires-python = "{requires_python}"',
|
||||||
"",
|
"",
|
||||||
"dependencies = [",
|
"dependencies = [",
|
||||||
]
|
]
|
||||||
|
|
@ -118,6 +137,18 @@ def _write_pyproject(
|
||||||
for k, v in scripts.items():
|
for k, v in scripts.items():
|
||||||
lines.append(f'{k} = "{v}"')
|
lines.append(f'{k} = "{v}"')
|
||||||
lines.append("")
|
lines.append("")
|
||||||
|
# [tool.hatch.build.targets.wheel] packages — only emit if src/<pkg>/ exists
|
||||||
|
# or caller explicitly passes hatch_packages.
|
||||||
|
src_pkg = tmp_path / "src" / norm_name
|
||||||
|
if hatch_packages is not None:
|
||||||
|
lines.append("[tool.hatch.build.targets.wheel]")
|
||||||
|
pkgs_str = ", ".join(f'"{p}"' for p in hatch_packages)
|
||||||
|
lines.append(f"packages = [{pkgs_str}]")
|
||||||
|
lines.append("")
|
||||||
|
elif src_pkg.exists():
|
||||||
|
lines.append("[tool.hatch.build.targets.wheel]")
|
||||||
|
lines.append(f'packages = ["src/{norm_name}"]')
|
||||||
|
lines.append("")
|
||||||
lines.extend(_tool_sections(has_ruff, has_mypy, has_pytest, cov_source, cov_fail))
|
lines.extend(_tool_sections(has_ruff, has_mypy, has_pytest, cov_source, cov_fail))
|
||||||
(tmp_path / "pyproject.toml").write_text("\n".join(lines))
|
(tmp_path / "pyproject.toml").write_text("\n".join(lines))
|
||||||
|
|
||||||
|
|
@ -145,6 +176,10 @@ def _make_backend_repo(tmp_path: Path) -> None:
|
||||||
_write_pyproject(tmp_path, deps=["fastapi", "uvicorn"], cov_source=["src"], cov_fail="80")
|
_write_pyproject(tmp_path, deps=["fastapi", "uvicorn"], cov_source=["src"], cov_fail="80")
|
||||||
(tmp_path / "tests/conftest.py").write_text("import pytest\n")
|
(tmp_path / "tests/conftest.py").write_text("import pytest\n")
|
||||||
(tmp_path / "tests/test_users.py").write_text("def test_ok(): assert True\n")
|
(tmp_path / "tests/test_users.py").write_text("def test_ok(): assert True\n")
|
||||||
|
# Extras for check_pyproject (group 8) to pass:
|
||||||
|
(tmp_path / ".python-version").write_text("3.12\n")
|
||||||
|
(tmp_path / "uv.lock").write_text("# minimal lockfile stub\n")
|
||||||
|
(tmp_path / ".pre-commit-config.yaml").write_text("repos: []\n")
|
||||||
|
|
||||||
|
|
||||||
# ── parse_remote_url ─────────────────────────────────────────────────────────
|
# ── parse_remote_url ─────────────────────────────────────────────────────────
|
||||||
|
|
@ -629,8 +664,596 @@ def test_main_fast_flag(monkeypatch, tmp_path, capsys):
|
||||||
# ── run_all_checks integration ───────────────────────────────────────────────
|
# ── run_all_checks integration ───────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
def test_run_all_checks_returns_7_groups(tmp_path):
|
def test_run_all_checks_returns_8_groups(tmp_path):
|
||||||
_make_backend_repo(tmp_path)
|
_make_backend_repo(tmp_path)
|
||||||
groups = ps.run_all_checks(ps.ProjectType.BACKEND, fast=True)
|
groups = ps.run_all_checks(ps.ProjectType.BACKEND, fast=True)
|
||||||
assert len(groups) == 7
|
assert len(groups) == 8
|
||||||
assert [g.name for g in groups] == ps.CHECK_GROUPS
|
assert [g.name for g in groups] == ps.CHECK_GROUPS
|
||||||
|
|
||||||
|
|
||||||
|
# ── check_pyproject (group 8, 13 checks) ─────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
|
def _write_full_pyproject( # noqa: C901, PLR0912, PLR0915
|
||||||
|
tmp_path: Path,
|
||||||
|
*,
|
||||||
|
name: str = "test-repo",
|
||||||
|
description: str = "test repo",
|
||||||
|
requires_python: str = ">=3.12",
|
||||||
|
has_build_system: bool = True,
|
||||||
|
has_project_fields: bool = True,
|
||||||
|
has_ruff: bool = True,
|
||||||
|
has_mypy: bool = True,
|
||||||
|
mypy_strict: bool = True,
|
||||||
|
has_pytest: bool = True,
|
||||||
|
pytest_asyncio_auto: bool = True,
|
||||||
|
pytest_testpaths_tests: bool = True,
|
||||||
|
has_cov_run: bool = True,
|
||||||
|
cov_branch: bool = True,
|
||||||
|
has_cov_report_exclude: bool = True,
|
||||||
|
has_cov_fail_under: bool = True,
|
||||||
|
cov_fail: str = "80",
|
||||||
|
has_project_status_section: bool = False,
|
||||||
|
has_pre_commit: bool = True,
|
||||||
|
has_uv_lock: bool = True,
|
||||||
|
has_python_version: bool = True,
|
||||||
|
python_version_content: str = "3.12\n",
|
||||||
|
ruff_toml: bool = False,
|
||||||
|
mypy_ini: bool = False,
|
||||||
|
src_pkg_exists: bool = False,
|
||||||
|
hatch_packages_override: list | None = None,
|
||||||
|
) -> None:
|
||||||
|
"""Write a pyproject.toml with fine-grained control over every check section.
|
||||||
|
|
||||||
|
Used by the 13-check test suite for ``check_pyproject``. Each kwarg
|
||||||
|
toggles a specific check's pass/warn/fail condition.
|
||||||
|
"""
|
||||||
|
norm_name = ps._normalize_package_name(name)
|
||||||
|
lines: list[str] = []
|
||||||
|
if has_build_system:
|
||||||
|
lines.extend(
|
||||||
|
[
|
||||||
|
"[build-system]",
|
||||||
|
'requires = ["hatchling"]',
|
||||||
|
'build-backend = "hatchling.build"',
|
||||||
|
"",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
project_lines = ["[project]", f'name = "{name}"', 'version = "0.1.0"']
|
||||||
|
if has_project_fields:
|
||||||
|
project_lines.append(f'description = "{description}"')
|
||||||
|
project_lines.append(f'requires-python = "{requires_python}"')
|
||||||
|
lines.extend([*project_lines, "", "dependencies = []", ""])
|
||||||
|
if src_pkg_exists:
|
||||||
|
(tmp_path / "src" / norm_name).mkdir(parents=True, exist_ok=True)
|
||||||
|
(tmp_path / "src" / norm_name / "__init__.py").write_text("")
|
||||||
|
lines.append("[tool.hatch.build.targets.wheel]")
|
||||||
|
lines.append(f'packages = ["src/{norm_name}"]')
|
||||||
|
lines.append("")
|
||||||
|
elif hatch_packages_override is not None:
|
||||||
|
lines.append("[tool.hatch.build.targets.wheel]")
|
||||||
|
pkgs_str = ", ".join(f'"{p}"' for p in hatch_packages_override)
|
||||||
|
lines.append(f"packages = [{pkgs_str}]")
|
||||||
|
lines.append("")
|
||||||
|
if has_ruff and not ruff_toml:
|
||||||
|
lines.extend(["[tool.ruff]", 'target-version = "py312"', "line-length = 100", ""])
|
||||||
|
if ruff_toml:
|
||||||
|
(tmp_path / "ruff.toml").write_text("line-length = 100\ntarget-version = py312\n")
|
||||||
|
if has_mypy and not mypy_ini:
|
||||||
|
lines.extend(["[tool.mypy]"])
|
||||||
|
if mypy_strict:
|
||||||
|
lines.append("strict = true")
|
||||||
|
else:
|
||||||
|
lines.append('python_version = "3.12"')
|
||||||
|
lines.append("")
|
||||||
|
if mypy_ini:
|
||||||
|
(tmp_path / "mypy.ini").write_text("[mypy]\nstrict = True\n")
|
||||||
|
if has_pytest:
|
||||||
|
lines.append("[tool.pytest.ini_options]")
|
||||||
|
if pytest_asyncio_auto:
|
||||||
|
lines.append('asyncio_mode = "auto"')
|
||||||
|
if pytest_testpaths_tests:
|
||||||
|
lines.append('testpaths = ["tests"]')
|
||||||
|
addopts = "--cov=src --cov-report=term-missing"
|
||||||
|
if has_cov_fail_under and cov_fail:
|
||||||
|
addopts += f" --cov-fail-under={cov_fail}"
|
||||||
|
lines.append(f'addopts = "{addopts}"')
|
||||||
|
lines.append("")
|
||||||
|
if has_cov_run:
|
||||||
|
lines.append("[tool.coverage.run]")
|
||||||
|
lines.append('source = ["src"]')
|
||||||
|
if cov_branch:
|
||||||
|
lines.append("branch = true")
|
||||||
|
lines.append("")
|
||||||
|
if has_cov_report_exclude:
|
||||||
|
lines.append("[tool.coverage.report]")
|
||||||
|
lines.append("exclude_lines = [")
|
||||||
|
lines.append(' "pragma: no cover",')
|
||||||
|
lines.append(' "if __name__ == .__main__.:",')
|
||||||
|
lines.append(' "if TYPE_CHECKING:",')
|
||||||
|
lines.append("]")
|
||||||
|
lines.append("")
|
||||||
|
if has_project_status_section:
|
||||||
|
lines.extend(
|
||||||
|
[
|
||||||
|
"[tool.project-status]",
|
||||||
|
"thin_routes_max_lines = 50",
|
||||||
|
"cov_fail_under = 80",
|
||||||
|
'required_dirs_backend = ["src/api/v1"]',
|
||||||
|
"",
|
||||||
|
]
|
||||||
|
)
|
||||||
|
(tmp_path / "pyproject.toml").write_text("\n".join(lines))
|
||||||
|
if has_pre_commit:
|
||||||
|
(tmp_path / ".pre-commit-config.yaml").write_text("repos: []\n")
|
||||||
|
if has_uv_lock:
|
||||||
|
(tmp_path / "uv.lock").write_text("# lockfile\n")
|
||||||
|
if has_python_version:
|
||||||
|
(tmp_path / ".python-version").write_text(python_version_content)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_all_ok(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_project_status_section=True, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert group.overall() == ps.CheckStatus.OK, (
|
||||||
|
f"expected OK, got {group.overall()}: "
|
||||||
|
+ ", ".join(f"{c.name}={c.status.value}" for c in group.checks)
|
||||||
|
)
|
||||||
|
assert len(group.checks) == 13, f"expected 13 checks, got {len(group.checks)}"
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_no_pyproject_warn(tmp_path):
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert group.overall() == ps.CheckStatus.WARN
|
||||||
|
assert any(c.name == "pyproject.toml" and c.status == ps.CheckStatus.WARN for c in group.checks)
|
||||||
|
assert len(group.checks) == 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_invalid_toml_fail(tmp_path):
|
||||||
|
(tmp_path / "pyproject.toml").write_text("not valid = = =")
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert group.overall() == ps.CheckStatus.FAIL
|
||||||
|
assert any("парсинг" in c.detail for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check1_build_system_fail(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_build_system=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "[build-system]" and c.status == ps.CheckStatus.FAIL for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check2_hatch_wheel_ok_with_src_pkg(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.hatch.build.targets.wheel]" and c.status == ps.CheckStatus.OK
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check2_hatch_wheel_fail_missing_packages(tmp_path):
|
||||||
|
"""src/<pkg>/ exists but packages doesn't reference it → FAIL."""
|
||||||
|
(tmp_path / "src").mkdir()
|
||||||
|
(tmp_path / "src" / "test_repo").mkdir()
|
||||||
|
(tmp_path / "src" / "test_repo" / "__init__.py").write_text("")
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=False)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.hatch.build.targets.wheel]" and c.status == ps.CheckStatus.FAIL
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check2_hatch_wheel_ok_with_src_root(tmp_path):
|
||||||
|
"""packages=["src"] is accepted when src/<pkg>/ exists (hatchling convention)."""
|
||||||
|
(tmp_path / "src").mkdir()
|
||||||
|
(tmp_path / "src" / "test_repo").mkdir()
|
||||||
|
(tmp_path / "src" / "test_repo" / "__init__.py").write_text("")
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=False, hatch_packages_override=["src"])
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.hatch.build.targets.wheel]" and c.status == ps.CheckStatus.OK
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check2_hatch_wheel_warn_app_layout(tmp_path):
|
||||||
|
"""src/ exists but no src/<pkg>/ → WARN (app-layout for backend)."""
|
||||||
|
(tmp_path / "src").mkdir()
|
||||||
|
(tmp_path / "src" / "api").mkdir()
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=False)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.hatch.build.targets.wheel]"
|
||||||
|
and c.status == ps.CheckStatus.WARN
|
||||||
|
and "app-layout" in c.detail
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check3_project_fields_fail(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_project_fields=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "[project]" and c.status == ps.CheckStatus.FAIL for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check4_ruff_ok(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "[tool.ruff]" and c.status == ps.CheckStatus.OK for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check4_ruff_toml_ok(tmp_path):
|
||||||
|
"""ruff.toml is an accepted alternative to [tool.ruff]."""
|
||||||
|
_write_full_pyproject(tmp_path, has_ruff=False, ruff_toml=True, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "[tool.ruff]" and c.status == ps.CheckStatus.OK for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check4_ruff_missing_fail(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_ruff=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "[tool.ruff]" and c.status == ps.CheckStatus.FAIL for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check5_mypy_strict_ok(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "[tool.mypy]" and c.status == ps.CheckStatus.OK for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check5_mypy_ini_ok(tmp_path):
|
||||||
|
"""mypy.ini is an accepted alternative to [tool.mypy]."""
|
||||||
|
_write_full_pyproject(tmp_path, has_mypy=False, mypy_ini=True, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "[tool.mypy]" and c.status == ps.CheckStatus.OK for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check5_mypy_not_strict_warn(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, mypy_strict=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "[tool.mypy]" and c.status == ps.CheckStatus.WARN for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check5_mypy_missing_fail(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_mypy=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "[tool.mypy]" and c.status == ps.CheckStatus.FAIL for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check6_pytest_ok(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.pytest.ini_options]" and c.status == ps.CheckStatus.OK
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check6_pytest_missing_fail(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_pytest=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.pytest.ini_options]" and c.status == ps.CheckStatus.FAIL
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check6_pytest_wrong_mode_warn(tmp_path):
|
||||||
|
_write_full_pyproject(
|
||||||
|
tmp_path, pytest_asyncio_auto=False, pytest_testpaths_tests=False, src_pkg_exists=True
|
||||||
|
)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.pytest.ini_options]" and c.status == ps.CheckStatus.WARN
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check7_cov_run_ok(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.coverage.run]" and c.status == ps.CheckStatus.OK for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check7_cov_run_warn_no_branch(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, cov_branch=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.coverage.run]" and c.status == ps.CheckStatus.WARN for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check8_cov_report_exclude_ok(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.coverage.report]" and c.status == ps.CheckStatus.OK for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check8_cov_report_exclude_warn(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_cov_report_exclude=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.coverage.report]" and c.status == ps.CheckStatus.WARN for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check9_cov_fail_under_ok(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "addopts --cov-fail-under" and c.status == ps.CheckStatus.OK for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check9_cov_fail_under_warn(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_cov_fail_under=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "addopts --cov-fail-under" and c.status == ps.CheckStatus.WARN
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check10_project_status_section_ok(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_project_status_section=True, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.project-status]" and c.status == ps.CheckStatus.OK for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check10_project_status_section_warn_default(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_project_status_section=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "[tool.project-status]" and c.status == ps.CheckStatus.WARN for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check11_pre_commit_ok(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == ".pre-commit-config.yaml" and c.status == ps.CheckStatus.OK for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check11_pre_commit_warn(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_pre_commit=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == ".pre-commit-config.yaml" and c.status == ps.CheckStatus.WARN
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check12_uv_lock_ok(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "uv.lock" and c.status == ps.CheckStatus.OK for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check12_uv_lock_warn(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_uv_lock=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(c.name == "uv.lock" and c.status == ps.CheckStatus.WARN for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check13_python_version_ok(tmp_path):
|
||||||
|
_write_full_pyproject(
|
||||||
|
tmp_path, requires_python=">=3.11", python_version_content="3.13\n", src_pkg_exists=True
|
||||||
|
)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "requires-python vs .python-version" and c.status == ps.CheckStatus.OK
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check13_python_version_fail_incompat(tmp_path):
|
||||||
|
_write_full_pyproject(
|
||||||
|
tmp_path, requires_python=">=3.11", python_version_content="3.10\n", src_pkg_exists=True
|
||||||
|
)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "requires-python vs .python-version" and c.status == ps.CheckStatus.FAIL
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_check13_skip_when_no_python_version(tmp_path):
|
||||||
|
_write_full_pyproject(tmp_path, has_python_version=False, src_pkg_exists=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert any(
|
||||||
|
c.name == "requires-python vs .python-version"
|
||||||
|
and c.status == ps.CheckStatus.WARN
|
||||||
|
and "skip" in c.detail
|
||||||
|
for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# ── normalize_package_name ───────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
|
def test_normalize_package_name():
|
||||||
|
assert ps._normalize_package_name("my-project") == "my_project"
|
||||||
|
assert ps._normalize_package_name("My.Project") == "my_project"
|
||||||
|
assert ps._normalize_package_name("my_project") == "my_project"
|
||||||
|
assert ps._normalize_package_name("MY-PROJECT") == "my_project"
|
||||||
|
|
||||||
|
|
||||||
|
# ── --repo flag ──────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
|
def test_main_repo_flag_nonexistent_path_exits_1(monkeypatch, tmp_path, capsys):
|
||||||
|
"""--repo with non-existent path → exit 1 + error message."""
|
||||||
|
monkeypatch.setattr("sys.argv", ["project-status.py", "--repo", str(tmp_path / "nonexistent")])
|
||||||
|
with pytest.raises(SystemExit) as exc:
|
||||||
|
ps.main()
|
||||||
|
assert exc.value.code == 1
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert "repo path not found" in captured.out
|
||||||
|
|
||||||
|
|
||||||
|
def test_main_repo_flag_overrides_repo_root(monkeypatch, tmp_path, capsys):
|
||||||
|
"""--repo with valid path → REPO_ROOT overridden, checks run against it."""
|
||||||
|
_make_backend_repo(tmp_path)
|
||||||
|
for rel in [".github/workflows", ".github"]:
|
||||||
|
(tmp_path / rel).mkdir(parents=True, exist_ok=True)
|
||||||
|
(tmp_path / ".github/workflows/ci.yml").write_text("name: CI\n")
|
||||||
|
(tmp_path / ".github/dependabot.yml").write_text("version: 2\n")
|
||||||
|
(tmp_path / "LICENSE").write_text("MIT\n")
|
||||||
|
_write_valid_readme(tmp_path)
|
||||||
|
monkeypatch.setattr(
|
||||||
|
ps,
|
||||||
|
"run_cmd",
|
||||||
|
mock_run_cmd(
|
||||||
|
{
|
||||||
|
("gh", "api"): (
|
||||||
|
0,
|
||||||
|
'{"rules":[{"type":"pull_request"},{"type":"required_status_checks"}]}',
|
||||||
|
"",
|
||||||
|
),
|
||||||
|
}
|
||||||
|
),
|
||||||
|
)
|
||||||
|
monkeypatch.setattr("sys.argv", ["project-status.py", "--repo", str(tmp_path)])
|
||||||
|
with pytest.raises(SystemExit) as exc:
|
||||||
|
ps.main()
|
||||||
|
assert exc.value.code == 0, f"expected exit 0, got {exc.value.code}"
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert "Project:" in captured.out
|
||||||
|
assert "Итог:" in captured.out
|
||||||
|
|
||||||
|
|
||||||
|
def test_main_repo_flag_relative_path(monkeypatch, tmp_path, capsys):
|
||||||
|
"""--repo with relative path → resolved against cwd."""
|
||||||
|
_make_backend_repo(tmp_path)
|
||||||
|
for rel in [".github/workflows", ".github"]:
|
||||||
|
(tmp_path / rel).mkdir(parents=True, exist_ok=True)
|
||||||
|
(tmp_path / ".github/workflows/ci.yml").write_text("name: CI\n")
|
||||||
|
(tmp_path / "LICENSE").write_text("MIT\n")
|
||||||
|
monkeypatch.setattr(ps, "run_cmd", mock_run_cmd({("gh", "api"): (1, "", "no auth")}))
|
||||||
|
# cwd = tmp_path, repo = "." (relative)
|
||||||
|
monkeypatch.chdir(tmp_path)
|
||||||
|
monkeypatch.setattr("sys.argv", ["project-status.py", "--repo", "."])
|
||||||
|
with pytest.raises(SystemExit) as exc:
|
||||||
|
ps.main()
|
||||||
|
assert exc.value.code == 0
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert "Project:" in captured.out
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_pyproject_uses_repo_root(tmp_path):
|
||||||
|
"""check_pyproject reads pyproject.toml from REPO_ROOT (tmp_path fixture)."""
|
||||||
|
_write_full_pyproject(tmp_path, src_pkg_exists=True, has_project_status_section=True)
|
||||||
|
group = ps.check_pyproject(ps.ProjectType.BACKEND)
|
||||||
|
assert group.overall() == ps.CheckStatus.OK, (
|
||||||
|
f"expected OK, got {group.overall()}: "
|
||||||
|
+ ", ".join(
|
||||||
|
f"{c.name}={c.status.value}" for c in group.checks if c.status != ps.CheckStatus.OK
|
||||||
|
)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
# ── flat-layout check in check_structure ──────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_structure_flat_layout_warn_for_cli(tmp_path):
|
||||||
|
"""CLI/UNKNOWN with src/ but no nested package → WARN flat src/."""
|
||||||
|
(tmp_path / "src").mkdir()
|
||||||
|
(tmp_path / "src" / "api").mkdir()
|
||||||
|
(tmp_path / "src" / "db").mkdir()
|
||||||
|
_write_pyproject(tmp_path, deps=["typer"], scripts={"mycli": "mycli.cli:main"})
|
||||||
|
group = ps.check_structure(ps.ProjectType.CLI)
|
||||||
|
assert any(
|
||||||
|
c.name == "flat src/ layout" and c.status == ps.CheckStatus.WARN for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_structure_no_flat_warn_for_backend(tmp_path):
|
||||||
|
"""Backend with src/api/ (app-layout) → no flat-layout WARN."""
|
||||||
|
_make_backend_repo(tmp_path)
|
||||||
|
group = ps.check_structure(ps.ProjectType.BACKEND)
|
||||||
|
assert not any(c.name == "flat src/ layout" for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_structure_no_flat_warn_when_nested_pkg(tmp_path):
|
||||||
|
"""CLI with src/<pkg>/__init__.py → no flat-layout WARN."""
|
||||||
|
(tmp_path / "src").mkdir()
|
||||||
|
pkg = tmp_path / "src" / "mycli"
|
||||||
|
pkg.mkdir()
|
||||||
|
(pkg / "__init__.py").write_text("")
|
||||||
|
_write_pyproject(tmp_path, deps=["typer"], scripts={"mycli": "mycli.cli:main"}, name="mycli")
|
||||||
|
group = ps.check_structure(ps.ProjectType.CLI)
|
||||||
|
assert not any(c.name == "flat src/ layout" for c in group.checks)
|
||||||
|
|
||||||
|
|
||||||
|
# ── get_repo_full_name with repo arg ─────────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_repo_full_name_with_repo_arg(monkeypatch, tmp_path):
|
||||||
|
"""get_repo_full_name(repo=Path) uses git -C <repo>."""
|
||||||
|
(tmp_path / ".git").mkdir() # mark as git repo (not actually needed for mock)
|
||||||
|
|
||||||
|
# Override the default GIT_REMOTE_MOCK so only the -C form matches
|
||||||
|
def _mock(args: list[str]) -> tuple[int, str, str]:
|
||||||
|
if args[:3] == ["git", "-C", str(tmp_path)] and args[3:] == ["remote", "get-url", "origin"]:
|
||||||
|
return (0, "https://github.com/slaid098/foo.git\n", "")
|
||||||
|
return (1, "", f"unmocked: {args}")
|
||||||
|
|
||||||
|
monkeypatch.setattr(ps, "run_cmd", _mock)
|
||||||
|
assert ps.get_repo_full_name(tmp_path) == "slaid098/foo"
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_repo_full_name_no_repo_arg_uses_cwd(monkeypatch):
|
||||||
|
"""get_repo_full_name() without repo arg → plain git remote (cwd)."""
|
||||||
|
monkeypatch.setattr(ps, "run_cmd", mock_run_cmd({}))
|
||||||
|
assert ps.get_repo_full_name() == "slaid098/opencode-config"
|
||||||
|
|
||||||
|
|
||||||
|
# ── check_infra with repo_root (git -C) ─────────────────────────────────────
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_infra_repo_root_git_c(monkeypatch, tmp_path):
|
||||||
|
"""check_infra(repo_root=...) → git -C <repo_root> for branch protection."""
|
||||||
|
for rel in [".github/workflows", ".github"]:
|
||||||
|
(tmp_path / rel).mkdir(parents=True, exist_ok=True)
|
||||||
|
(tmp_path / ".github/workflows/ci.yml").write_text("name: CI\n")
|
||||||
|
(tmp_path / "LICENSE").write_text("MIT\n")
|
||||||
|
|
||||||
|
def _mock(args: list[str]) -> tuple[int, str, str]:
|
||||||
|
if args[:3] == ["git", "-C", str(tmp_path)] and args[3:] == ["remote", "get-url", "origin"]:
|
||||||
|
return (0, "https://github.com/slaid098/bar.git\n", "")
|
||||||
|
if args[:2] == ["gh", "api"] and len(args) >= 3 and "repos/slaid098/bar" in args[2]:
|
||||||
|
return (0, '{"rules":[{"type":"pull_request"},{"type":"required_status_checks"}]}', "")
|
||||||
|
return (1, "", f"unmocked: {args}")
|
||||||
|
|
||||||
|
monkeypatch.setattr(ps, "run_cmd", _mock)
|
||||||
|
group = ps.check_infra(ps.ProjectType.BACKEND, fast=False, repo_root=tmp_path)
|
||||||
|
assert any(
|
||||||
|
c.name == "branch protection" and c.status == ps.CheckStatus.OK for c in group.checks
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_check_infra_repo_root_not_git_repo_warn(monkeypatch, tmp_path):
|
||||||
|
"""check_infra(repo_root=non-git) → WARN 'git remote недоступен'."""
|
||||||
|
(tmp_path / ".github/workflows").mkdir(parents=True, exist_ok=True)
|
||||||
|
(tmp_path / ".github/workflows/ci.yml").write_text("name: CI\n")
|
||||||
|
(tmp_path / "LICENSE").write_text("MIT\n")
|
||||||
|
|
||||||
|
def _mock(args: list[str]) -> tuple[int, str, str]:
|
||||||
|
if args[:3] == ["git", "-C", str(tmp_path)]:
|
||||||
|
return (1, "", "not a git repo")
|
||||||
|
return (1, "", f"unmocked: {args}")
|
||||||
|
|
||||||
|
monkeypatch.setattr(ps, "run_cmd", _mock)
|
||||||
|
group = ps.check_infra(ps.ProjectType.BACKEND, fast=False, repo_root=tmp_path)
|
||||||
|
assert any(
|
||||||
|
c.name == "branch protection" and c.status == ps.CheckStatus.WARN for c in group.checks
|
||||||
|
)
|
||||||
|
|
|
||||||
208
uv.lock
generated
208
uv.lock
generated
|
|
@ -19,6 +19,19 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/da/42/e921fccf5015463e32a3cf6ee7f980a6ed0f395ceeaa45060b61d86486c2/anyio-4.13.0-py3-none-any.whl", hash = "sha256:08b310f9e24a9594186fd75b4f73f4a4152069e3853f1ed8bfbf58369f4ad708", size = 114353, upload-time = "2026-03-24T12:59:08.246Z" },
|
{ url = "https://files.pythonhosted.org/packages/da/42/e921fccf5015463e32a3cf6ee7f980a6ed0f395ceeaa45060b61d86486c2/anyio-4.13.0-py3-none-any.whl", hash = "sha256:08b310f9e24a9594186fd75b4f73f4a4152069e3853f1ed8bfbf58369f4ad708", size = 114353, upload-time = "2026-03-24T12:59:08.246Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "arrow"
|
||||||
|
version = "1.4.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "python-dateutil" },
|
||||||
|
{ name = "tzdata" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/b9/33/032cdc44182491aa708d06a68b62434140d8c50820a087fac7af37703357/arrow-1.4.0.tar.gz", hash = "sha256:ed0cc050e98001b8779e84d461b0098c4ac597e88704a655582b21d116e526d7", size = 152931, upload-time = "2025-10-18T17:46:46.761Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ed/c9/d7977eaacb9df673210491da99e6a247e93df98c715fc43fd136ce1d3d33/arrow-1.4.0-py3-none-any.whl", hash = "sha256:749f0769958ebdc79c173ff0b0670d59051a535fa26e8eba02953dc19eb43205", size = 68797, upload-time = "2025-10-18T17:46:45.663Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ast-serialize"
|
name = "ast-serialize"
|
||||||
version = "0.6.0"
|
version = "0.6.0"
|
||||||
|
|
@ -60,6 +73,15 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/66/40/c53deb2cd0c9b0fb636d24d9f40924cf2e65028e6b20b10cd5c1eeb2c730/ast_serialize-0.6.0-cp39-abi3-win_arm64.whl", hash = "sha256:ccd132fe8db56f61fe743b1f644d01b8d65b83248a8da506f3132bda86d6ed5e", size = 1072965, upload-time = "2026-06-30T20:02:54.097Z" },
|
{ url = "https://files.pythonhosted.org/packages/66/40/c53deb2cd0c9b0fb636d24d9f40924cf2e65028e6b20b10cd5c1eeb2c730/ast_serialize-0.6.0-cp39-abi3-win_arm64.whl", hash = "sha256:ccd132fe8db56f61fe743b1f644d01b8d65b83248a8da506f3132bda86d6ed5e", size = 1072965, upload-time = "2026-06-30T20:02:54.097Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "binaryornot"
|
||||||
|
version = "0.6.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/86/72/4755b85101f37707c71526a301c1203e413c715a0016ecb592de3d2dcfff/binaryornot-0.6.0.tar.gz", hash = "sha256:cc8d57cfa71d74ff8c28a7726734d53a851d02fad9e3a5581fb807f989f702f0", size = 478718, upload-time = "2026-03-08T16:26:28.804Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/cd/0c/31cfaa6b56fe23488ecb993bc9fc526c0d84d89607decdf2a10776426c2e/binaryornot-0.6.0-py3-none-any.whl", hash = "sha256:900adfd5e1b821255ba7e63139b0396b14c88b9286e74e03b6f51e0200331337", size = 14185, upload-time = "2026-03-08T16:26:27.466Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "certifi"
|
name = "certifi"
|
||||||
version = "2026.5.20"
|
version = "2026.5.20"
|
||||||
|
|
@ -139,6 +161,18 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/98/2b/f97f1c193fb855c345d678f5077d6926034db0722df74c8f057020e05a25/charset_normalizer-3.4.9-py3-none-any.whl", hash = "sha256:68e5f26a1ad57ded6d1cfb85331d1c1a195314756471d97758c48498bb4dcdf5", size = 64538, upload-time = "2026-07-07T14:34:56.993Z" },
|
{ url = "https://files.pythonhosted.org/packages/98/2b/f97f1c193fb855c345d678f5077d6926034db0722df74c8f057020e05a25/charset_normalizer-3.4.9-py3-none-any.whl", hash = "sha256:68e5f26a1ad57ded6d1cfb85331d1c1a195314756471d97758c48498bb4dcdf5", size = 64538, upload-time = "2026-07-07T14:34:56.993Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "click"
|
||||||
|
version = "8.4.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "colorama", marker = "sys_platform == 'win32'" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/76/d4/81420972a676e8ffea40450d8c8c92943e7218a78fe9b64359836cc9876b/click-8.4.2.tar.gz", hash = "sha256:9a6cea6e60b17ebe0a44c5cc636d94f09bd66142c1cd7d8b4cd731c4917a15f6", size = 338000, upload-time = "2026-06-24T17:45:15.148Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/fb/e2/79c688af8b210d232694e31e59da9f6ec747bae31c3f5946e4e9b98860d5/click-8.4.2-py3-none-any.whl", hash = "sha256:e6f9f66136c816745b9d65817da91d61d957fb16e02e4dcd0552553c5a197b76", size = 119243, upload-time = "2026-06-24T17:45:13.73Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "colorama"
|
name = "colorama"
|
||||||
version = "0.4.6"
|
version = "0.4.6"
|
||||||
|
|
@ -148,6 +182,25 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
{ url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "cookiecutter"
|
||||||
|
version = "2.7.1"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "arrow" },
|
||||||
|
{ name = "binaryornot" },
|
||||||
|
{ name = "click" },
|
||||||
|
{ name = "jinja2" },
|
||||||
|
{ name = "python-slugify" },
|
||||||
|
{ name = "pyyaml" },
|
||||||
|
{ name = "requests" },
|
||||||
|
{ name = "rich" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/92/03/f4c96d8fd4f5e8af0210bf896eb63927f35d3014a8e8f3bf9d2c43ad3332/cookiecutter-2.7.1.tar.gz", hash = "sha256:ca7bb7bc8c6ff441fbf53921b5537668000e38d56e28d763a1b73975c66c6138", size = 142854, upload-time = "2026-03-04T04:06:02.786Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/14/a9/8c855c14b401dc67d20739345295af5afce5e930a69600ab20f6cfa50b5c/cookiecutter-2.7.1-py3-none-any.whl", hash = "sha256:cee50defc1eaa7ad0071ee9b9893b746c1b3201b66bf4d3686d0f127c8ed6cf9", size = 41317, upload-time = "2026-03-04T04:06:01.221Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "coverage"
|
name = "coverage"
|
||||||
version = "7.15.2"
|
version = "7.15.2"
|
||||||
|
|
@ -299,6 +352,18 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },
|
{ url = "https://files.pythonhosted.org/packages/cb/b1/3846dd7f199d53cb17f49cba7e651e9ce294d8497c8c150530ed11865bb8/iniconfig-2.3.0-py3-none-any.whl", hash = "sha256:f631c04d2c48c52b84d0d0549c99ff3859c98df65b3101406327ecc7d53fbf12", size = 7484, upload-time = "2025-10-18T21:55:41.639Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "jinja2"
|
||||||
|
version = "3.1.6"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "markupsafe" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "librt"
|
name = "librt"
|
||||||
version = "0.13.0"
|
version = "0.13.0"
|
||||||
|
|
@ -373,6 +438,90 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/d2/f0/834e479e47e499b6478e807fb57b31cc2db696c4db30557bb6f5aea4a90b/mando-0.7.1-py2.py3-none-any.whl", hash = "sha256:26ef1d70928b6057ee3ca12583d73c63e05c49de8972d620c278a7b206581a8a", size = 28149, upload-time = "2022-02-24T08:12:25.24Z" },
|
{ url = "https://files.pythonhosted.org/packages/d2/f0/834e479e47e499b6478e807fb57b31cc2db696c4db30557bb6f5aea4a90b/mando-0.7.1-py2.py3-none-any.whl", hash = "sha256:26ef1d70928b6057ee3ca12583d73c63e05c49de8972d620c278a7b206581a8a", size = 28149, upload-time = "2022-02-24T08:12:25.24Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "markdown-it-py"
|
||||||
|
version = "4.2.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "mdurl" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "markupsafe"
|
||||||
|
version = "3.0.3"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/7e/99/7690b6d4034fffd95959cbe0c02de8deb3098cc577c67bb6a24fe5d7caa7/markupsafe-3.0.3.tar.gz", hash = "sha256:722695808f4b6457b320fdc131280796bdceb04ab50fe1795cd540799ebe1698", size = 80313, upload-time = "2025-09-27T18:37:40.426Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/5a/72/147da192e38635ada20e0a2e1a51cf8823d2119ce8883f7053879c2199b5/markupsafe-3.0.3-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:d53197da72cc091b024dd97249dfc7794d6a56530370992a5e1a08983ad9230e", size = 11615, upload-time = "2025-09-27T18:36:30.854Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/9a/81/7e4e08678a1f98521201c3079f77db69fb552acd56067661f8c2f534a718/markupsafe-3.0.3-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:1872df69a4de6aead3491198eaf13810b565bdbeec3ae2dc8780f14458ec73ce", size = 12020, upload-time = "2025-09-27T18:36:31.971Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/1e/2c/799f4742efc39633a1b54a92eec4082e4f815314869865d876824c257c1e/markupsafe-3.0.3-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:3a7e8ae81ae39e62a41ec302f972ba6ae23a5c5396c8e60113e9066ef893da0d", size = 24332, upload-time = "2025-09-27T18:36:32.813Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/3c/2e/8d0c2ab90a8c1d9a24f0399058ab8519a3279d1bd4289511d74e909f060e/markupsafe-3.0.3-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d6dd0be5b5b189d31db7cda48b91d7e0a9795f31430b7f271219ab30f1d3ac9d", size = 22947, upload-time = "2025-09-27T18:36:33.86Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/2c/54/887f3092a85238093a0b2154bd629c89444f395618842e8b0c41783898ea/markupsafe-3.0.3-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:94c6f0bb423f739146aec64595853541634bde58b2135f27f61c1ffd1cd4d16a", size = 21962, upload-time = "2025-09-27T18:36:35.099Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/c9/2f/336b8c7b6f4a4d95e91119dc8521402461b74a485558d8f238a68312f11c/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:be8813b57049a7dc738189df53d69395eba14fb99345e0a5994914a3864c8a4b", size = 23760, upload-time = "2025-09-27T18:36:36.001Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/32/43/67935f2b7e4982ffb50a4d169b724d74b62a3964bc1a9a527f5ac4f1ee2b/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:83891d0e9fb81a825d9a6d61e3f07550ca70a076484292a70fde82c4b807286f", size = 21529, upload-time = "2025-09-27T18:36:36.906Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/89/e0/4486f11e51bbba8b0c041098859e869e304d1c261e59244baa3d295d47b7/markupsafe-3.0.3-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:77f0643abe7495da77fb436f50f8dab76dbc6e5fd25d39589a0f1fe6548bfa2b", size = 23015, upload-time = "2025-09-27T18:36:37.868Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/2f/e1/78ee7a023dac597a5825441ebd17170785a9dab23de95d2c7508ade94e0e/markupsafe-3.0.3-cp312-cp312-win32.whl", hash = "sha256:d88b440e37a16e651bda4c7c2b930eb586fd15ca7406cb39e211fcff3bf3017d", size = 14540, upload-time = "2025-09-27T18:36:38.761Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/aa/5b/bec5aa9bbbb2c946ca2733ef9c4ca91c91b6a24580193e891b5f7dbe8e1e/markupsafe-3.0.3-cp312-cp312-win_amd64.whl", hash = "sha256:26a5784ded40c9e318cfc2bdb30fe164bdb8665ded9cd64d500a34fb42067b1c", size = 15105, upload-time = "2025-09-27T18:36:39.701Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/e5/f1/216fc1bbfd74011693a4fd837e7026152e89c4bcf3e77b6692fba9923123/markupsafe-3.0.3-cp312-cp312-win_arm64.whl", hash = "sha256:35add3b638a5d900e807944a078b51922212fb3dedb01633a8defc4b01a3c85f", size = 13906, upload-time = "2025-09-27T18:36:40.689Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/38/2f/907b9c7bbba283e68f20259574b13d005c121a0fa4c175f9bed27c4597ff/markupsafe-3.0.3-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:e1cf1972137e83c5d4c136c43ced9ac51d0e124706ee1c8aa8532c1287fa8795", size = 11622, upload-time = "2025-09-27T18:36:41.777Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/9c/d9/5f7756922cdd676869eca1c4e3c0cd0df60ed30199ffd775e319089cb3ed/markupsafe-3.0.3-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:116bb52f642a37c115f517494ea5feb03889e04df47eeff5b130b1808ce7c219", size = 12029, upload-time = "2025-09-27T18:36:43.257Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/00/07/575a68c754943058c78f30db02ee03a64b3c638586fba6a6dd56830b30a3/markupsafe-3.0.3-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:133a43e73a802c5562be9bbcd03d090aa5a1fe899db609c29e8c8d815c5f6de6", size = 24374, upload-time = "2025-09-27T18:36:44.508Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/a9/21/9b05698b46f218fc0e118e1f8168395c65c8a2c750ae2bab54fc4bd4e0e8/markupsafe-3.0.3-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:ccfcd093f13f0f0b7fdd0f198b90053bf7b2f02a3927a30e63f3ccc9df56b676", size = 22980, upload-time = "2025-09-27T18:36:45.385Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/7f/71/544260864f893f18b6827315b988c146b559391e6e7e8f7252839b1b846a/markupsafe-3.0.3-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:509fa21c6deb7a7a273d629cf5ec029bc209d1a51178615ddf718f5918992ab9", size = 21990, upload-time = "2025-09-27T18:36:46.916Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/c2/28/b50fc2f74d1ad761af2f5dcce7492648b983d00a65b8c0e0cb457c82ebbe/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:a4afe79fb3de0b7097d81da19090f4df4f8d3a2b3adaa8764138aac2e44f3af1", size = 23784, upload-time = "2025-09-27T18:36:47.884Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ed/76/104b2aa106a208da8b17a2fb72e033a5a9d7073c68f7e508b94916ed47a9/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:795e7751525cae078558e679d646ae45574b47ed6e7771863fcc079a6171a0fc", size = 21588, upload-time = "2025-09-27T18:36:48.82Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/b5/99/16a5eb2d140087ebd97180d95249b00a03aa87e29cc224056274f2e45fd6/markupsafe-3.0.3-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:8485f406a96febb5140bfeca44a73e3ce5116b2501ac54fe953e488fb1d03b12", size = 23041, upload-time = "2025-09-27T18:36:49.797Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/19/bc/e7140ed90c5d61d77cea142eed9f9c303f4c4806f60a1044c13e3f1471d0/markupsafe-3.0.3-cp313-cp313-win32.whl", hash = "sha256:bdd37121970bfd8be76c5fb069c7751683bdf373db1ed6c010162b2a130248ed", size = 14543, upload-time = "2025-09-27T18:36:51.584Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/05/73/c4abe620b841b6b791f2edc248f556900667a5a1cf023a6646967ae98335/markupsafe-3.0.3-cp313-cp313-win_amd64.whl", hash = "sha256:9a1abfdc021a164803f4d485104931fb8f8c1efd55bc6b748d2f5774e78b62c5", size = 15113, upload-time = "2025-09-27T18:36:52.537Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/f0/3a/fa34a0f7cfef23cf9500d68cb7c32dd64ffd58a12b09225fb03dd37d5b80/markupsafe-3.0.3-cp313-cp313-win_arm64.whl", hash = "sha256:7e68f88e5b8799aa49c85cd116c932a1ac15caaa3f5db09087854d218359e485", size = 13911, upload-time = "2025-09-27T18:36:53.513Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/e4/d7/e05cd7efe43a88a17a37b3ae96e79a19e846f3f456fe79c57ca61356ef01/markupsafe-3.0.3-cp313-cp313t-macosx_10_13_x86_64.whl", hash = "sha256:218551f6df4868a8d527e3062d0fb968682fe92054e89978594c28e642c43a73", size = 11658, upload-time = "2025-09-27T18:36:54.819Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/99/9e/e412117548182ce2148bdeacdda3bb494260c0b0184360fe0d56389b523b/markupsafe-3.0.3-cp313-cp313t-macosx_11_0_arm64.whl", hash = "sha256:3524b778fe5cfb3452a09d31e7b5adefeea8c5be1d43c4f810ba09f2ceb29d37", size = 12066, upload-time = "2025-09-27T18:36:55.714Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/bc/e6/fa0ffcda717ef64a5108eaa7b4f5ed28d56122c9a6d70ab8b72f9f715c80/markupsafe-3.0.3-cp313-cp313t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4e885a3d1efa2eadc93c894a21770e4bc67899e3543680313b09f139e149ab19", size = 25639, upload-time = "2025-09-27T18:36:56.908Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/96/ec/2102e881fe9d25fc16cb4b25d5f5cde50970967ffa5dddafdb771237062d/markupsafe-3.0.3-cp313-cp313t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8709b08f4a89aa7586de0aadc8da56180242ee0ada3999749b183aa23df95025", size = 23569, upload-time = "2025-09-27T18:36:57.913Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/4b/30/6f2fce1f1f205fc9323255b216ca8a235b15860c34b6798f810f05828e32/markupsafe-3.0.3-cp313-cp313t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:b8512a91625c9b3da6f127803b166b629725e68af71f8184ae7e7d54686a56d6", size = 23284, upload-time = "2025-09-27T18:36:58.833Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/58/47/4a0ccea4ab9f5dcb6f79c0236d954acb382202721e704223a8aafa38b5c8/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_aarch64.whl", hash = "sha256:9b79b7a16f7fedff2495d684f2b59b0457c3b493778c9eed31111be64d58279f", size = 24801, upload-time = "2025-09-27T18:36:59.739Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/6a/70/3780e9b72180b6fecb83a4814d84c3bf4b4ae4bf0b19c27196104149734c/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_riscv64.whl", hash = "sha256:12c63dfb4a98206f045aa9563db46507995f7ef6d83b2f68eda65c307c6829eb", size = 22769, upload-time = "2025-09-27T18:37:00.719Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/98/c5/c03c7f4125180fc215220c035beac6b9cb684bc7a067c84fc69414d315f5/markupsafe-3.0.3-cp313-cp313t-musllinux_1_2_x86_64.whl", hash = "sha256:8f71bc33915be5186016f675cd83a1e08523649b0e33efdb898db577ef5bb009", size = 23642, upload-time = "2025-09-27T18:37:01.673Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/80/d6/2d1b89f6ca4bff1036499b1e29a1d02d282259f3681540e16563f27ebc23/markupsafe-3.0.3-cp313-cp313t-win32.whl", hash = "sha256:69c0b73548bc525c8cb9a251cddf1931d1db4d2258e9599c28c07ef3580ef354", size = 14612, upload-time = "2025-09-27T18:37:02.639Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/2b/98/e48a4bfba0a0ffcf9925fe2d69240bfaa19c6f7507b8cd09c70684a53c1e/markupsafe-3.0.3-cp313-cp313t-win_amd64.whl", hash = "sha256:1b4b79e8ebf6b55351f0d91fe80f893b4743f104bff22e90697db1590e47a218", size = 15200, upload-time = "2025-09-27T18:37:03.582Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/0e/72/e3cc540f351f316e9ed0f092757459afbc595824ca724cbc5a5d4263713f/markupsafe-3.0.3-cp313-cp313t-win_arm64.whl", hash = "sha256:ad2cf8aa28b8c020ab2fc8287b0f823d0a7d8630784c31e9ee5edea20f406287", size = 13973, upload-time = "2025-09-27T18:37:04.929Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/33/8a/8e42d4838cd89b7dde187011e97fe6c3af66d8c044997d2183fbd6d31352/markupsafe-3.0.3-cp314-cp314-macosx_10_13_x86_64.whl", hash = "sha256:eaa9599de571d72e2daf60164784109f19978b327a3910d3e9de8c97b5b70cfe", size = 11619, upload-time = "2025-09-27T18:37:06.342Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/b5/64/7660f8a4a8e53c924d0fa05dc3a55c9cee10bbd82b11c5afb27d44b096ce/markupsafe-3.0.3-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:c47a551199eb8eb2121d4f0f15ae0f923d31350ab9280078d1e5f12b249e0026", size = 12029, upload-time = "2025-09-27T18:37:07.213Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/da/ef/e648bfd021127bef5fa12e1720ffed0c6cbb8310c8d9bea7266337ff06de/markupsafe-3.0.3-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:f34c41761022dd093b4b6896d4810782ffbabe30f2d443ff5f083e0cbbb8c737", size = 24408, upload-time = "2025-09-27T18:37:09.572Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/41/3c/a36c2450754618e62008bf7435ccb0f88053e07592e6028a34776213d877/markupsafe-3.0.3-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:457a69a9577064c05a97c41f4e65148652db078a3a509039e64d3467b9e7ef97", size = 23005, upload-time = "2025-09-27T18:37:10.58Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/bc/20/b7fdf89a8456b099837cd1dc21974632a02a999ec9bf7ca3e490aacd98e7/markupsafe-3.0.3-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:e8afc3f2ccfa24215f8cb28dcf43f0113ac3c37c2f0f0806d8c70e4228c5cf4d", size = 22048, upload-time = "2025-09-27T18:37:11.547Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/9a/a7/591f592afdc734f47db08a75793a55d7fbcc6902a723ae4cfbab61010cc5/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:ec15a59cf5af7be74194f7ab02d0f59a62bdcf1a537677ce67a2537c9b87fcda", size = 23821, upload-time = "2025-09-27T18:37:12.48Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/7d/33/45b24e4f44195b26521bc6f1a82197118f74df348556594bd2262bda1038/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:0eb9ff8191e8498cca014656ae6b8d61f39da5f95b488805da4bb029cccbfbaf", size = 21606, upload-time = "2025-09-27T18:37:13.485Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ff/0e/53dfaca23a69fbfbbf17a4b64072090e70717344c52eaaaa9c5ddff1e5f0/markupsafe-3.0.3-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:2713baf880df847f2bece4230d4d094280f4e67b1e813eec43b4c0e144a34ffe", size = 23043, upload-time = "2025-09-27T18:37:14.408Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/46/11/f333a06fc16236d5238bfe74daccbca41459dcd8d1fa952e8fbd5dccfb70/markupsafe-3.0.3-cp314-cp314-win32.whl", hash = "sha256:729586769a26dbceff69f7a7dbbf59ab6572b99d94576a5592625d5b411576b9", size = 14747, upload-time = "2025-09-27T18:37:15.36Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/28/52/182836104b33b444e400b14f797212f720cbc9ed6ba34c800639d154e821/markupsafe-3.0.3-cp314-cp314-win_amd64.whl", hash = "sha256:bdc919ead48f234740ad807933cdf545180bfbe9342c2bb451556db2ed958581", size = 15341, upload-time = "2025-09-27T18:37:16.496Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/6f/18/acf23e91bd94fd7b3031558b1f013adfa21a8e407a3fdb32745538730382/markupsafe-3.0.3-cp314-cp314-win_arm64.whl", hash = "sha256:5a7d5dc5140555cf21a6fefbdbf8723f06fcd2f63ef108f2854de715e4422cb4", size = 14073, upload-time = "2025-09-27T18:37:17.476Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/3c/f0/57689aa4076e1b43b15fdfa646b04653969d50cf30c32a102762be2485da/markupsafe-3.0.3-cp314-cp314t-macosx_10_13_x86_64.whl", hash = "sha256:1353ef0c1b138e1907ae78e2f6c63ff67501122006b0f9abad68fda5f4ffc6ab", size = 11661, upload-time = "2025-09-27T18:37:18.453Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/89/c3/2e67a7ca217c6912985ec766c6393b636fb0c2344443ff9d91404dc4c79f/markupsafe-3.0.3-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:1085e7fbddd3be5f89cc898938f42c0b3c711fdcb37d75221de2666af647c175", size = 12069, upload-time = "2025-09-27T18:37:19.332Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/f0/00/be561dce4e6ca66b15276e184ce4b8aec61fe83662cce2f7d72bd3249d28/markupsafe-3.0.3-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1b52b4fb9df4eb9ae465f8d0c228a00624de2334f216f178a995ccdcf82c4634", size = 25670, upload-time = "2025-09-27T18:37:20.245Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/50/09/c419f6f5a92e5fadde27efd190eca90f05e1261b10dbd8cbcb39cd8ea1dc/markupsafe-3.0.3-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:fed51ac40f757d41b7c48425901843666a6677e3e8eb0abcff09e4ba6e664f50", size = 23598, upload-time = "2025-09-27T18:37:21.177Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/22/44/a0681611106e0b2921b3033fc19bc53323e0b50bc70cffdd19f7d679bb66/markupsafe-3.0.3-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f190daf01f13c72eac4efd5c430a8de82489d9cff23c364c3ea822545032993e", size = 23261, upload-time = "2025-09-27T18:37:22.167Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/5f/57/1b0b3f100259dc9fffe780cfb60d4be71375510e435efec3d116b6436d43/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:e56b7d45a839a697b5eb268c82a71bd8c7f6c94d6fd50c3d577fa39a9f1409f5", size = 24835, upload-time = "2025-09-27T18:37:23.296Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/26/6a/4bf6d0c97c4920f1597cc14dd720705eca0bf7c787aebc6bb4d1bead5388/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:f3e98bb3798ead92273dc0e5fd0f31ade220f59a266ffd8a4f6065e0a3ce0523", size = 22733, upload-time = "2025-09-27T18:37:24.237Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/14/c7/ca723101509b518797fedc2fdf79ba57f886b4aca8a7d31857ba3ee8281f/markupsafe-3.0.3-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:5678211cb9333a6468fb8d8be0305520aa073f50d17f089b5b4b477ea6e67fdc", size = 23672, upload-time = "2025-09-27T18:37:25.271Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/fb/df/5bd7a48c256faecd1d36edc13133e51397e41b73bb77e1a69deab746ebac/markupsafe-3.0.3-cp314-cp314t-win32.whl", hash = "sha256:915c04ba3851909ce68ccc2b8e2cd691618c4dc4c4232fb7982bca3f41fd8c3d", size = 14819, upload-time = "2025-09-27T18:37:26.285Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/1a/8a/0402ba61a2f16038b48b39bccca271134be00c5c9f0f623208399333c448/markupsafe-3.0.3-cp314-cp314t-win_amd64.whl", hash = "sha256:4faffd047e07c38848ce017e8725090413cd80cbc23d86e55c587bf979e579c9", size = 15426, upload-time = "2025-09-27T18:37:27.316Z" },
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/70/bc/6f1c2f612465f5fa89b95bead1f44dcb607670fd42891d8fdcd5d039f4f4/markupsafe-3.0.3-cp314-cp314t-win_arm64.whl", hash = "sha256:32001d6a8fc98c8cb5c947787c5d08b0a50663d139f1305bac5885d98d9b40fa", size = 14146, upload-time = "2025-09-27T18:37:28.327Z" },
|
||||||
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mdurl"
|
||||||
|
version = "0.1.2"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "memory"
|
name = "memory"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
|
|
@ -380,11 +529,13 @@ source = { editable = "." }
|
||||||
dependencies = [
|
dependencies = [
|
||||||
{ name = "httpx" },
|
{ name = "httpx" },
|
||||||
{ name = "numpy" },
|
{ name = "numpy" },
|
||||||
|
{ name = "packaging" },
|
||||||
{ name = "tenacity" },
|
{ name = "tenacity" },
|
||||||
]
|
]
|
||||||
|
|
||||||
[package.optional-dependencies]
|
[package.optional-dependencies]
|
||||||
dev = [
|
dev = [
|
||||||
|
{ name = "cookiecutter" },
|
||||||
{ name = "mypy" },
|
{ name = "mypy" },
|
||||||
{ name = "pre-commit" },
|
{ name = "pre-commit" },
|
||||||
{ name = "pytest" },
|
{ name = "pytest" },
|
||||||
|
|
@ -396,9 +547,11 @@ dev = [
|
||||||
|
|
||||||
[package.metadata]
|
[package.metadata]
|
||||||
requires-dist = [
|
requires-dist = [
|
||||||
|
{ name = "cookiecutter", marker = "extra == 'dev'", specifier = ">=2.5" },
|
||||||
{ name = "httpx" },
|
{ name = "httpx" },
|
||||||
{ name = "mypy", marker = "extra == 'dev'", specifier = ">=1.10" },
|
{ name = "mypy", marker = "extra == 'dev'", specifier = ">=1.10" },
|
||||||
{ name = "numpy" },
|
{ name = "numpy" },
|
||||||
|
{ name = "packaging", specifier = ">=24.0" },
|
||||||
{ name = "pre-commit", marker = "extra == 'dev'", specifier = ">=3.7" },
|
{ name = "pre-commit", marker = "extra == 'dev'", specifier = ">=3.7" },
|
||||||
{ name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0" },
|
{ name = "pytest", marker = "extra == 'dev'", specifier = ">=8.0" },
|
||||||
{ name = "pytest-cov", marker = "extra == 'dev'", specifier = ">=5.0" },
|
{ name = "pytest-cov", marker = "extra == 'dev'", specifier = ">=5.0" },
|
||||||
|
|
@ -636,6 +789,18 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/fa/b6/3127540ecdf1464a00e5a01ee60a1b09175f6913f0644ac748494d9c4b21/pytest_timeout-2.4.0-py3-none-any.whl", hash = "sha256:c42667e5cdadb151aeb5b26d114aff6bdf5a907f176a007a30b940d3d865b5c2", size = 14382, upload-time = "2025-05-05T19:44:33.502Z" },
|
{ url = "https://files.pythonhosted.org/packages/fa/b6/3127540ecdf1464a00e5a01ee60a1b09175f6913f0644ac748494d9c4b21/pytest_timeout-2.4.0-py3-none-any.whl", hash = "sha256:c42667e5cdadb151aeb5b26d114aff6bdf5a907f176a007a30b940d3d865b5c2", size = 14382, upload-time = "2025-05-05T19:44:33.502Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "python-dateutil"
|
||||||
|
version = "2.9.0.post0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "six" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/66/c0/0c8b6ad9f17a802ee498c46e004a0eb49bc148f2fd230864601a86dcf6db/python-dateutil-2.9.0.post0.tar.gz", hash = "sha256:37dd54208da7e1cd875388217d5e00ebd4179249f90fb72437e91a35459a0ad3", size = 342432, upload-time = "2024-03-01T18:36:20.211Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "python-discovery"
|
name = "python-discovery"
|
||||||
version = "1.4.4"
|
version = "1.4.4"
|
||||||
|
|
@ -649,6 +814,18 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/9d/ae/84bc0d2440c95772272bb6f4b3d09ccf08b2898fce89b3d4f969a9fc74e9/python_discovery-1.4.4-py3-none-any.whl", hash = "sha256:abebe9120b43453b68c908acfb1e72a19d1a959ed2cb620ad38fc57d08056dbe", size = 34181, upload-time = "2026-07-08T23:06:49.402Z" },
|
{ url = "https://files.pythonhosted.org/packages/9d/ae/84bc0d2440c95772272bb6f4b3d09ccf08b2898fce89b3d4f969a9fc74e9/python_discovery-1.4.4-py3-none-any.whl", hash = "sha256:abebe9120b43453b68c908acfb1e72a19d1a959ed2cb620ad38fc57d08056dbe", size = 34181, upload-time = "2026-07-08T23:06:49.402Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "python-slugify"
|
||||||
|
version = "8.0.4"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "text-unidecode" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/87/c7/5e1547c44e31da50a460df93af11a535ace568ef89d7a811069ead340c4a/python-slugify-8.0.4.tar.gz", hash = "sha256:59202371d1d05b54a9e7720c5e038f928f45daaffe41dd10822f3907b937c856", size = 10921, upload-time = "2024-02-08T18:32:45.488Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/a4/62/02da182e544a51a5c3ccf4b03ab79df279f9c60c5e82d5e8bec7ca26ac11/python_slugify-8.0.4-py2.py3-none-any.whl", hash = "sha256:276540b79961052b66b7d116620b36518847f52d5fd9e3a70164fc8c50faa6b8", size = 10051, upload-time = "2024-02-08T18:32:43.911Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pyyaml"
|
name = "pyyaml"
|
||||||
version = "6.0.3"
|
version = "6.0.3"
|
||||||
|
|
@ -723,6 +900,19 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" },
|
{ url = "https://files.pythonhosted.org/packages/a0/f4/c67b0b3f1b9245e8d266f0f112c500d50e5b4e83cb6f3b71b6528104182a/requests-2.34.2-py3-none-any.whl", hash = "sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0", size = 73075, upload-time = "2026-05-14T19:25:26.443Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "rich"
|
||||||
|
version = "15.0.0"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
dependencies = [
|
||||||
|
{ name = "markdown-it-py" },
|
||||||
|
{ name = "pygments" },
|
||||||
|
]
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "ruff"
|
name = "ruff"
|
||||||
version = "0.15.22"
|
version = "0.15.22"
|
||||||
|
|
@ -766,6 +956,15 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/d7/c1/eb8f9debc45d3b7918a32ab756658a0904732f75e555402972246b0b8e71/tenacity-9.1.4-py3-none-any.whl", hash = "sha256:6095a360c919085f28c6527de529e76a06ad89b23659fa881ae0649b867a9d55", size = 28926, upload-time = "2026-02-07T10:45:32.24Z" },
|
{ url = "https://files.pythonhosted.org/packages/d7/c1/eb8f9debc45d3b7918a32ab756658a0904732f75e555402972246b0b8e71/tenacity-9.1.4-py3-none-any.whl", hash = "sha256:6095a360c919085f28c6527de529e76a06ad89b23659fa881ae0649b867a9d55", size = 28926, upload-time = "2026-02-07T10:45:32.24Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "text-unidecode"
|
||||||
|
version = "1.3"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/ab/e2/e9a00f0ccb71718418230718b3d900e71a5d16e701a3dae079a21e9cd8f8/text-unidecode-1.3.tar.gz", hash = "sha256:bad6603bb14d279193107714b288be206cac565dfa49aa5b105294dd5c4aab93", size = 76885, upload-time = "2019-08-30T21:36:45.405Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/a6/a5/c0b6468d3824fe3fde30dbb5e1f687b291608f9473681bbf7dabbf5a87d7/text_unidecode-1.3-py2.py3-none-any.whl", hash = "sha256:1311f10e8b895935241623731c2ba64f4c455287888b18189350b67134a822e8", size = 78154, upload-time = "2019-08-30T21:37:03.543Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "typing-extensions"
|
name = "typing-extensions"
|
||||||
version = "4.16.0"
|
version = "4.16.0"
|
||||||
|
|
@ -775,6 +974,15 @@ wheels = [
|
||||||
{ url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" },
|
{ url = "https://files.pythonhosted.org/packages/49/d3/b8441a820a491ddfc024b0b0cf0393375b75ea13866d9c66727e54c2fc80/typing_extensions-4.16.0-py3-none-any.whl", hash = "sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8", size = 45571, upload-time = "2026-07-02T08:40:04.659Z" },
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tzdata"
|
||||||
|
version = "2026.3"
|
||||||
|
source = { registry = "https://pypi.org/simple" }
|
||||||
|
sdist = { url = "https://files.pythonhosted.org/packages/92/ff/5a28bdfd8c3ebec42564ac7d0e54ca3db65044a9314a97f9564fa7a1e926/tzdata-2026.3.tar.gz", hash = "sha256:4a1518b8993086a7982523e071643f3c0e5f213e75b21318e78bcabfff9d1415", size = 198674, upload-time = "2026-07-10T08:50:37.887Z" }
|
||||||
|
wheels = [
|
||||||
|
{ url = "https://files.pythonhosted.org/packages/e5/6d/b53b99a9f2766d095985947a5782f1702cabb129a34f7a802d7197af832f/tzdata-2026.3-py2.py3-none-any.whl", hash = "sha256:dc096730c87af6cab1b171c9d532be840741ff5d459015e7f6947bd7d7e54931", size = 348168, upload-time = "2026-07-10T08:50:36.46Z" },
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "urllib3"
|
name = "urllib3"
|
||||||
version = "2.7.0"
|
version = "2.7.0"
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue