From 48036397f10ec15ba2880567abd9a9bffc29ab25 Mon Sep 17 00:00:00 2001 From: Roberto Musso Date: Mon, 6 Apr 2026 23:32:17 +0200 Subject: [PATCH] fix(billing): auto-detect repo root for shared module import in local dev --- services/billing/app/main.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/billing/app/main.py b/services/billing/app/main.py index 41debb3..c075b4a 100644 --- a/services/billing/app/main.py +++ b/services/billing/app/main.py @@ -11,9 +11,16 @@ The webhook endpoint is exposed WITHOUT ForwardAuth so Stripe can reach it. from __future__ import annotations import logging +import sys from contextlib import asynccontextmanager +from pathlib import Path from typing import AsyncGenerator +# Ensure the repo root is on sys.path so "shared" is importable in local dev. +_repo_root = str(Path(__file__).resolve().parents[3]) +if _repo_root not in sys.path: + sys.path.insert(0, _repo_root) + from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware