chore(mypy): add mypy support to makefile#508
chore(mypy): add mypy support to makefile#508heitorlessa merged 3 commits intoaws-powertools:developfrom
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.
|
heitorlessa
left a comment
There was a problem hiding this comment.
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:
mypyas a dev dependencymypyas 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.