add TODO #51 #246
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: Check Python | |
on: | |
push: | |
paths: | |
- "**.py" | |
- "**pyproject.toml" | |
- ".github/workflows/check-python.yml" | |
pull_request: | |
workflow_call: | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: [ | |
"3.9", | |
"3.10", | |
"3.11", | |
"3.12", | |
"3.13" | |
] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Test with pytest | |
run: | | |
uv run --no-default-groups --group test pytest | |
lint: | |
runs-on: ubuntu-latest | |
env: | |
ruff_args: "" | |
python-version: '3.13' | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set stricter linting rules for PR / `main` | |
run: | | |
if [[ "${{ github.event_name }}" == "pull_request" || ( "${{ github.event_name }}" == "push" && "${{ github.ref }}" == "refs/heads/main" ) ]]; then | |
echo "ruff_args=--config ruff-main.toml" >> $GITHUB_ENV | |
fi | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: lint with ruff ${{ env.ruff_args }} | |
run: | | |
uv run --no-default-groups --group lint ruff check . ${{ env.ruff_args }} | |
type-check: | |
env: | |
python-version: '3.12' | |
continue-on-error: false # explicitly make typing mandatory as pytype is lenient by design | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.python-version }} (Latest which pytype supports) | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Install uv | |
uses: astral-sh/setup-uv@v5 | |
with: | |
python-version: ${{ env.python-version }} | |
- name: Run pytype | |
run: | | |
uv run --no-default-groups --group typing pytype |