Skip to content

BUG: Missing 'requests' in requirements.txt causes ModuleNotFoundError in API utils #1533

Description

@sm-daniyal

In backend/app/utils/API.py, line 1 imports requests:
import requests
from app.config.settings import SYNC_MICROSERVICE_URL
However, requests is neither listed in backend/requirements.txt nor in PyInstaller's PictoPy.spec hiddenimports.
As a result, running tests (such as tests/test_folders.py) or invoking backend functions that trigger sync microservice restarts on a clean virtual environment fails with:
ModuleNotFoundError: No module named 'requests'

Steps to Reproduce

Set up a fresh virtual environment.
Install dependencies using pip install -r backend/requirements.txt.
Run pytest tests/test_folders.py.
Observe test collection failure due to ModuleNotFoundError: No module named 'requests'.

Proposed Solution

Since the project already standardizes on httpx (pinned in requirements.txt:73 and bundled in PictoPy.spec), we can either:
Refactor app/utils/API.py to use httpx.post() to keep dependencies minimal and consistent with the rest of the backend (similar to model_downloader.py).
Or explicitly add requests to requirements.txt and PictoPy.spec.
I've verified this locally and would love to be assigned to submit a clean PR with unit test coverage.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions