Skip to content

Refactor library.py to use NamedTuple, fix mypy errors #61

Refactor library.py to use NamedTuple, fix mypy errors

Refactor library.py to use NamedTuple, fix mypy errors #61

Workflow file for this run

name: Run unit tests
on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "dev" ]
schedule:
- cron: '00 12 1 * *' # Monthly
jobs:
run-test-suite:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
# https://github.com/actions/cache/blob/main/examples.md#python---pip
- uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Format with black
run: black --line-length=127 --check --diff .
- name: Run all tests with pytest
run: pytest --cov=pittapi tests/