<#3681 [BUG] Flytekit type hints are ignored by my...
# flyte-github
a
#3681 [BUG] Flytekit type hints are ignored by mypy Issue created by tekumara Describe the bug Flytekit type hints are ignored by mypy because flytekit does not have a
py.typed
marker as per PEP 0561 Expected behavior Usage of flytekit is checked against its types. Additional context to reproduce Given
Copy code
from typing import Dict, List, NamedTuple

from flytekit import task


class OpenFlightsData(NamedTuple):
    routes: List[Dict[str, str]]
    airlines: Dict[str, str]
    airports: Dict[str, Dict[str, str]]


@task()
def extract_reference_data() -> OpenFlightsData:
    return OpenFlightsData(
        routes=[{"MAO": "CIZ"}], airlines={"0B": "Blue Air"}, airports={"AAA": {"lat": "1", "lon": "2"}}
    )
Then when running mypy 1.3.0:
Copy code
❯ mypy aircraft/test.py
aircraft/test.py:3: error: Skipping analyzing "flytekit": module is installed, but missing library stubs or py.typed marker  [import]
aircraft/test.py:3: note: See <https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports>
Found 1 error in 1 file (checked 1 source file)
Screenshots No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte