# GitLab CI configuration for paroles-net-scraper # Using uv for Python package management stages: - test - build - deploy variables: UV_VERSION: "0.2.25" PYTHON_VERSION: "3.11" # Cache uv packages between jobs cache: key: uv-cache paths: - .uv/ - uv.lock before_script: # Install uv if not already available - which uv || curl -LsSf https://astral.sh/uv/install.sh | sh # Set up Python environment - uv python install $PYTHON_VERSION .test_base: stage: test script: # Sync dependencies - uv sync --dev # Run tests - uv run pytest tests/ -v test:python-3.11: extends: .test_base image: python:3.11-slim test:python-3.12: extends: .test_base image: python:3.12-slim variables: PYTHON_VERSION: "3.12" build-package: stage: build image: python:3.11-slim script: # Install uv - which uv || curl -LsSf https://astral.sh/uv/install.sh | sh # Sync dependencies - uv sync --dev # Build the package - uv build artifacts: paths: - dist/ expire_in: 1 week # Deploy job (only runs on tags) deploy-package: stage: deploy image: python:3.11-slim script: # Install uv - which uv || curl -LsSf https://astral.sh/uv/install.sh | sh # Install twine for uploading to PyPI - uv pip install twine # Upload to PyPI (using credentials from GitLab CI/CD variables) - twine upload --username $PYPI_USERNAME --password $PYPI_PASSWORD dist/* only: - tags dependencies: - build-package