mirror of
https://github.com/VectifyAI/PageIndex.git
synced 2026-07-24 21:41:04 +02:00
chore: drop the pymupdf extra — image extraction detects the library at runtime
This commit is contained in:
parent
36202a6029
commit
5fc1b81c62
3 changed files with 2 additions and 7 deletions
|
|
@ -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[pymupdf]
|
||||
import pymupdf # optional dependency
|
||||
if isinstance(pdf_path, BytesIO):
|
||||
pdf_stream = pdf_path
|
||||
doc = pymupdf.open(stream=pdf_stream, filetype="pdf")
|
||||
|
|
|
|||
|
|
@ -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[pymupdf]"')
|
||||
"Install with: pip install pymupdf")
|
||||
_warned_no_pymupdf = True
|
||||
return {}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ packages = [{include = "pageindex"}]
|
|||
[tool.poetry.dependencies]
|
||||
python = ">=3.10"
|
||||
litellm = ">=1.83.0"
|
||||
# AGPL-licensed; optional so the default install stays permissively licensed.
|
||||
pymupdf = {version = ">=1.26.0", optional = true}
|
||||
PyPDF2 = ">=3.0.0"
|
||||
python-dotenv = ">=1.0.0"
|
||||
pyyaml = ">=6.0"
|
||||
|
|
@ -34,9 +32,6 @@ httpx = {extras = ["socks"], version = ">=0.28.1"}
|
|||
typing-extensions = ">=4.9.0"
|
||||
pydantic = ">=2.5.0,<3.0.0"
|
||||
|
||||
[tool.poetry.extras]
|
||||
pymupdf = ["pymupdf"]
|
||||
|
||||
[tool.poetry.group.dev.dependencies]
|
||||
pytest = ">=7.0"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue