diff options
-rwxr-xr-x | run_mypy.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/run_mypy.py b/run_mypy.py index 9ad43b8..338968d 100755 --- a/run_mypy.py +++ b/run_mypy.py @@ -96,6 +96,7 @@ def main() -> int: parser = argparse.ArgumentParser(description='Process some integers.') parser.add_argument('files', nargs='*') + parser.add_argument('--mypy', help='path to mypy executable') parser.add_argument('-q', '--quiet', action='store_true', help='do not print informational messages') parser.add_argument('-p', '--pretty', action='store_true', help='pretty print mypy errors') parser.add_argument('-C', '--clear', action='store_true', help='clear the terminal before running mypy') @@ -121,12 +122,10 @@ def main() -> int: to_check.extend(modules) if to_check: + command = [opts.mypy] if opts.mypy else [sys.executable, '-m', 'mypy'] if not opts.quiet: print('Running mypy (this can take some time) ...') - p = subprocess.run( - [sys.executable, '-m', 'mypy'] + args + to_check, - cwd=root, - ) + p = subprocess.run(command + args + to_check, cwd=root) return p.returncode else: if not opts.quiet: |