Skip to content

python checks

python checks #951

Workflow file for this run

name: python checks
on: [push, pull_request, workflow_dispatch]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up python
uses: astral-sh/setup-uv@v5
with:
python-version: 3.13
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Install dependencies
run: |
uv pip install -r pyproject.toml basedpyright isort black -r src/python/common/pyproject.toml
- name: Run isort check
run: |
python -m isort . --check --diff
- name: Run black check
run: |
python -m black . --check --diff
- name: Run Ruff check
run: |
ruff check --output-format github
ruff format --check --diff
- name: Run pyright check
run: |
basedpyright
test:
strategy:
matrix:
os: [ubuntu, windows, macos]
py: [3.13, 3.12]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v4
- name: Set up python ${{ matrix.py }}
uses: astral-sh/setup-uv@v5
with:
python-version: ${{ matrix.py }}
enable-cache: true
cache-dependency-glob: "**/pyproject.toml"
- name: Install dependencies
run: |
uv pip install -r pyproject.toml -r src/python/common/pyproject.toml
- name: Run tests
run: |
pytest -v
publish-hmr:
needs: [test, check]
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: src/python/common
- name: Set up python
uses: astral-sh/setup-uv@v5
with:
python-version: 3.13
enable-cache: true
cache-dependency-glob: src/python/common/pyproject.toml
- name: Build package
run: uv build src/python/common -o dist
- name: Publish to PyPI
continue-on-error: true
run: uv publish