Skip to content

Commit 46cd8c5

Browse files
dex0shubhamclaude
andauthored
build: declare directly-imported deps, drop the dead root eval extra (#208)
Follow-up to #197, from auditing every module-level third-party import in the shipped packages against what the extras declare. Three of them were not declared where their importer lives. **aiohttp — a real break, not tidying.** zim_server_async.py does `from aiohttp import web` at module scope, but aiohttp was declared only in the root `eval` extra. So the documented invocation in its own docstring (`python -m pixelrag_serve.zim_server_async --zim ... --port`) failed after `pip install 'pixelrag[kiwix]'`: File ".../pixelrag_serve/zim_server_async.py", line 16, in <module> from aiohttp import web ModuleNotFoundError: No module named 'aiohttp' It belongs with libzim in `kiwix`: that module imports both, and the sync zim_server.py needs only libzim, so `[kiwix]` now covers both servers. **botocore.** index/distributed.py imports botocore.exceptions directly while only boto3 was declared. boto3 always pulls botocore in, so nothing was broken — but a direct import belongs in the declaration. **pandas (eval/).** eval/lib/benchmarks.py and simpleqa_data.py import pandas directly; it reached eval's venv only transitively through datasets. Declared in eval/pyproject.toml, where those files live. **Dropped the root `eval` extra.** Nothing in the repo references `pixelrag[eval]` or `--extra eval`, and it could not run the harness anyway: eval imports requests and tqdm at module scope and the extra listed neither. eval/ is its own uv project (pixelrag-repro) and eval/README documents `uv sync --frozen` from inside it, so the extra was a stale duplicate — and the only place aiohttp was declared, which is how the gap above hid. It is a user-facing removal of an extra that never worked. Verified per extra in fresh `uv run --isolated` envs: `[kiwix]` now imports zim_server_async cleanly (it raised ModuleNotFoundError on main), `[distributed]` imports index/distributed.py, and the suite is 298 passed / 2 skipped. The other extras are backed by real imports and untouched — playwright (strategies/connection.py), pdf (pdf2image in backends/pdf.py), qdrant, embed, serve, gpu. Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
1 parent 08456eb commit 46cd8c5

4 files changed

Lines changed: 33 additions & 565 deletions

File tree

‎eval/pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ dependencies = [
3131
# run_monaco.py's Claude grader/reader. Lives here rather than in the root
3232
# package's core deps, where nothing imported it (#197).
3333
"anthropic>=0.102.0",
34+
"pandas>=2.0",
3435
]
3536

3637
[project.optional-dependencies]

‎eval/uv.lock‎

Lines changed: 20 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎pyproject.toml‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52,17 +52,13 @@ all = ["pixelrag[embed,serve,index,qdrant]"]
5252
gpu = ["faiss-gpu-cu12>=1.13.2; sys_platform == 'linux'"]
5353
playwright = ["playwright>=1.40.0"]
5454
pdf = ["pdf2image>=1.16.0"]
55-
kiwix = ["libzim>=3.6.0"]
56-
distributed = ["boto3>=1.42.0"]
57-
eval = [
58-
"pandas>=2.0",
59-
"Pillow>=10.0",
60-
"trafilatura>=1.6",
61-
"openai>=1.0",
62-
"aiohttp>=3.9",
63-
"datasets>=2.14",
64-
"huggingface-hub>=0.20",
65-
]
55+
# zim_server_async.py imports both of these at module scope; aiohttp was only
56+
# declared in the (now removed) root `eval` extra, so `pip install pixelrag[kiwix]`
57+
# could not run it.
58+
kiwix = ["libzim>=3.6.0", "aiohttp>=3.9"]
59+
# distributed.py imports botocore.exceptions directly; boto3 happens to pull it in,
60+
# but a direct import belongs in the declaration.
61+
distributed = ["boto3>=1.42.0", "botocore>=1.31.0"]
6662
# Everything tests/ needs, torch-free. The serve-side deps are listed one by one
6763
# rather than as `pixelrag[serve]` on purpose: that extra pulls torch,
6864
# torchvision and transformers, which the tests never touch — api.py imports them

0 commit comments

Comments
 (0)