Skip to content

fix(deps): add missing requests-toolbelt dependency to pyproject.toml#273

Open
verseon0980 wants to merge 1 commit intoOpenGradient:mainfrom
verseon0980:fix/missing-requests-toolbelt-dependency
Open

fix(deps): add missing requests-toolbelt dependency to pyproject.toml#273
verseon0980 wants to merge 1 commit intoOpenGradient:mainfrom
verseon0980:fix/missing-requests-toolbelt-dependency

Conversation

@verseon0980
Copy link
Copy Markdown

Problem

requests-toolbelt is imported at the top level of
src/opengradient/client/model_hub.py:

from requests_toolbelt import MultipartEncoder

This file is imported by client/__init__.py, which is imported by
opengradient/__init__.py. This means the very first line of any
user code:

import opengradient as og

crashes immediately on a clean install with:

ImportError: No module named 'requests_toolbelt'

requests-toolbelt is not listed anywhere in the dependencies
section of pyproject.toml. So pip install opengradient does not
install it. The entire SDK is broken for any user who installs it in
a fresh environment.

Affected files:

  • src/opengradient/client/model_hub.py (line 9)
  • pyproject.toml (dependencies section)

Fix

Added requests-toolbelt>=0.9.1 to the dependencies list in
pyproject.toml. This ensures it is installed automatically whenever
a user runs pip install opengradient.

No code changes needed. The import in model_hub.py is correct.
Only the dependency declaration was missing.

Changes

  • pyproject.toml: added "requests-toolbelt>=0.9.1" to the
    dependencies list under [project]

Signed-off-by: verseon0980 <klokrc74@gmail.com>
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