diff --git a/backend/main.py b/backend/main.py index 243c7b3..8235563 100644 --- a/backend/main.py +++ b/backend/main.py @@ -26,7 +26,15 @@ from app.database import Base, engine, SessionLocal, load_sample_data # Utility function to fetch metadata from pyproject.toml def get_project_metadata(): - with open("pyproject.toml", "rb") as f: + # Dynamically resolve the correct path to pyproject.toml + current_dir = Path(__file__).resolve().parent + root_dir = current_dir.parent.parent # Adjust based on structure + pyproject_path = root_dir / "pyproject.toml" + + if not pyproject_path.exists(): + raise FileNotFoundError(f"pyproject.toml not found at {pyproject_path}") + + with open(pyproject_path, "rb") as f: pyproject = tomllib.load(f) name = pyproject["project"]["name"] version = pyproject["project"]["version"] diff --git a/backend/pyproject.toml b/pyproject.toml similarity index 100% rename from backend/pyproject.toml rename to pyproject.toml