AgentProjectMinenraeumer / ProjectIntakeTower /verifier_creation /scripts /09_Projekte_AgentArena_verifier.py
Download ProjectIntakeTower/verifier_creation/scripts/09_Projekte_AgentArena_verifier.py from smlflg/AgentProjectMinenraeumer: direct link, hf CLI and curl.
- Browser
- Download file 1.52 kB
-
https://huggingface.co/smlflg/AgentProjectMinenraeumer/resolve/main/ProjectIntakeTower/verifier_creation/scripts/09_Projekte_AgentArena_verifier.py
- Command line
-
hf download hf://smlflg/AgentProjectMinenraeumer/ProjectIntakeTower/verifier_creation/scripts/09_Projekte_AgentArena_verifier.py
-
curl -L -o 09_Projekte_AgentArena_verifier.py https://huggingface.co/smlflg/AgentProjectMinenraeumer/resolve/main/ProjectIntakeTower/verifier_creation/scripts/09_Projekte_AgentArena_verifier.py
1.52 kB
| #!/usr/bin/env python3 | |
| import json, subprocess, shutil | |
| from pathlib import Path | |
| PROJECT=Path('/home/smlflg/Projekte/AgentArena') | |
| COMMAND='python -m compileall -q . && pytest -q' | |
| def run(cmd, timeout=60): | |
| try: | |
| p=subprocess.run(cmd, cwd=PROJECT, shell=True, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE, timeout=timeout) | |
| return {'cmd':cmd,'exit_code':p.returncode,'stdout':p.stdout[-4000:],'stderr':p.stderr[-4000:]} | |
| except Exception as e: | |
| return {'cmd':cmd,'exit_code':124,'stdout':'','stderr':str(e)} | |
| def main(): | |
| checks=[]; failures=[]; warnings=[] | |
| if not PROJECT.exists(): | |
| failures.append('project path missing') | |
| if not (PROJECT/'.git').exists(): | |
| warnings.append('no .git marker') | |
| checks.append(run('git status --short', timeout=20)) | |
| # Main smoke command. Non-destructive; no install. | |
| checks.append(run(COMMAND, timeout=90)) | |
| status='passed' | |
| for c in checks: | |
| if c['exit_code'] not in (0,): | |
| status='needs_human' if 'not found' in (c.get('stderr','')+c.get('stdout','')).lower() else 'failed' | |
| failures.append(f"{c['cmd']} exit={c['exit_code']}") | |
| result={'status':status,'project_path':str(PROJECT),'verifier_kind':'python','checks':checks,'failures':failures,'warnings':warnings,'next_action':'If failed/needs_human, inspect stderr and decide dependency/test setup.'} | |
| print(json.dumps(result,indent=2)) | |
| raise SystemExit(0 if status=='passed' else 1) | |
| if __name__=='__main__': main() | |