Skip to content

Commit

Permalink
ci: ignore missing imports in mypy for now
Browse files Browse the repository at this point in the history
This commit instructs mypy to ignore missing
imports. Otherwise a number of errors are
created by importing datalad-modules. This
is due to the fact that no type-stubs exist
for those modules yet. Once the type-stubs
are created, this commit should be reverted.
  • Loading branch information
christian-monch committed Oct 22, 2024
1 parent 3bac8b1 commit 81f08a3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/mypy-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,13 @@ jobs:
if: steps.changed-py-files.outputs.any_changed == 'true'
run: |
# get any type stubs that mypy thinks it needs
hatch run types:mypy --install-types --non-interactive --follow-imports skip ${{ steps.changed-py-files.outputs.all_changed_files }}
hatch run types:mypy --install-types --non-interactive --ignore-missing-imports --follow-imports skip ${{ steps.changed-py-files.outputs.all_changed_files }}
# run mypy on the modified files only, and do not even follow imports.
# this results is a fairly superficial test, but given the overall
# state of annotations, we strive to become more correct incrementally
# with focused error reports, rather than barfing a huge complaint
# that is unrelated to the changeset someone has been working on.
# run on the oldest supported Python version
hatch run types:mypy --python-version 3.11 --follow-imports skip --pretty --show-error-context ${{ steps.changed-py-files.outputs.all_changed_files }}
# run on the oldest supported Python version.
# specify `--ignore-missing-imports` until the datalad-packages have
# type stubs for all their modules.
hatch run types:mypy --python-version 3.11 --ignore-missing-imports --follow-imports skip --pretty --show-error-context ${{ steps.changed-py-files.outputs.all_changed_files }}
6 changes: 4 additions & 2 deletions .github/workflows/mypy-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ jobs:
# get any type stubs that mypy thinks it needs
hatch run types:mypy --install-types --non-interactive --follow-imports skip datalad_core
# run mypy on the full project.
# run on the oldest supported Python version
hatch run types:mypy --python-version 3.11 --pretty --show-error-context datalad_core
# run on the oldest supported Python version.
# specify `--ignore-missing-imports` until the datalad-packages have
# type stubs for all their modules.
hatch run types:mypy --python-version 3.11 --ignore-missing-imports --pretty --show-error-context datalad_core

0 comments on commit 81f08a3

Please sign in to comment.