Skip to content

Declare httpx as a runtime dependency - #425

Merged
lstein merged 1 commit into
masterfrom
lstein/fix/declare-httpx-dependency
Oct 22, 2026
Merged

lstein merged 1 commit into
masterfrom
lstein/fix/declare-httpx-dependency

Conversation

@lstein

@lstein lstein commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Problem

A freshly built photomapai-demo Docker image fails at startup:

ModuleNotFoundError: No module named 'httpx'

photomap/backend/routers/invoke.py and photomap/backend/invokeai_client.py import httpx at module level, but httpx was declared only in the testing extra. It was available by accident: transformers / open_clip_torch → huggingface_hub 1.x depended on httpx. huggingface_hub 2.x depends on httpx2 instead, so any fresh resolve (Docker builds, pip install photomapai) now omits httpx.

The full photomapai image only appeared to work because the existing one was built in Dec 2025, before huggingface_hub 2.x; rebuilding it today fails the same way. uv sync dev installs were unaffected because they install the testing extra.

Fix

Add httpx to [project].dependencies and refresh uv.lock.

Verification

uv pip compile of pyproject.toml with no extras (Python 3.11, CPU torch index, as in the Dockerfiles) now resolves:

httpx==0.28.1            # via photomapai (pyproject.toml)
httpx2==2.16.0           # via huggingface-hub
huggingface-hub==2.2.0

Inspecting the failing demo image confirmed huggingface_hub 2.2.0 + httpx2 and no httpx. Docker images not rebuilt as part of this PR.

Worth a patch release, since PyPI installs are affected too.

🤖 Generated with Claude Code

routers/invoke.py and invokeai_client.py import httpx at module level, but
httpx was only listed under the testing extra. It arrived transitively via
huggingface_hub 1.x; huggingface_hub 2.x depends on httpx2 instead, so fresh
installs (e.g. the rebuilt demo Docker image) fail at startup with
ModuleNotFoundError: No module named 'httpx'.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lstein
lstein merged commit 6b924a8 into master Oct 22, 2026
10 checks passed
@lstein
lstein deleted the lstein/fix/declare-httpx-dependency branch October 22, 2026 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant