Adds type hints throughout Hatchet and integrate checks with mypy #1
Workflow file for this run
This file contains 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: Run mypy-based type checking | |
on: | |
push: | |
branches: [ develop ] | |
pull_request: | |
branches: [ develop, releases/** ] | |
jobs: | |
type_check: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# TODO: add macos-latest | |
# TODO: change ubuntu-20.04 back to ubuntu-latest when the following issue is resolved: | |
# https://github.com/actions/setup-python/issues/162 | |
os: [ubuntu-20.04] | |
# TODO: add pypy2, pypy3 | |
python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] | |
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 Python3 dependencies | |
run: | | |
python -m pip install --upgrade pip pytest | |
pip install -r requirements.txt | |
# Optional Dependency for HDF Checkpointing | |
pip install tables | |
python setup.py install | |
python setup.py build_ext --inplace | |
python -m pip list | |
- name: Install mypy | |
run: | | |
python3 -m pip install mypy==1.4.1 | |
- name: Run mypy | |
run: | | |
mypy hatchet --pretty |