Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Add mypy to CI #1099

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Expand Up @@ -49,6 +49,10 @@ jobs:
- name: Run twine checker
run: |
twine check dist/*
- name: Run mypy
run: |
pip install -r tests/requirements-mypy.txt
mypy aioredis --ignore-missing-imports
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better to just run mypy with no arguments, and keep all configuration in .mypy.ini.

Good example of a config from one of our other repos:
https://github.com/aio-libs/aiohttp-jinja2/blob/master/.mypy.ini

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah just copied our makefile; good catch since we have all dependencies installed. Not sure of the reasoning behind the flag to begin with though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But, even the aioredis can be removed and just included in the config file as files = aioredis.

We'll also want mypy to run on tests/examples at some point as well. We've had bugs with type annotations which are only caught if you type check actual usage (plus it keeps the examples up-to-date with the library code).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't have a config file, so updated in CI only. Maybe in the future.


test-unix:
name: Test Unix
Expand Down
1 change: 1 addition & 0 deletions CHANGES/1099.misc
@@ -0,0 +1 @@
Adds mypy to CI