Add support for python 3.13 + 3.14 #324
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Dependency Compatibility Testing | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'pyproject.toml' | |
| - 'requirements/**' | |
| - 'validmind/**' | |
| - 'tests/**' | |
| pull_request: | |
| branches: ['*'] | |
| paths: | |
| - 'pyproject.toml' | |
| - 'requirements/**' | |
| - 'validmind/**' | |
| - 'tests/**' | |
| schedule: | |
| # Run weekly on Sundays at 2 AM UTC to catch new dependency releases | |
| - cron: '0 2 * * 0' | |
| workflow_dispatch: | |
| inputs: | |
| test_type: | |
| description: 'Type of dependency test to run' | |
| required: true | |
| default: 'all' | |
| type: choice | |
| options: | |
| - 'all' | |
| - 'min-versions' | |
| - 'max-versions' | |
| - 'python-versions' | |
| - 'pip-freeze' | |
| permissions: | |
| contents: read | |
| jobs: | |
| dependency-matrix: | |
| name: Test Python ${{ matrix.python-version }} with ${{ matrix.deps-type }} dependencies | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14'] | |
| deps-type: ['max', 'default'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Free Disk Space | |
| run: ./disk_clean.sh | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential libomp-dev | |
| - name: Install build tooling (build and uv) | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install --upgrade build | |
| curl -LsSf https://astral.sh/uv/install.sh | sh | |
| echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
| - name: Build wheel and sdist | |
| run: | | |
| python -m build | |
| - name: Install and test via pip artifacts (${{ matrix.deps-type }}) | |
| run: | | |
| set -euxo pipefail | |
| # limit threads to avoid resource contention | |
| export OMP_NUM_THREADS=1 | |
| export MKL_NUM_THREADS=1 | |
| if [[ "${{ matrix.deps-type }}" == "default" ]]; then | |
| # Install only from built artifacts (let pip resolve deps normally) | |
| WHEEL=$(ls dist/*.whl | head -n 1) | |
| python -m pip install "${WHEEL}[all]" | |
| pip check | |
| python -m tests.test_unit_tests | cat | |
| else | |
| # Generate latest-compatible constraints (max) | |
| OUT=constraints-max.txt | |
| uv pip compile pyproject.toml -p "${{ matrix.python-version }}" --all-extras --no-emit-index-url --no-annotate --no-strip-markers --output-file "$OUT" --upgrade | |
| # Install constraints then the wheel without reinstalling deps | |
| pip install -r "$OUT" | |
| WHEEL=$(ls dist/*.whl | head -n 1) | |
| python -m pip install "${WHEEL}[all]" --no-deps | |
| pip check | |
| python -m tests.test_unit_tests | cat | |
| fi | |
| pip-freeze-testing: | |
| name: Test Client Pip Freeze Environments | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'workflow_dispatch' && github.event.inputs.test_type == 'pip-freeze' || github.event_name == 'schedule' | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python 3.9 | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.9' | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential libomp-dev | |
| - name: Install pip tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| - name: Test pip freeze environments | |
| env: | |
| OMP_NUM_THREADS: 1 | |
| MKL_NUM_THREADS: 1 | |
| PIP_NO_CACHE_DIR: 1 | |
| run: | | |
| set -euxo pipefail | |
| if [ -z "${FREEZE_FILE:-}" ] || [ ! -f "$FREEZE_FILE" ]; then | |
| echo "Set FREEZE_FILE env var to a pip freeze file path" >&2 | |
| exit 1 | |
| fi | |
| python -m pip install --upgrade pip | |
| pip install -r "$FREEZE_FILE" | |
| python -m pip install . --no-deps | |
| python -m tests.test_unit_tests | cat | |
| report-status: | |
| name: Report Dependency Testing Status | |
| runs-on: ubuntu-latest | |
| needs: [dependency-matrix] | |
| if: always() | |
| steps: | |
| - name: Report results | |
| run: | | |
| echo "Dependency testing completed" | |
| echo "Matrix job status: ${{ needs.dependency-matrix.result }}" | |
| if [[ "${{ needs.dependency-matrix.result }}" == "failure" ]]; then | |
| echo "❌ Some dependency combinations failed" | |
| else | |
| echo "✅ All dependency combinations passed" | |
| fi |