mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 10:17:52 -06:00
WIP: Fix run_mypy.py for Windows
This commit is contained in:
parent
1a32e90cd0
commit
08249a8b06
1 changed files with 7 additions and 3 deletions
10
run_mypy.py
10
run_mypy.py
|
@ -39,8 +39,9 @@ def main():
|
|||
os.putenv("MYPYPATH", ":".join(mypy_path_parts))
|
||||
|
||||
# Mypy really needs to be run via its Python script otherwise it can't find its data files.
|
||||
mypy_exe = where("mypy.exe" if sys.platform == "win32" else "mypy")
|
||||
mypy_module = os.path.join(os.path.dirname(mypy_exe), "mypy")
|
||||
mypy_exe_name = "mypy.exe" if sys.platform == "win32" else "mypy"
|
||||
mypy_exe_dir = where(mypy_exe_name)
|
||||
mypy_module = os.path.join(os.path.dirname(mypy_exe_dir), mypy_exe_name)
|
||||
|
||||
plugins = findModules("plugins")
|
||||
plugins.sort()
|
||||
|
@ -49,7 +50,10 @@ def main():
|
|||
|
||||
for mod in mods:
|
||||
print("------------- Checking module {mod}".format(**locals()))
|
||||
result = subprocess.run([sys.executable, mypy_module, "-p", mod, "--ignore-missing-imports"])
|
||||
if sys.platform == "win32":
|
||||
result = subprocess.run([mypy_module, "-p", mod, "--ignore-missing-imports"])
|
||||
else:
|
||||
result = subprocess.run([sys.executable, mypy_module, "-p", mod, "--ignore-missing-imports"])
|
||||
if result.returncode != 0:
|
||||
print("\nModule {mod} failed checking. :(".format(**locals()))
|
||||
return 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue