mypy_boto3_builder: pyright: Stub file not found for "mypy_boto3_dynamodb" (reportMissingTypeStubs)
To Reproduce Steps to reproduce the behavior:
- Install ‘boto3-stubs[dynamodb]’
- Run pyright on the following code sample
import boto3
import mypy_boto3_dynamodb as dynamodb
client: dynamodb.DynamoDBClient = boto3.client("dynamodb")
- Actual pyright output
2:8 - error: Stub file not found for "mypy_boto3_dynamodb" (reportMissingTypeStubs)
4:9 - error: Type of "DynamoDBClient" is unknown (reportUnknownMemberType)
4:41 - error: "client" is not a known member of module (reportGeneralTypeIssues)
4:35 - error: Type of "client" is unknown (reportUnknownMemberType)
4:1 - error: Type of "client" is unknown (reportUnknownVariableType)
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 16
Because you can create client/resource two ways
Thanks, @tekumara , your feedback helped a lot.
Okay, progress so far: https://github.com/vemel/mypy_boto3_builder/pull/47
Also, implicit type annotations should be fully supported now: https://github.com/vemel/mypy_boto3_builder/pull/47/files#diff-eeb707bbf2c07f3a17387150bca7901f
Regarding
List[FilterTypeDef]
- I believe this is the only correct solution in this case.@tekumara this is awesome! I completely forgot about
typings
folder. Actually, I believe you can do something likeand then do renaming.
I will cross-check if everything works correctly with
*.pyi
files instead of*.py
(I think, imports for mypy will be broken), and release a new version.So, the plan is:
pyi
typings
works as it shouldpyright
can handle it, because bothmypy
andPyCharm
failI added initial support for
pyright
toboto3_stubs>=1.14.51.1
. See release notes for more details and future plans.And let me know if it still does not work as it should.
Unfortunately, this means adding all 200+ services to boto3_stubs and it takes more than 15 MB of space. Probably I can somehow let pyright know that
mypy_boto3_dynamodb
is a stub package, so it adds it automatically on import?I tried
pyright
, works really well, so I will definitely invest some time into supporting it.Your solution should be added to docs, or maybe I can do it in command
if
pyright
is installed.Thank you for the report. I have never used
pyright
, but I will take a look.