def _single_dir_mypy()

in eng/scripts/run_mypy.py [0:0]


def _single_dir_mypy(mod):
    inner_class = next(d for d in mod.iterdir() if d.is_dir() and not str(d).endswith("egg-info"))
    try:
        check_call(
            [
                sys.executable,
                "-m",
                "mypy",
                "--config-file",
                get_config_file_location(),
                "--ignore-missing",
                str(inner_class.absolute()),
            ]
        )
        return True
    except CalledProcessError as e:
        logging.error("{} exited with mypy error {}".format(inner_class.stem, e.returncode))
        return False