-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathquick_check.py
More file actions
63 lines (54 loc) · 1.87 KB
/
quick_check.py
File metadata and controls
63 lines (54 loc) · 1.87 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
import subprocess
import sys
import os
# Simple environment and basic test check
print("=== Environment Check ===")
# Check Python
try:
print(f"Python version: {sys.version}")
print(f"Python executable: {sys.executable}")
except Exception as e:
print(f"Python check failed: {e}")
# Check current directory
print(f"Current directory: {os.getcwd()}")
print(f"Workspace contents: {os.listdir('/workspace')[:10]}...")
# Check if we can import CDP
print("\n=== CDP Import Test ===")
try:
sys.path.insert(0, '/workspace')
import cdp
print("✓ CDP import successful")
# Try importing a specific module
import cdp.runtime
print("✓ CDP.runtime import successful")
# Check if we have the basic structure
print(f"CDP module file: {cdp.__file__}")
except Exception as e:
print(f"✗ CDP import failed: {e}")
import traceback
traceback.print_exc()
# Check for required tools
print("\n=== Tool Availability ===")
tools = ['pytest', 'mypy']
for tool in tools:
try:
result = subprocess.run([sys.executable, '-m', tool, '--version'],
capture_output=True, text=True, timeout=10)
if result.returncode == 0:
print(f"✓ {tool} available: {result.stdout.strip()}")
else:
print(f"✗ {tool} not working: {result.stderr.strip()}")
except Exception as e:
print(f"✗ {tool} check failed: {e}")
print("\n=== Basic Test Run ===")
# Try running a simple test
try:
os.chdir('/workspace')
result = subprocess.run([sys.executable, '-c', 'import cdp; print("Import test passed")'],
capture_output=True, text=True, timeout=10)
if result.returncode == 0:
print("✓ Basic import test passed")
else:
print(f"✗ Basic import test failed: {result.stderr}")
except Exception as e:
print(f"✗ Basic test failed: {e}")