fix: update pip installs from GitHub source instead of package index

This commit is contained in:
Research Assistant 2026-04-29 00:16:13 +08:00
parent 6394043441
commit 6b567d004f
2 changed files with 3 additions and 2 deletions

View file

@ -166,7 +166,7 @@ At minimum, back up these directories:
```bash
# If installed via pip
pip install --upgrade paperforge
pip install --upgrade git+https://github.com/LLLin000/PaperForge.git
# If installed via git (editable install)
cd "你的Vault路径"

View file

@ -21,6 +21,7 @@ from paperforge.worker._utils import (
from paperforge.worker.status import GITHUB_REPO, GITHUB_ZIP, UPDATEABLE_PATHS
logger = logging.getLogger(__name__)
GITHUB_PIP_SOURCE = f"git+https://github.com/{GITHUB_REPO}.git"
def protected_paths(vault: Path) -> set[str]:
@ -146,7 +147,7 @@ def _update_via_pip(editable: bool = False) -> bool:
cmd.extend(["-e", "."])
else:
cmd.append("--upgrade")
cmd.append("paperforge")
cmd.append(GITHUB_PIP_SOURCE)
logger.info("执行: %s", " ".join(cmd))
r = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8")