-
-
Notifications
You must be signed in to change notification settings - Fork 194
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
Run mypy during CI #391
Merged
Merged
Run mypy during CI #391
Conversation
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
* Warn when using non existing mypy options * Use Python 3.7 * Ignore missing imports for dependencies without type definitions
This way we can keep track of the progress in enabling strict type checking.
rnestler
commented
Aug 10, 2022
# disallow_untyped_calls = true | ||
# disallow_untyped_defs = true | ||
# disallow_incomplete_defs = true | ||
# check_untyped_defs = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably have the highest priority to enable, since it will highlight existing type errors:
src/flask_caching/utils.py:94: error: Argument 1 to "translate" of "str" has incompatible type "*Tuple[Dict[str, None]]"; expected "Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]"
src/flask_caching/utils.py:97: error: Argument 1 to "translate" of "str" has incompatible type "*Tuple[Dict[str, None]]"; expected "Union[Mapping[int, Union[int, str, None]], Sequence[Union[int, str, None]]]"
src/flask_caching/backends/rediscache.py:94: error: "str" not callable
src/flask_caching/backends/rediscache.py:111: error: Incompatible types in assignment (expression has type "List[Any]", variable has type "Tuple[Any, ...]")
src/flask_caching/__init__.py:409: error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no attribute "cache_timeout"
src/flask_caching/__init__.py:499: error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no attribute "uncached"
src/flask_caching/__init__.py:500: error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no attribute "cache_timeout"
src/flask_caching/__init__.py:501: error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no attribute "make_cache_key"
src/flask_caching/__init__.py:599: error: Argument "timeout" to "_memoize_version" of "Cache" has incompatible type "Union[Any, Callable[..., Any], None]"; expected "Optional[int]"
src/flask_caching/__init__.py:838: error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no attribute "make_cache_key"
src/flask_caching/__init__.py:885: error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no attribute "cache_timeout"
src/flask_caching/__init__.py:893: error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no attribute "uncached"
src/flask_caching/__init__.py:894: error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no attribute "cache_timeout"
src/flask_caching/__init__.py:895: error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no attribute "make_cache_key"
src/flask_caching/__init__.py:898: error: Argument "forced_update" to "_memoize_make_cache_key" of "Cache" has incompatible type "Optional[Callable[..., Any]]"; expected "bool"
src/flask_caching/__init__.py:903: error: "Callable[[VarArg(Any), KwArg(Any)], Any]" has no attribute "delete_memoized"
Found 16 errors in 3 files (checked 14 source files)
northernSage
approved these changes
Aug 14, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the contribution!
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This runs mypy during CI checks. Note that it doesn't run in strict mode, so doesn't yet provide full type check coverage.
Checklist:
CHANGES.rst
summarizing the change and linking to the issue... versionchanged::
entries in any relevant code docs.pre-commit
hooks and fix any issues.pytest
andtox
, no tests failed.