From de8beae18395213a63d683a7abcf2a95e2976802 Mon Sep 17 00:00:00 2001 From: Jens Date: Sun, 23 Aug 2026 23:26:06 +0200 Subject: [PATCH] Make runtime provenance operator script directly executable --- scripts/migrate_runtime_model_provenance.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/migrate_runtime_model_provenance.py b/scripts/migrate_runtime_model_provenance.py index d9c34d79..8ee4bf1b 100644 --- a/scripts/migrate_runtime_model_provenance.py +++ b/scripts/migrate_runtime_model_provenance.py @@ -10,6 +10,13 @@ import sys import tempfile from typing import Any +# Direct execution from /app/scripts sets sys.path[0] to that directory rather +# than the container application root. Keep the operator command self-contained +# without requiring an undocumented PYTHONPATH override. +APP_ROOT = Path(__file__).resolve().parents[1] +if str(APP_ROOT) not in sys.path: + sys.path.insert(0, str(APP_ROOT)) + from app.db.session import SessionLocal from app.services.data_contract_validation import ( PYTORCH_MODEL_CONTRACT_KEY,