-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathverify_build.py
More file actions
49 lines (41 loc) · 1.6 KB
/
verify_build.py
File metadata and controls
49 lines (41 loc) · 1.6 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
import sys
import os
# 1. 自动定位生成的 PyQWindowKit 包
# 假设脚本在项目根目录运行,我们添加 install 输出目录到 sys.path
install_dir = os.path.join(os.getcwd(), "out", "install", "x64-msvc-Release")
if os.path.exists(install_dir):
print(f"Adding install dir to sys.path: {install_dir}")
sys.path.append(install_dir)
else:
print(f"Warning: Install dir not found: {install_dir}")
# Fallback logic if needed...
try:
# 2. 尝试导入模块
# 由于我们在 __init__.py 中已经处理了 DLL 路径,这里应该可以直接导入
import PyQWindowKit
print("Successfully imported PyQWindowKit package!")
print(f"Package file: {PyQWindowKit.__file__}")
# 3. 检查子模块
try:
from PyQWindowKit import Core
print("Successfully imported PyQWindowKit.Core!")
print("Core contents:", dir(Core))
except ImportError as e:
print(f"Failed to import Core: {e}")
try:
from PyQWindowKit import Widgets
print("Successfully imported PyQWindowKit.Widgets!")
print("Widgets contents:", dir(Widgets))
except ImportError as e:
print(f"Failed to import Widgets: {e}")
try:
from PyQWindowKit import Quick
print("Successfully imported PyQWindowKit.Quick!")
print("Quick contents:", dir(Quick))
except ImportError as e:
print(f"Failed to import Quick: {e}")
except ImportError as e:
print(f"ImportError: {e}")
print("\nPossible reasons:")
print("1. Dependency DLLs are missing.")
print("2. The install directory is not in sys.path.")