Refactor: Migrate to UV, add pdoc, and update CI #11
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: Test with Pytest | |
| on: [push] | |
| jobs: | |
| linting: | |
| runs-on: ubuntu-latest | |
| steps: | |
| #---------------------------------------------- | |
| # check-out repo and set-up python | |
| #---------------------------------------------- | |
| - uses: actions/checkout@v3 | |
| - name: Set up Python and UV | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.11' # Use matrix version for test job, default for linting | |
| cache: 'uv' # Enables caching for uv | |
| #---------------------------------------------- | |
| # install and run linters | |
| #---------------------------------------------- | |
| - run: uv pip install ruff black | |
| - run: | | |
| ruff check . | |
| black . --check | |
| test: | |
| needs: linting | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "pypy-3.x" ] | |
| runs-on: ubuntu-latest # Keep ubuntu-latest, or use matrix.os if variable runners are intended. For now, ubuntu-latest is fine. | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| - name: Set up Python and UV | |
| id: setup-python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| cache: 'uv' | |
| - name: Install dependencies | |
| run: uv pip install -e .[dev] | |
| - name: Run tests | |
| run: | | |
| pytest tests/ | |
| coverage report |