mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
fix(v1.3-doctor): update worker_script path and doctor checks for v1.3 architecture
- config.py: worker_script now points to paperforge/worker/__init__.py (pipeline/ removed in Phase 12) - worker/status.py: doctor checks paperforge.worker importability instead of old literature_pipeline.py existence - tests/test_config.py: update assertion for new worker_script name
This commit is contained in:
parent
b99087c457
commit
4d57d17975
3 changed files with 12 additions and 19 deletions
|
|
@ -253,9 +253,8 @@ def paperforge_paths(
|
|||
bases = vault / base_dir
|
||||
skill_path = vault / skill_dir
|
||||
|
||||
# Resolve script paths relative to vault (for portability in copied installs)
|
||||
# worker_script: look relative to vault root
|
||||
worker_script = vault / "pipeline" / "worker" / "scripts" / "literature_pipeline.py"
|
||||
# worker_script: paperforge worker package (pipeline/ removed in v1.3)
|
||||
worker_script = Path(__file__).parent / "worker" / "__init__.py"
|
||||
# ld_deep_script: look relative to skill_dir first, then repo paperforge/skills for dev
|
||||
ld_deep_script = skill_path / "literature-qa" / "scripts" / "ld_deep.py"
|
||||
if not ld_deep_script.exists():
|
||||
|
|
|
|||
|
|
@ -475,21 +475,15 @@ def run_doctor(vault: Path) -> int:
|
|||
else:
|
||||
add_check("OCR 配置", "fail", "缺少 PADDLEOCR_API_TOKEN", "在 .env 文件中设置 PADDLEOCR_API_TOKEN")
|
||||
|
||||
if (paths["pipeline"] / "literature_pipeline.py").exists():
|
||||
add_check("Worker 脚本", "pass", "literature_pipeline.py 存在")
|
||||
try:
|
||||
from paperforge.worker.sync import (
|
||||
run_selection_sync, run_index_refresh,
|
||||
)
|
||||
from paperforge.worker.deep_reading import run_deep_reading
|
||||
from paperforge.worker.ocr import run_ocr
|
||||
from paperforge.worker.base_views import ensure_base_views
|
||||
run_status # self-reference
|
||||
add_check("Worker 脚本", "pass", "所有 worker 函数可导入")
|
||||
except ImportError as e:
|
||||
add_check("Worker 脚本", "fail", f"worker 函数导入失败: {e}", "检查 pipeline/worker/scripts/literature_pipeline.py")
|
||||
else:
|
||||
add_check("Worker 脚本", "fail", "literature_pipeline.py 不存在", "确认 PaperForge pipeline 已正确安装")
|
||||
# Worker module check (v1.3+: pipeline/ removed, use paperforge.worker package)
|
||||
try:
|
||||
from paperforge.worker.sync import run_selection_sync, run_index_refresh
|
||||
from paperforge.worker.deep_reading import run_deep_reading
|
||||
from paperforge.worker.ocr import run_ocr
|
||||
from paperforge.worker.base_views import ensure_base_views
|
||||
add_check("Worker 脚本", "pass", "paperforge.worker 包可导入")
|
||||
except ImportError as e:
|
||||
add_check("Worker 脚本", "fail", f"worker 函数导入失败: {e}", "运行: pip install -e .")
|
||||
|
||||
# Path Resolution checks
|
||||
check_zotero_location(vault, cfg, add_check)
|
||||
|
|
|
|||
|
|
@ -343,7 +343,7 @@ def test_paperforge_paths_includes_worker_script(tmp_path: Path):
|
|||
|
||||
paths = paperforge_paths(vault)
|
||||
assert "worker_script" in paths
|
||||
assert paths["worker_script"].name == "literature_pipeline.py"
|
||||
assert paths["worker_script"].name == "__init__.py"
|
||||
|
||||
|
||||
def test_paperforge_paths_includes_ld_deep_script(tmp_path: Path):
|
||||
|
|
|
|||
Loading…
Reference in a new issue