清理无用代码、合并工具链、修复注释与日志问题
- 删除破损文件: main.py/main.ui/main_ui.py - 删除 runtime_hook.py(归宿主维护),清除 tools/ 目录 - 合并 export_runtime/pack_zip/verify_companions 到 build_pyd.py - 修复注释: docstring 参数与实际签名不一致、过时引用、拼写错误 - 修复日志: 消除静默吞异常、删冗余 log+raise、补缺失日志 - 精简 .gitignore
This commit is contained in:
@@ -61,7 +61,7 @@ def _load_from_source(runtime_dir: Path, pkg: str) -> ModuleType | None:
|
||||
|
||||
|
||||
def _load_from_pyd(build_dir: Path, pkg: str) -> ModuleType | None:
|
||||
"""尝试从 build/<pkg>/<pkg>.cp311-*.pyd 加载预编译包。"""
|
||||
"""尝试从 build/<pkg>/<pkg>.<python-tag>.pyd 加载预编译包。"""
|
||||
candidates = list(build_dir.glob(f"{pkg}.*.pyd"))
|
||||
if not candidates:
|
||||
return None
|
||||
@@ -87,7 +87,6 @@ def load_companions(packages: list[str]) -> list[str]:
|
||||
loaded: list[str] = []
|
||||
for pkg in packages:
|
||||
if pkg in sys.modules:
|
||||
logger.debug(f"伴生包 {pkg} 已在 sys.modules,跳过")
|
||||
loaded.append(pkg)
|
||||
continue
|
||||
|
||||
@@ -102,5 +101,4 @@ def load_companions(packages: list[str]) -> list[str]:
|
||||
logger.warning(
|
||||
f"伴生包未找到: {pkg}(runtime={runtime_dir} / build={build_dir} 均无)"
|
||||
)
|
||||
|
||||
return loaded
|
||||
Reference in New Issue
Block a user