Fix packaged project archive command
GeoIntel CI / docs-smoke (push) Canceled after 0s
GeoIntel CI / contract-smoke (push) Canceled after 0s

This commit is contained in:
Codex
2026-07-17 14:24:13 +02:00
parent 78a5f0b0b2
commit dbc28c8916
2 changed files with 25 additions and 0 deletions
@@ -2,6 +2,7 @@ from __future__ import annotations
import importlib.util import importlib.util
from pathlib import Path from pathlib import Path
import subprocess
import sys import sys
from types import SimpleNamespace from types import SimpleNamespace
from uuid import uuid4 from uuid import uuid4
@@ -132,6 +133,21 @@ def test_cleanup_script_is_packaged_and_readiness_checked() -> None:
assert "py_compile scripts/archive_technical_projects.py" in readiness assert "py_compile scripts/archive_technical_projects.py" in readiness
def test_cleanup_script_can_start_as_a_direct_operator_command() -> None:
result = subprocess.run(
[sys.executable, str(ROOT / "scripts/archive_technical_projects.py"), "--help"],
cwd=ROOT,
capture_output=True,
check=False,
text=True,
timeout=20,
)
assert result.returncode == 0, result.stderr
assert "--apply" in result.stdout
assert "--show-names" in result.stdout
def test_frontend_lifecycle_and_component_boundaries_are_wired() -> None: def test_frontend_lifecycle_and_component_boundaries_are_wired() -> None:
app_source = (ROOT / "frontend/src/App.tsx").read_text(encoding="utf-8") app_source = (ROOT / "frontend/src/App.tsx").read_text(encoding="utf-8")
project_panel = (ROOT / "frontend/src/components/project/ProjectPanel.tsx").read_text(encoding="utf-8") project_panel = (ROOT / "frontend/src/components/project/ProjectPanel.tsx").read_text(encoding="utf-8")
+9
View File
@@ -2,12 +2,21 @@ from __future__ import annotations
import argparse import argparse
import json import json
from pathlib import Path
import re import re
import sys
from dataclasses import dataclass from dataclasses import dataclass
from uuid import UUID from uuid import UUID
from sqlalchemy.orm import Session from sqlalchemy.orm import Session
# Direct execution from /app/scripts must resolve the repository's backend
# package before similarly named installed packages.
ROOT = Path(__file__).resolve().parents[1]
BACKEND_ROOT = ROOT / "backend" if (ROOT / "backend" / "app").is_dir() else ROOT
if str(BACKEND_ROOT) not in sys.path:
sys.path.insert(0, str(BACKEND_ROOT))
from app.db.session import SessionLocal from app.db.session import SessionLocal
from app.models import Project from app.models import Project