File tree 1 file changed +10
-2
lines changed
1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change 2
2
from fastapi .responses import RedirectResponse
3
3
from routers .health import health_router
4
4
from routers .mtcars import data_output
5
- from docs .documentation import description
6
5
import uvicorn
6
+ import tomllib
7
+
8
+ try :
9
+ with open ("pyproject.toml" , "rb" ) as f :
10
+ tomldata = tomllib .load (f )
11
+ version = tomldata ["project" ]["version" ]
12
+ description = tomldata ["project" ]["description" ]
13
+ except FileNotFoundError :
14
+ print ("pyproject.toml not found" )
7
15
8
16
app = FastAPI (
9
17
# This info goes directly into /docs
10
18
title = "RMI Web API poc" ,
11
19
# Description of API defined in docs/documentation.py for ease of reading
12
20
description = description ,
13
21
summary = "This project is a proof-of-concept (POC) web API built using the FastAPI library." ,
14
- version = "0.0.1" ,
22
+ version = version ,
15
23
contact = {
16
24
"name" : "RMI" ,
17
25
"url" : "https://github.com/RMI" ,
You can’t perform that action at this time.
0 commit comments