Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mypy errors in dining.py #200

Merged
merged 2 commits into from
Aug 25, 2024
Merged

Fix mypy errors in dining.py #200

merged 2 commits into from
Aug 25, 2024

Conversation

tianyizheng02
Copy link
Contributor

Run mypy with --strict flag and fix resulting mypy errors in dining.py

Contributes to #45 by fixing existing type hint errors prior to introducing mypy to the repo.

Before:

> mypy --strict pittapi/dining.py
pittapi/__init__.py:23: error: Skipping analyzing "gevent": module is installed, but missing library stubs or py.typed marker  [import-untyped]
pittapi/__init__.py:23: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
pittapi/dining.py:118: error: Function is missing a return type annotation  [no-untyped-def]
Found 2 errors in 2 files (checked 1 source file)

After:

mypy --strict pittapi/dining.py
pittapi/__init__.py:23: error: Skipping analyzing "gevent": module is installed, but missing library stubs or py.typed marker  [import-untyped]
pittapi/__init__.py:23: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)

Like in #193, the remaining missing-imports error will need to be ignored with --ignore-missing-imports because gevent simply doesn't provide any type hints for mypy.

@tianyizheng02 tianyizheng02 merged commit 0ce1cde into dev Aug 25, 2024
4 checks passed
@tianyizheng02 tianyizheng02 deleted the mypy-dining branch August 25, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants