MCPcopy
hub / github.com/HKUDS/DeepCode / check_dependencies

Function check_dependencies

deepcode.py:37–123  ·  view source on GitHub ↗

Check if necessary dependencies are installed for new UI

()

Source from the content-addressed store, hash-verified

35
36
37def check_dependencies():
38 """Check if necessary dependencies are installed for new UI"""
39 import importlib.util
40 import shutil
41
42 print("🔍 Checking dependencies...")
43
44 missing_deps = []
45 missing_system_deps = []
46
47 # Check FastAPI availability (for backend)
48 if importlib.util.find_spec("fastapi") is not None:
49 print("✅ FastAPI is installed")
50 else:
51 missing_deps.append("fastapi>=0.104.0")
52
53 # Check uvicorn availability (for backend server)
54 if importlib.util.find_spec("uvicorn") is not None:
55 print("✅ Uvicorn is installed")
56 else:
57 missing_deps.append("uvicorn>=0.24.0")
58
59 # Check PyYAML availability
60 if importlib.util.find_spec("yaml") is not None:
61 print("✅ PyYAML is installed")
62 else:
63 missing_deps.append("pyyaml>=6.0")
64
65 # Check pydantic-settings availability
66 if importlib.util.find_spec("pydantic_settings") is not None:
67 print("✅ Pydantic-settings is installed")
68 else:
69 missing_deps.append("pydantic-settings>=2.0.0")
70
71 # Check Node.js availability (for frontend)
72 node_cmd = "node.exe" if get_platform() == "windows" else "node"
73 if shutil.which(node_cmd) or shutil.which("node"):
74 try:
75 result = subprocess.run(
76 ["node", "--version"],
77 capture_output=True,
78 text=True,
79 timeout=5,
80 shell=(get_platform() == "windows"),
81 )
82 if result.returncode == 0:
83 print(f"✅ Node.js is installed ({result.stdout.strip()})")
84 except Exception:
85 missing_system_deps.append("Node.js")
86 else:
87 missing_system_deps.append("Node.js")
88 print("❌ Node.js not found (required for frontend)")
89
90 # Check npm availability
91 npm_cmd = "npm.cmd" if get_platform() == "windows" else "npm"
92 if shutil.which(npm_cmd) or shutil.which("npm"):
93 print("✅ npm is available")
94 else:

Callers 1

mainFunction · 0.70

Calls 2

get_platformFunction · 0.85
runMethod · 0.80

Tested by

no test coverage detected