Sync project metadata with pyproject.toml
Updated scripts and backend to dynamically retrieve project name and version from `pyproject.toml`. This ensures consistent metadata across the OpenAPI client generation and the FastAPI application.
This commit is contained in:
@ -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"]
|
||||
|
@ -1,29 +0,0 @@
|
||||
[build-system]
|
||||
requires = ["setuptools>=42", "wheel"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "aareDB"
|
||||
version = "0.1.0a1"
|
||||
description = "Backend for next gen sample management system"
|
||||
authors = [{name = "Guillaume Gotthard", email = "guillaume.gotthard@psi.ch"}]
|
||||
license = {text = "MIT"}
|
||||
dependencies = [
|
||||
"SQLAlchemy~=2.0.36",
|
||||
"fastapi~=0.115.4",
|
||||
"pydantic~=2.9.2",
|
||||
"openpyxl~=3.1.5",
|
||||
"typing_extensions~=4.12.2",
|
||||
"PyJWT~=2.8.0",
|
||||
"qrcode~=7.3.1",
|
||||
"pillow~=10.4.0",
|
||||
"reportlab~=4.2.5",
|
||||
"cryptography~=44.0.0",
|
||||
"pytest~=7.4.1",
|
||||
"pytest-cov~=4.1.0",
|
||||
"httpx~=0.24.1",
|
||||
"pydantic[email]",
|
||||
"mysqlclient~=2.1.1",
|
||||
"python-multipart~=0.0.6",
|
||||
"uvicorn==0.23.1"
|
||||
]
|
Reference in New Issue
Block a user