-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_packages.py
More file actions
66 lines (57 loc) · 2.2 KB
/
debug_packages.py
File metadata and controls
66 lines (57 loc) · 2.2 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
64
65
66
"""
SPDX-License-Identifier: Apache-2.0
Copyright (c) 2025 OrchIntel Systems Ltd.
https://orchintel.com | https://ioa.systems
Part of IOA Core (Open Source Edition). See LICENSE at repo root.
Debug script to test packages import structure in CI environment.
"""
import os
import sys
def debug_packages():
"""Debug the packages import structure."""
print("=== Packages Debug Info ===")
print(f"Current working directory: {os.getcwd()}")
print(f"Python path: {sys.path}")
print("\n=== Directory Structure ===")
if os.path.exists("packages"):
print("✅ packages/ directory exists")
for item in os.listdir("packages"):
item_path = os.path.join("packages", item)
if os.path.isdir(item_path):
print(f" 📁 {item}/")
if os.path.exists(os.path.join(item_path, "__init__.py")):
print(f" ✅ {item}/__init__.py exists")
else:
print(f" ❌ {item}/__init__.py missing")
else:
print(f" 📄 {item}")
else:
print("❌ packages/ directory missing")
print("\n=== Import Tests ===")
try:
import packages
print("✅ import packages successful")
print(f" packages.__file__: {getattr(packages, '__file__', 'N/A')}")
except ImportError as e:
print(f"❌ import packages failed: {e}")
try:
import packages.core
print("✅ import packages.core successful")
except ImportError as e:
print(f"❌ import packages.core failed: {e}")
# Enterprise package test - only run if explicitly enabled
if os.getenv("IOA_TEST_ENTERPRISE") == "1":
try:
import packages.enterprise
print("✅ import packages.enterprise successful")
except ImportError as e:
print(f"❌ import packages.enterprise failed: {e}")
else:
print("⏭️ packages.enterprise test skipped (IOA_TEST_ENTERPRISE != 1)")
try:
import packages.saas
print("✅ import packages.saas successful")
except ImportError as e:
print(f"❌ import packages.saas failed: {e}")
if __name__ == "__main__":
debug_packages()