You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3ec3d04
Browse filesBrowse the repository at this point in the historyBrowse files
Send a roboflow-python User-Agent on every SDK request (#559)
* Add roboflow.util.http, which sends a roboflow-python User-Agent
The helpers wrap requests' get, post, put, patch, delete, head and request
and add `User-Agent: roboflow-python/<version>`; headers the caller passes
take precedence. `http.Session` is a requests.Session that sends the same
header.
`__version__` moves to the top of roboflow/__init__.py, so the helper can
read it while the package's own imports are still running.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Send every SDK request through roboflow.util.http
Every requests.<verb>(...) call in roboflow/, and the request functions the
Batch Processing adapters pass by reference, now calls the
roboflow.util.http helper of the same name. Workspace.search_export builds
its session with http.Session, and the two urllib image fetches in
roboflow.util.prediction send the header too.
ruff's banned-api (TID251) rejects requests.get, post, put, patch, delete,
head and request outside roboflow/util/http.py, so a new call can't skip the
header.
Tests that mocked roboflow.<module>.requests.<verb> now mock
roboflow.util.http.requests.<verb>, where the call happens, and the three
that compared the whole headers dict expect the User-Agent too. New tests
check the header end to end on Roboflow() -> workspace -> project -> version
and on an annotated image upload.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
0 commit comments