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:
parent
076de3f017
commit
3725456257
@ -28,14 +28,11 @@ def get_project_metadata():
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import tomllib
|
import tomllib
|
||||||
|
|
||||||
# Dynamically resolve the correct path to pyproject.toml
|
# Adjust path resolution to pinpoint the actual folder containing `pyproject.toml`
|
||||||
root_dir = (
|
root_dir = Path(__file__).resolve().parent.parent.parent # Root of the repository
|
||||||
Path(__file__).resolve().parent.parent.parent
|
pyproject_path = root_dir / "pyproject.toml" # Update properly
|
||||||
) # Adjust path to project root
|
|
||||||
pyproject_path = root_dir / "pyproject.toml"
|
|
||||||
|
|
||||||
# Print the resolved path for debugging
|
print(f"Looking for pyproject.toml at: {pyproject_path}") # Debug output
|
||||||
print(f"Looking for pyproject.toml at: {pyproject_path}")
|
|
||||||
|
|
||||||
if not pyproject_path.exists():
|
if not pyproject_path.exists():
|
||||||
raise FileNotFoundError(f"{pyproject_path} not found")
|
raise FileNotFoundError(f"{pyproject_path} not found")
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Extract values from pyproject.toml
|
# Extract values from pyproject.toml
|
||||||
PYPROJECT_FILE="$(dirname "$0")/heidi-v2/pyproject.toml"
|
PYPROJECT_FILE="$(dirname "$0")/pyproject.toml"
|
||||||
|
|
||||||
VERSION=$(grep -Po '(?<=version = ")[^"]*' "$PYPROJECT_FILE")
|
VERSION=$(grep -Po '(?<=version = ")[^"]*' "$PYPROJECT_FILE")
|
||||||
NAME=$(grep -Po '(?<=name = ")[^"]*' "$PYPROJECT_FILE")
|
NAME=$(grep -Po '(?<=name = ")[^"]*' "$PYPROJECT_FILE")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user