Skip to content

Commit

Permalink
Adds type checking (through mypy) to CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ilumsden committed Nov 14, 2024
1 parent 6179835 commit 6dd311d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ COPY requirements.txt /requirements.txt

RUN python3 -m pip install -r requirements.txt

RUN python3 -m pip install --upgrade flake8-pytest-importorskip click==8.0.4 black==24.4.2 flake8==4.0.1
RUN python3 -m pip install --upgrade flake8-pytest-importorskip click==8.0.4 black==24.4.2 flake8==4.0.1 mypy==1.13.0

RUN groupadd -g ${USER_GID} ${USERNAME} && \
adduser --disabled-password --uid ${USER_UID} --gid ${USER_GID} --gecos "" ${USERNAME} && \
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,25 @@ jobs:
python setup.py build_ext --inplace
python -m pip list
- name: Update Black
- name: Update Black and mypy
if: ${{ matrix.python-version == 3.9 }}
run: |
pip install flake8-pytest-importorskip
pip install --upgrade click==8.0.4
pip install black==24.4.2
pip install flake8==4.0.1
pip install mypy==1.13.0
- name: Lint and Format Check with Flake8 and Black
if: ${{ matrix.python-version == 3.9 }}
run: |
black --diff --check .
flake8
- name: Run type checking with mypy
if: ${{ matrix.python-version == 3.9 }}
run: |
mypy hatchet --pretty
- name: Check License Headers
run: |
Expand Down
2 changes: 1 addition & 1 deletion hatchet/graphframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ def tree(

if color is False:
try:
import IPython
import IPython # type: ignore[import-not-found]

shell = IPython.get_ipython().__class__.__name__
except ImportError:
Expand Down

0 comments on commit 6dd311d

Please sign in to comment.