forked from Ultimaker/Cura
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathrun_mypy.py
31 lines (25 loc) · 858 Bytes
/
run_mypy.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!env python
import os
import subprocess
os.putenv("MYPYPATH", r".;.\plugins;.\plugins\VersionUpgrade;..\Uranium_hint\;..\Uranium_hint\stubs\\" )
def findModules(path):
result = []
for entry in os.scandir(path):
if entry.is_dir() and os.path.exists(os.path.join(path, entry.name, "__init__.py")):
result.append(entry.name)
return result
plugins = findModules("plugins")
plugins.sort()
mods = ["cura"] + plugins + findModules("plugins/VersionUpgrade")
for mod in mods:
print("------------- Checking module {mod}".format(**locals()))
result = subprocess.run(["python", r"c:\python35\Scripts\mypy", "-p", mod])
if result.returncode != 0:
print("""
Module {mod} failed checking. :(
""".format(**locals()))
break
else:
print("""
Done checking. All is good.
""")