Merge pull request #251 from vertti/renovate/dprint-0.x #924
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: CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| jobs: | |
| # Test on all Python versions with minimal dependencies | |
| test: | |
| name: Python ${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 | |
| - name: Set up Python ${{ matrix.python-version }} and dependencies | |
| run: uv sync --python ${{ matrix.python-version }} --group test | |
| - name: Test with pytest | |
| run: uv run pytest tests/ | |
| # Lint and type-check on latest Python only | |
| lint: | |
| name: Lint & Type Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 | |
| - name: Set up Python and dependencies | |
| run: uv sync --group test --group dev | |
| - name: Lint and type check | |
| run: | | |
| uv run ruff check --output-format=github . | |
| uv run ruff format --diff | |
| uv run pyrefly check . | |
| uv run vulture daffy --min-confidence 100 | |
| dprint check | |
| # Coverage on latest Python only | |
| coverage: | |
| name: Code Coverage | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 | |
| - name: Set up Python and dependencies | |
| run: uv sync --group test --group dev | |
| - name: Test with coverage | |
| run: uv run pytest --cov --cov-report=xml tests/ | |
| - name: Upload coverage to Codecov | |
| uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0 | |
| with: | |
| files: ./coverage.xml | |
| fail_ci_if_error: true | |
| verbose: true | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| # Test optional dependencies scenarios with pytest (always passes) | |
| test-optional-deps-pytest: | |
| name: Optional Dependencies (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.13"] | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 | |
| - name: Set up Python ${{ matrix.python-version }} and dependencies | |
| run: uv sync --python ${{ matrix.python-version }} --group test | |
| - name: Run optional dependencies tests | |
| run: uv run pytest tests/test_optional_dependencies.py -v | |
| # Test true isolation scenarios (manual script testing) | |
| test-isolation-scenarios: | |
| name: Isolation ${{ matrix.scenario }} (Python ${{ matrix.python-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.13"] | |
| scenario: ["pandas-only", "polars-only", "pyarrow-only", "modin-only", "both", "pandas-no-pydantic", "none", "pandas-2.x-only", "pandas-3.x-only"] | |
| exclude: | |
| # pandas 3.x requires Python 3.11+ | |
| - python-version: "3.10" | |
| scenario: "pandas-3.x-only" | |
| steps: | |
| - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 | |
| with: | |
| persist-credentials: false | |
| - uses: jdx/mise-action@1648a7812b9aeae629881980618f079932869151 # v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| - name: Build daffy wheel | |
| run: uv build --wheel | |
| - name: Test pandas-only scenario | |
| if: matrix.scenario == 'pandas-only' | |
| run: | | |
| WHEEL=$(ls dist/daffy-*.whl | head -n1) | |
| uv run --python ${{ matrix.python-version }} --no-project --with "pandas>=1.5.1" --with "$WHEEL" python scripts/test_isolated_deps.py pandas | |
| - name: Test polars-only scenario | |
| if: matrix.scenario == 'polars-only' | |
| run: | | |
| WHEEL=$(ls dist/daffy-*.whl | head -n1) | |
| uv run --python ${{ matrix.python-version }} --no-project --with "polars>=1.7.0" --with "$WHEEL" python scripts/test_isolated_deps.py polars | |
| - name: Test both libraries scenario | |
| if: matrix.scenario == 'both' | |
| run: | | |
| WHEEL=$(ls dist/daffy-*.whl | head -n1) | |
| uv run --python ${{ matrix.python-version }} --no-project --with "pandas>=1.5.1" --with "polars>=1.7.0" --with "$WHEEL" python scripts/test_isolated_deps.py both | |
| - name: Test pyarrow-only scenario | |
| if: matrix.scenario == 'pyarrow-only' | |
| run: | | |
| WHEEL=$(ls dist/daffy-*.whl | head -n1) | |
| uv run --python ${{ matrix.python-version }} --no-project --with "pyarrow>=14.0.0" --with "$WHEEL" python scripts/test_isolated_deps.py pyarrow | |
| - name: Test modin-only scenario | |
| if: matrix.scenario == 'modin-only' | |
| run: | | |
| WHEEL=$(ls dist/daffy-*.whl | head -n1) | |
| uv run --python ${{ matrix.python-version }} --no-project --with "modin[ray]>=0.30.0" --with "$WHEEL" python scripts/test_isolated_deps.py modin | |
| - name: Test pandas without pydantic scenario | |
| if: matrix.scenario == 'pandas-no-pydantic' | |
| run: | | |
| WHEEL=$(ls dist/daffy-*.whl | head -n1) | |
| uv run --python ${{ matrix.python-version }} --no-project --with "pandas>=1.5.1" --with "$WHEEL" python scripts/test_isolated_deps.py pandas-no-pydantic | |
| - name: Test no libraries scenario (expected to fail gracefully) | |
| if: matrix.scenario == 'none' | |
| run: | | |
| WHEEL=$(ls dist/daffy-*.whl | head -n1) | |
| uv run --python ${{ matrix.python-version }} --no-project --with "$WHEEL" python scripts/test_isolated_deps.py none | |
| - name: Test pandas 2.x only scenario | |
| if: matrix.scenario == 'pandas-2.x-only' | |
| run: | | |
| WHEEL=$(ls dist/daffy-*.whl | head -n1) | |
| uv run --python ${{ matrix.python-version }} --no-project --with "pandas>=1.5.1,<3.0.0" --with "$WHEEL" python scripts/test_isolated_deps.py pandas | |
| - name: Test pandas 3.x only scenario | |
| if: matrix.scenario == 'pandas-3.x-only' | |
| run: | | |
| WHEEL=$(ls dist/daffy-*.whl | head -n1) | |
| uv run --python ${{ matrix.python-version }} --no-project --with "pandas>=3.0.0" --with "$WHEEL" python scripts/test_isolated_deps.py pandas |