-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_project.py
More file actions
48 lines (41 loc) · 1.33 KB
/
Copy pathverify_project.py
File metadata and controls
48 lines (41 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
from pathlib import Path
import py_compile
import json
ROOT = Path(__file__).resolve().parent
required_files = [
"README.md",
"backend/main.py",
"backend/requirements.txt",
"frontend/package.json",
"frontend/src/App.jsx",
"frontend/src/main.jsx",
"notebooks/01_eda_and_embeddings.ipynb",
"notebooks/02_search_engine.ipynb",
"notebooks/03_pdf_paper_analyzer.ipynb",
"notebooks/04_recommendation_system.ipynb",
]
print("Checking required files...")
missing = []
for file in required_files:
path = ROOT / file
if not path.exists():
missing.append(file)
else:
print("OK:", file)
if missing:
raise SystemExit(f"Missing files: {missing}")
print("\nChecking Python syntax...")
python_files = list((ROOT / "backend").rglob("*.py"))
for path in python_files:
# Let py_compile manage its own cache path to avoid Windows temp-file locking issues.
py_compile.compile(str(path), doraise=True)
print("OK:", path.relative_to(ROOT))
print("\nChecking notebooks...")
for path in (ROOT / "notebooks").glob("*.ipynb"):
with open(path, "r", encoding="utf-8") as f:
nb = json.load(f)
cells = nb.get("cells", [])
if not cells:
raise SystemExit(f"Notebook has no cells: {path}")
print("OK:", path.name, "-", len(cells), "cells")
print("\nProject validation passed.")