compileall.compile_dir is missing an annotation for its argument invalidation_mode, which should be py_compile.PycInvalidationMode.
Details
#!/usr/bin/env bash
mypy --version # mypy 0.740
python --version # python 3.7.5
python/cpython#5200, the PR that introduced the new argument
link to cpython Lib/compileall.py for reference.
Reproduction
#!/usr/bin/env python3importsysassertint(sys.version.split(".")[1]) >=7"requres python >= 7"fromcompileallimportcompile_dirfrompy_compileimportPycInvalidationModecompile_dir('path/to/real/dir', invalidation_mode=PycInvalidationMode.CHECKED_HASH)
# error: Unexpected keyword argument "invalidation_mode" for "compile_dir"reveal_type(compile_dir)
# def(# dir: Union[builtins.str, builtins.bytes, builtins._PathLike[Any]],# maxlevels: builtins.int = None,# # -- snip --# workers: builtins.int =,# # MISSING: invalidation_mode: py_compile.PycInvalidationMode# ) -> builtins.inthelp(compile_all)
# compile_dir(dir, maxlevels=10, ..., workers=1, invalidation_mode=None)# # --snip--# workers: maximum number of parallel workers# invalidation_mode: how the up-to-dateness of the pyc will be checked
compileall.compile_diris missing an annotation for its argumentinvalidation_mode, which should bepy_compile.PycInvalidationMode.Details
python/cpython#5200, the PR that introduced the new argument
link to cpython Lib/compileall.py for reference.
Reproduction