diff --git a/src/main.py b/src/main.py index e6aada7..3cc976d 100644 --- a/src/main.py +++ b/src/main.py @@ -2,8 +2,16 @@ from fastapi.responses import RedirectResponse from routers.health import health_router from routers.mtcars import data_output -from docs.documentation import description import uvicorn +import tomllib + +try: + with open("pyproject.toml", "rb") as f: + tomldata = tomllib.load(f) + version = tomldata["project"]["version"] + description = tomldata["project"]["description"] +except FileNotFoundError: + print("pyproject.toml not found") app = FastAPI( # This info goes directly into /docs @@ -11,7 +19,7 @@ # Description of API defined in docs/documentation.py for ease of reading description=description, summary="This project is a proof-of-concept (POC) web API built using the FastAPI library.", - version="0.0.1", + version=version, contact={ "name": "RMI", "url": "https://github.com/RMI",