-
Notifications
You must be signed in to change notification settings - Fork 397
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
chore(mypy): add mypy support to makefile #508
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #508 +/- ##
========================================
Coverage 99.90% 99.90%
========================================
Files 107 107
Lines 4280 4280
Branches 212 212
========================================
Hits 4276 4276
Misses 1 1
Partials 3 3
Continue to review full report at Codecov.
|
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.
Let's create a mypy.ini
file to best ignore untyped libraries among other features we can enable like a pydantic plugin.
Example that we can start with, errors will become easier to read too:
[mypy]
warn_return_any=False
warn_unused_configs=True
no_implicit_optional=True
warn_redundant_casts=True
warn_unused_ignores=True
pretty = True
show_column_numbers = True
show_error_codes = True
show_error_context = True
[mypy-jmespath]
ignore_missing_imports=True
@heitorlessa |
Before this was an implicit optional def foo(msg: str = None):
... now it needs to be from typing import Optional
def foo(msg: Optional[str] = None):
... |
This is correct actually. It's the issue that @Nr18 was having too. Challenge with Python is the mutable defaults |
* develop: chore(deps): bump boto3 from 1.18.0 to 1.18.1 (aws-powertools#528) fix(tracer): mypy generic to preserve decorated method signature (aws-powertools#529) fix(parser): Make ApiGateway version, authorizer fields optional (aws-powertools#532) fix(mypy): fixes to resolve no implicit optional errors (aws-powertools#521) chore(deps): bump boto3 from 1.17.110 to 1.18.0 (aws-powertools#527) feat(feat-toggle): New simple feature toggles rule engine (WIP) (aws-powertools#494) chore(deps-dev): bump mkdocs-material from 7.1.9 to 7.1.10 (aws-powertools#522) chore(deps): bump boto3 from 1.17.102 to 1.17.110 (aws-powertools#523) chore(deps-dev): bump isort from 5.9.1 to 5.9.2 (aws-powertools#514) feat(mypy): add mypy support to makefile (aws-powertools#508) feat(api-gateway): add debug mode (aws-powertools#507)
Issue #, if available:
Description of changes:
mypy
as a dev dependencymypy
as task in the MakefileExample usage
Checklist
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.