MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / check_requirements

Function check_requirements

tools/donate_cpu_lib.py:51–79  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

49
50
51def check_requirements():
52 result = True
53
54 global __make_cmd
55 __make_cmd = detect_make()
56 if __make_cmd is None:
57 result = False
58
59 apps = ['git', 'wget']
60 if __make_cmd in ['make', 'mingw32-make']:
61 apps.append('g++')
62 apps.append('gdb')
63
64 for app in apps:
65 try:
66 #print('{} --version'.format(app))
67 subprocess.check_call([app, '--version'], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
68 except OSError:
69 print("Error: '{}' is required".format(app))
70 result = False
71
72 try:
73 # pylint: disable-next=unused-import - intentional
74 import psutil
75 except ImportError as e:
76 print("Error: {}. Module is required.".format(e))
77 result = False
78
79 return result
80
81
82# Try and retry with exponential backoff if an exception is raised

Callers

nothing calls this directly

Calls 2

detect_makeFunction · 0.85
formatMethod · 0.80

Tested by

no test coverage detected