Skip to content

mypy doesn't seem to detect this package #13

@d33tah

Description

@d33tah

Consider the following test file:

import boto3
from boto3_type_annotations.s3 import Bucket
bucket: Bucket = boto3.resource("s3").Bucket('asd')

And the following Dockerfile:

FROM python:3.7
RUN pip install boto3 boto3_type_annotations mypy
ADD ./a.py a.py
RUN mypy a.py

Here's what happens when I try to run it:

> sudo docker build . 
Sending build context to Docker daemon  3.072kB
Step 1/4 : FROM python:3.7
 ---> 023b89039ba4
Step 2/4 : RUN pip install boto3 boto3_type_annotations mypy
 ---> Using cache
 ---> f3145ded7f54
Step 3/4 : ADD ./a.py a.py
 ---> Using cache
 ---> d90f377d6b3e
Step 4/4 : RUN mypy a.py
 ---> Running in 6e8e8b383b62
a.py:1: error: No library stub file for module 'boto3'
a.py:1: note: (Stub files are from https://github.com/python/typeshed)
a.py:2: error: Cannot find module named 'boto3_type_annotations.s3'
a.py:2: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
Found 2 errors in 1 file (checked 1 source file)
The command '/bin/sh -c mypy a.py' returned a non-zero code: 1

Is this intentional that this package doesn't seem to work with mypy, or am I doing something wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions