Skip to content

[BUG] ImportError risk: run_in_threadpool from starlette.concurrency may not be available in all environments #374

@Binilkks

Description

@Binilkks

Describe the bug
The code imports run_in_threadpool from starlette.concurrency, but this import may fail or be unavailable in some environments or with older Starlette versions.

To Reproduce
Steps to reproduce the behavior:
Use a version of Starlette that does not provide run_in_threadpool.
Run the code or tests.
Observe an ImportError at startup or during execution.

Expected behavior
The code should either:

Check for the presence of run_in_threadpool and provide a fallback, or
Clearly document the minimum required Starlette version in requirements and documentation.

Screenshots
If applicable, add screenshots to help explain your problem.

Environment:

  • OS: macOS
  • FastAPI Utils version : 0.8.0
    Starlette version: 0.50.0
import fastapi_utils
import fastapi
import pydantic.utils
print(fastapi_utils.__version__)
print(fastapi.__version__)
print(pydantic.utils.version_info())
  • Python version, get it with:
python --version

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions