mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
fix(wizard): auto-run pip install -e . and improve UX flow
- setup_wizard.py: _deploy() now calls pip install -e <repo_root> automatically - DoneStep: removes manual 'pip install -e .' instruction (wizard handles it) - README.md: removes separate pip install -r requirements.txt step - docs/INSTALLATION.md: same pip install simplification - pyproject.toml: add pytest ignore for nested sandbox vault - tests/sandbox/: remove old vault/ (replaced by 00_TestVault/) - tests/sandbox/README.md: update flow, wizard handles pip install
This commit is contained in:
parent
31cce820e2
commit
1d8478ce9c
16 changed files with 30 additions and 319 deletions
|
|
@ -20,15 +20,13 @@
|
|||
git clone https://github.com/LLLin000/PaperForge.git
|
||||
cd PaperForge
|
||||
|
||||
# 2. 安装依赖
|
||||
pip install -r requirements.txt
|
||||
|
||||
# 3. 运行向导(交互式,按步骤引导)
|
||||
# 2. 运行向导(交互式,按步骤引导)
|
||||
python setup_wizard.py --vault /path/to/your/vault
|
||||
```
|
||||
|
||||
向导会自动完成:
|
||||
- 检测 Python 环境和依赖
|
||||
- 安装 PaperForge 工具包(`pip install -e .` 由向导自动执行)
|
||||
- 配置 Vault 目录结构(可自定义名称)
|
||||
- 链接 Zotero 数据目录
|
||||
- 检测 Better BibTeX 插件
|
||||
|
|
|
|||
|
|
@ -9,10 +9,7 @@ PaperForge 提供图形化安装向导,引导你完成全部配置:
|
|||
git clone https://github.com/LLLin000/PaperForge.git
|
||||
cd PaperForge
|
||||
|
||||
# 2. 安装依赖
|
||||
pip install -r requirements.txt
|
||||
|
||||
# 3. 运行向导
|
||||
# 2. 运行向导(pip install -e . 由向导自动执行)
|
||||
python setup_wizard.py --vault /path/to/your/vault
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -45,3 +45,6 @@ include = ["paperforge_lite*"]
|
|||
|
||||
[tool.setuptools.package-data]
|
||||
paperforge_lite = ["py.typed"]
|
||||
|
||||
[tool.pytest.ini_options]
|
||||
addopts = "--ignore=tests/sandbox/00_TestVault/"
|
||||
|
|
|
|||
|
|
@ -1126,7 +1126,22 @@ ZOTERO_DATA_DIR={getattr(self.app, 'zotero_data_dir', '')}
|
|||
self.set_status(f"脚本测试警告: {result.stderr[:100]}", None)
|
||||
except Exception as e:
|
||||
self.set_status(f"脚本测试跳过: {e}", None)
|
||||
|
||||
|
||||
# 9. 安装 PaperForge 工具包(让 paperforge 命令全局可用)
|
||||
self.set_status("安装 PaperForge 工具包...", None)
|
||||
try:
|
||||
result = subprocess.run(
|
||||
[sys.executable, "-m", "pip", "install", "-e", str(repo_root)],
|
||||
capture_output=True, text=True, timeout=60,
|
||||
)
|
||||
if result.returncode == 0:
|
||||
self.set_status("PaperForge 工具包安装完成(paperforge 命令已全局注册)", True)
|
||||
else:
|
||||
stderr = result.stderr[:200] if result.stderr else ""
|
||||
self.set_status(f"pip install 警告(paperforge 命令可能需要手动注册): {stderr}", None)
|
||||
except Exception as e:
|
||||
self.set_status(f"pip install 跳过: {e}", None)
|
||||
|
||||
return True
|
||||
|
||||
|
||||
|
|
@ -1141,36 +1156,31 @@ class DoneStep(StepScreen):
|
|||
yield Markdown(f"""
|
||||
## 安装完成!
|
||||
|
||||
所有前置条件已满足,你现在可以开始使用 PaperForge Lite。
|
||||
PaperForge Lite 已完成安装和初始化。以下是立即开始使用的步骤:
|
||||
|
||||
### 首次使用步骤:
|
||||
|
||||
**1. 安装 PaperForge 工具包**
|
||||
```bash
|
||||
pip install -e .
|
||||
```
|
||||
|
||||
**2. 同步 Zotero 文献**
|
||||
**1. 同步 Zotero 文献**
|
||||
```bash
|
||||
paperforge selection-sync
|
||||
```
|
||||
|
||||
**3. 生成正式笔记**
|
||||
**2. 生成正式笔记**
|
||||
```bash
|
||||
paperforge index-refresh
|
||||
```
|
||||
|
||||
**4. 标记精读文献**
|
||||
**3. 标记精读文献**
|
||||
在 Obsidian 中打开 library-records 文件,设置:
|
||||
- `do_ocr: true`
|
||||
- `analyze: true`
|
||||
|
||||
**5. 运行 OCR**
|
||||
**4. 运行 OCR**
|
||||
```bash
|
||||
paperforge ocr run
|
||||
```
|
||||
|
||||
**6. 执行精读**
|
||||
**5. 执行精读**
|
||||
在 OpenCode Agent 中输入:
|
||||
```
|
||||
/LD-deep <zotero_key>
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ tests/sandbox/
|
|||
# 1. 进入仓库根目录
|
||||
cd D:\...\github-release
|
||||
|
||||
# 2. 运行安装向导,指向空 vault
|
||||
# 2. 运行安装向导,指向空 vault(pip install -e . 由向导自动完成)
|
||||
python setup_wizard.py --vault D:\L\Med\Research\99_System\LiteraturePipeline\github-release\tests\sandbox\00_TestVault
|
||||
|
||||
# 3. 安装向导中:
|
||||
|
|
@ -32,14 +32,10 @@ python setup_wizard.py --vault D:\L\Med\Research\99_System\LiteraturePipeline\gi
|
|||
# (向导会检测到 exports/ 下的 JSON 文件)
|
||||
# - 其他步骤默认即可
|
||||
|
||||
# 4. 向导完成后,按提示运行(在同一终端窗口):
|
||||
pip install -e .
|
||||
|
||||
# 5. 测试 pipeline:
|
||||
# 4. 测试 pipeline:
|
||||
cd D:\L\Med\Research\99_System\LiteraturePipeline\github-release\tests\sandbox\00_TestVault
|
||||
paperforge selection-sync
|
||||
paperforge index-refresh
|
||||
paperforge ocr run
|
||||
paperforge status
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
# GENERATED by PaperForge sandbox — test fixture
|
||||
name: Literature Hub
|
||||
type: ObsidianBase
|
||||
|
||||
views:
|
||||
- name: 全记录
|
||||
type: table
|
||||
filters: ""
|
||||
order: title, year
|
||||
|
||||
---
|
||||
# Literature Hub
|
||||
Cross-domain overview.
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# GENERATED by PaperForge sandbox — test fixture
|
||||
name: 运动医学
|
||||
type: ObsidianBase
|
||||
|
||||
views:
|
||||
- name: 全记录
|
||||
type: table
|
||||
filters: ""
|
||||
order: title, year
|
||||
|
||||
---
|
||||
# 运动医学 Literature Base
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
# GENERATED by PaperForge sandbox — test fixture
|
||||
name: 骨科
|
||||
type: ObsidianBase
|
||||
|
||||
views:
|
||||
- name: 全记录
|
||||
type: table
|
||||
filters: ""
|
||||
order: title, year
|
||||
|
||||
---
|
||||
# 骨科 Literature Base
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
{
|
||||
"items": [
|
||||
{
|
||||
"key": "SANDBOX004",
|
||||
"itemType": "journalArticle",
|
||||
"title": "Return to Sport Protocols After ACL Reconstruction: A Systematic Review",
|
||||
"creators": [
|
||||
{
|
||||
"creatorType": "author",
|
||||
"firstName": "Lisa",
|
||||
"lastName": "Park"
|
||||
},
|
||||
{
|
||||
"creatorType": "author",
|
||||
"firstName": "Tom",
|
||||
"lastName": "Nguyen"
|
||||
}
|
||||
],
|
||||
"date": "2024",
|
||||
"publicationTitle": "Sports Health",
|
||||
"DOI": "10.1177/19417381241234567",
|
||||
"PMID": "38876543",
|
||||
"abstractNote": "DATA SOURCES: PubMed, Embase, Cochrane. 23 studies included. Return-to-sport criteria varied widely.",
|
||||
"collections": [
|
||||
"运动医学"
|
||||
],
|
||||
"attachments": [
|
||||
{
|
||||
"path": "storage:SANDBOX004/SANDBOX004.pdf",
|
||||
"contentType": "application/pdf"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "SANDBOX005",
|
||||
"itemType": "journalArticle",
|
||||
"title": "Ultrasound-Guided Percutaneous Achilles Tendon Repair in Acute Ruptures",
|
||||
"creators": [
|
||||
{
|
||||
"creatorType": "author",
|
||||
"firstName": "Carlos",
|
||||
"lastName": "Rodriguez"
|
||||
}
|
||||
],
|
||||
"date": "2023",
|
||||
"publicationTitle": "Foot and Ankle International",
|
||||
"DOI": "10.1177/107110072311234",
|
||||
"PMID": "37234567",
|
||||
"abstractNote": "CASE SERIES: 28 patients. Primary outcomes: AOFAS score, time to weight-bearing, complications.",
|
||||
"collections": [
|
||||
"运动医学"
|
||||
],
|
||||
"attachments": [
|
||||
{
|
||||
"path": "storage:SANDBOX005/SANDBOX005.pdf",
|
||||
"contentType": "application/pdf"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
{
|
||||
"items": [
|
||||
{
|
||||
"key": "SANDBOX001",
|
||||
"itemType": "journalArticle",
|
||||
"title": "Suture Anchor Fixation for Rotator Cuff Tears: A Biomechanical Analysis",
|
||||
"creators": [
|
||||
{
|
||||
"creatorType": "author",
|
||||
"firstName": "James",
|
||||
"lastName": "Burkhardt"
|
||||
},
|
||||
{
|
||||
"creatorType": "author",
|
||||
"firstName": "Maria",
|
||||
"lastName": "Chen"
|
||||
}
|
||||
],
|
||||
"date": "2024",
|
||||
"publicationTitle": "Journal of Shoulder and Elbow Surgery",
|
||||
"DOI": "10.1016/j.jses.2024.01.001",
|
||||
"PMID": "38234156",
|
||||
"abstractNote": "BACKGROUND: Suture anchor fixation is critical for rotator cuff repair. We compared pull-out strength across 3 anchor types.",
|
||||
"collections": [
|
||||
"骨科"
|
||||
],
|
||||
"attachments": [
|
||||
{
|
||||
"path": "storage:SANDBOX001/SANDBOX001.pdf",
|
||||
"contentType": "application/pdf"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "SANDBOX002",
|
||||
"itemType": "journalArticle",
|
||||
"title": "Machine Learning Prediction of Anterior Cruciate Ligament Injury Risk in Athletes",
|
||||
"creators": [
|
||||
{
|
||||
"creatorType": "author",
|
||||
"firstName": "Wei",
|
||||
"lastName": "Zhang"
|
||||
}
|
||||
],
|
||||
"date": "2023",
|
||||
"publicationTitle": "American Journal of Sports Medicine",
|
||||
"DOI": "10.1177/03635465231123456",
|
||||
"PMID": "37123456",
|
||||
"abstractNote": "PURPOSE: To develop and validate an ML model for predicting ACL injury risk using biomechanical and demographic features.",
|
||||
"collections": [
|
||||
"骨科"
|
||||
],
|
||||
"attachments": [
|
||||
{
|
||||
"path": "storage:SANDBOX002/SANDBOX002.pdf",
|
||||
"contentType": "application/pdf"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "SANDBOX003",
|
||||
"itemType": "journalArticle",
|
||||
"title": "Platelet-Rich Plasma Injection for Knee Osteoarthritis: Randomized Controlled Trial",
|
||||
"creators": [
|
||||
{
|
||||
"creatorType": "author",
|
||||
"firstName": "Sarah",
|
||||
"lastName": "Johnson"
|
||||
},
|
||||
{
|
||||
"creatorType": "author",
|
||||
"firstName": "Ahmed",
|
||||
"lastName": "Hassan"
|
||||
}
|
||||
],
|
||||
"date": "2022",
|
||||
"publicationTitle": "Osteoarthritis and Cartilage",
|
||||
"DOI": "10.1016/j.joca.2022.03.012",
|
||||
"PMID": "35412345",
|
||||
"abstractNote": "OBJECTIVE: To evaluate the efficacy of PRP injections vs hyaluronic acid for symptomatic knee OA.",
|
||||
"collections": [
|
||||
"骨科"
|
||||
],
|
||||
"attachments": []
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
%PDF-1.4
|
||||
1 0 obj
|
||||
<< /Type /Catalog /Pages 2 0 R >>
|
||||
endobj
|
||||
2 0 obj
|
||||
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
|
||||
endobj
|
||||
3 0 obj
|
||||
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] >>
|
||||
endobj
|
||||
xref
|
||||
0 4
|
||||
0000000000 65535 f
|
||||
0000000009 00000 n
|
||||
0000000058 00000 n
|
||||
0000000115 00000 n
|
||||
trailer
|
||||
<< /Size 4 /Root 1 0 R >>
|
||||
startxref
|
||||
199
|
||||
%%EOF
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
%PDF-1.4
|
||||
1 0 obj
|
||||
<< /Type /Catalog /Pages 2 0 R >>
|
||||
endobj
|
||||
2 0 obj
|
||||
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
|
||||
endobj
|
||||
3 0 obj
|
||||
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] >>
|
||||
endobj
|
||||
xref
|
||||
0 4
|
||||
0000000000 65535 f
|
||||
0000000009 00000 n
|
||||
0000000058 00000 n
|
||||
0000000115 00000 n
|
||||
trailer
|
||||
<< /Size 4 /Root 1 0 R >>
|
||||
startxref
|
||||
199
|
||||
%%EOF
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
%PDF-1.4
|
||||
1 0 obj
|
||||
<< /Type /Catalog /Pages 2 0 R >>
|
||||
endobj
|
||||
2 0 obj
|
||||
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
|
||||
endobj
|
||||
3 0 obj
|
||||
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] >>
|
||||
endobj
|
||||
xref
|
||||
0 4
|
||||
0000000000 65535 f
|
||||
0000000009 00000 n
|
||||
0000000058 00000 n
|
||||
0000000115 00000 n
|
||||
trailer
|
||||
<< /Size 4 /Root 1 0 R >>
|
||||
startxref
|
||||
199
|
||||
%%EOF
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
%PDF-1.4
|
||||
1 0 obj
|
||||
<< /Type /Catalog /Pages 2 0 R >>
|
||||
endobj
|
||||
2 0 obj
|
||||
<< /Type /Pages /Kids [3 0 R] /Count 1 >>
|
||||
endobj
|
||||
3 0 obj
|
||||
<< /Type /Page /Parent 2 0 R /MediaBox [0 0 612 792] >>
|
||||
endobj
|
||||
xref
|
||||
0 4
|
||||
0000000000 65535 f
|
||||
0000000009 00000 n
|
||||
0000000058 00000 n
|
||||
0000000115 00000 n
|
||||
trailer
|
||||
<< /Size 4 /Root 1 0 R >>
|
||||
startxref
|
||||
199
|
||||
%%EOF
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
# Sandbox Vault
|
||||
|
||||
This is a completely sealed test vault for PaperForge Lite testing.
|
||||
Do not use with a real Obsidian vault.
|
||||
|
||||
- 5 mock papers across 2 domains (骨科, 运动医学)
|
||||
- 4 with PDFs, 1 without (no-pdf case)
|
||||
- paperforge.json configured with default paths
|
||||
- .env with dummy PaddleOCR credentials
|
||||
|
||||
Zotero storage: 99_System/Zotero/storage/
|
||||
BBT exports: 99_System/PaperForge/exports/
|
||||
Library records: 03_Resources/LiteratureControl/library-records/
|
||||
Literature notes: 03_Resources/Literature/
|
||||
Bases: 05_Bases/
|
||||
|
||||
DO NOT ADD REAL DATA HERE.
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
{
|
||||
"system_dir": "99_System",
|
||||
"resources_dir": "03_Resources",
|
||||
"literature_dir": "Literature",
|
||||
"control_dir": "LiteratureControl",
|
||||
"base_dir": "05_Bases"
|
||||
}
|
||||
Loading…
Reference in a new issue