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
455a22c7e6
commit
219cf93756
@ -60,15 +60,12 @@ release:
|
||||
stage: release
|
||||
when: manual
|
||||
variables:
|
||||
TWINE_USERNAME: gitlab-ci-token # Keep username same
|
||||
TWINE_USERNAME: gitlab-ci-token # Keep username the same
|
||||
TWINE_PASSWORD: $CI_JOB_TOKEN # Use PAT stored in GitLab CI/CD Variables
|
||||
script:
|
||||
- echo "Setting up Python dependencies..."
|
||||
- source $VIRTUAL_ENV/bin/activate
|
||||
- pip install -r requirements.txt
|
||||
- bash make_openapi_client.sh
|
||||
- cd backend/python-client # Navigate to the folder where the package was generated
|
||||
- python -m venv .venv
|
||||
- source .venv/bin/activate
|
||||
- pip install -U pip twine
|
||||
- twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi dist/*
|
||||
- bash make_openapi_client.sh # Generate OpenAPI client and package
|
||||
- ls backend/python-client/dist/ # Debug artifacts to ensure files exist
|
||||
- twine upload --repository-url ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi backend/python-client/dist/*
|
@ -44,11 +44,17 @@ if [[ ! -d python-client ]]; then
|
||||
fi
|
||||
|
||||
# Build Python package
|
||||
echo "Building Python package..."
|
||||
cd python-client || exit
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
pip install -U pip build
|
||||
python -m build
|
||||
|
||||
# Skip uploading the package. This will happen in the release stage.
|
||||
echo "Python client generated and package built successfully."
|
||||
# Verify build output
|
||||
if [[ ! -d dist || -z "$(ls -A dist)" ]]; then
|
||||
echo "Error: No files generated in 'dist/'. Package build failed."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "Python package built successfully in 'dist/'."
|
Loading…
x
Reference in New Issue
Block a user