From 74c8f7b2719344156880dafc2cbb2ef9ece2c0a3 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 19 Jul 2026 16:21:36 +0800 Subject: [PATCH] chore: name the extra after its dependency; keep README install section minimal --- README.md | 2 -- pageindex/index/utils.py | 2 +- pageindex/parser/pdf.py | 2 +- pyproject.toml | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index c6a1b48..5327af7 100644 --- a/README.md +++ b/README.md @@ -153,8 +153,6 @@ A unified `PageIndexClient` powers both local self-hosted and cloud-managed mode pip install pageindex ``` -Local-mode image extraction uses PyMuPDF (AGPL-licensed) and is an optional extra: `pip install "pageindex[images]"`. Without it, local indexing is text-only. - ### Quick start ```python diff --git a/pageindex/index/utils.py b/pageindex/index/utils.py index 08bde9e..5539ffd 100644 --- a/pageindex/index/utils.py +++ b/pageindex/index/utils.py @@ -816,7 +816,7 @@ def get_page_tokens(pdf_path, model=None, pdf_parser="PyPDF2"): page_list.append((page_text, token_length)) return page_list elif pdf_parser == "PyMuPDF": - import pymupdf # optional dependency: pip install pageindex[images] + import pymupdf # optional dependency: pip install pageindex[pymupdf] if isinstance(pdf_path, BytesIO): pdf_stream = pdf_path doc = pymupdf.open(stream=pdf_stream, filetype="pdf") diff --git a/pageindex/parser/pdf.py b/pageindex/parser/pdf.py index 12c6448..14d00d4 100644 --- a/pageindex/parser/pdf.py +++ b/pageindex/parser/pdf.py @@ -56,7 +56,7 @@ class PdfParser: if not _warned_no_pymupdf: logging.getLogger(__name__).warning( "PyMuPDF is not installed; skipping image extraction. " - 'Install with: pip install "pageindex[images]"') + 'Install with: pip install "pageindex[pymupdf]"') _warned_no_pymupdf = True return {} diff --git a/pyproject.toml b/pyproject.toml index 2c43030..4ecc1ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ typing-extensions = ">=4.9.0" pydantic = ">=2.5.0,<3.0.0" [tool.poetry.extras] -images = ["pymupdf"] +pymupdf = ["pymupdf"] [tool.poetry.group.dev.dependencies] pytest = ">=7.0"