Skip to content

Fix doctest

Fix doctest #74

Workflow file for this run

name: build
on: [push, pull_request]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
- name: Install uv
run: pip install uv
- name: Create virtual environment
run: uv venv
shell: bash
- name: Install dependencies
run: |
uv pip install -e .[dev]
uv pip install -r ./docs/sphinx_requirements.txt
- name: Check Python formatting with black
run: |
uv run black --diff --color .
uv run black --check .
- name: Check import order with isort
run: |
uv run isort --profile=black --check .
- name: Lint with flake8
run: |
uv run flake8 . --exclude=.venv --count --show-source --statistics || exit 1
uv run flake8 . --exclude=.venv --count --exit-zero --statistics
- name: Lint with ruff
run: |
uv run ruff check .
- name: Type check with mypy
run: |
uv run mypy hpipy
- name: Test with pytest
run: |
uv run pytest --doctest-glob="*.rst" --doctest-modules docs
uv run pytest --cov=hpipy
- name: Generate coverage report
run: uv run coverage xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}