Fix pyproject build (PEP 639 + misplaced deps) and turn CI green (#6) #32
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] | |
| jobs: | |
| test: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.11", "3.12"] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: pip | |
| - name: Install | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e ".[dev,stats]" | |
| - name: Ruff lint | |
| run: ruff check src tests | |
| - name: Ruff format | |
| run: ruff format --check src tests | |
| - name: Mypy | |
| run: mypy --strict src/refusalbench | |
| - name: Pytest | |
| run: pytest --cov=refusalbench --cov-report=term-missing | |
| - name: Validate prompts | |
| run: python scripts/validate_prompts.py | |
| # Bare `pip install -e .` (no extras) + import the runtime deps, catching the | |
| # #3/#4 regression the extras-based `test` job can't. | |
| base-install: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.12" | |
| cache: pip | |
| - name: Bare editable install (no extras) | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -e . | |
| - name: Verify runtime dependencies were installed | |
| run: python -c "import pandas, scipy, matplotlib, click, krippendorff, refusalbench" |