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:
@ -24,6 +24,7 @@ test:
|
|||||||
- source $VIRTUAL_ENV/bin/activate
|
- source $VIRTUAL_ENV/bin/activate
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
- export PYTHONPATH=$PYTHONPATH:/home/gitlab-runner/builds/t3_38ooWt/0/mx/heidi-v2/backend
|
- export PYTHONPATH=$PYTHONPATH:/home/gitlab-runner/builds/t3_38ooWt/0/mx/heidi-v2/backend
|
||||||
|
- cd /home/gitlab-runner/builds/t3_38ooWt/0/mx/heidi-v2 # Change to the project root
|
||||||
- pytest --cov=app --cov-report=xml # Run tests and generate coverage report
|
- pytest --cov=app --cov-report=xml # Run tests and generate coverage report
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
|
@ -28,11 +28,12 @@ def get_project_metadata():
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
import tomllib
|
import tomllib
|
||||||
|
|
||||||
# Adjust path resolution to pinpoint the actual folder containing `pyproject.toml`
|
# Dynamically resolve the project root folder correctly.
|
||||||
root_dir = Path(__file__).resolve().parent.parent.parent # Root of the repository
|
# Assume that `pyproject.toml` is located in the heidi-v2 root folder
|
||||||
pyproject_path = root_dir / "pyproject.toml" # Update properly
|
root_dir = Path(__file__).resolve().parent.parent.parent
|
||||||
|
pyproject_path = root_dir / "heidi-v2" / "pyproject.toml"
|
||||||
|
|
||||||
print(f"Looking for pyproject.toml at: {pyproject_path}") # Debug output
|
print(f"Looking for pyproject.toml at: {pyproject_path}") # Debugging output
|
||||||
|
|
||||||
if not pyproject_path.exists():
|
if not pyproject_path.exists():
|
||||||
raise FileNotFoundError(f"{pyproject_path} not found")
|
raise FileNotFoundError(f"{pyproject_path} not found")
|
||||||
|
Reference in New Issue
Block a user