AOSSIE-Org / AOSSIE-Org/PictoPy

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

Aperta Adatta ai principianti
#1,533 2 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug enhancement
Lingua principale
Python
Stelle
284
Fork
680
Merge medio
7g 5h
PR unite (30g)
4

Descrizione

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.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Start with backend/app/utils/API.py and reproduce the clean-environment failure using backend/requirements.txt, then inspect PictoPy.spec and the existing httpx entry. Run pytest tests/test_folders.py to confirm the import problem and use the project’s dependency and packaging configuration to decide which supported approach fits. Done means dependency installation and packaging no longer leave the API utility import unresolved.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
backend, build-system, testing
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
72/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.