Share YOLO login with the SDK and automatically release generator updates - #56
Conversation
|
👋 Hello @glenn-jocher, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Reviewed all 9 changed files, including credential resolution, generated-client wiring, and CI version synchronization. I found no concrete correctness, compatibility, security, or performance issue in the diff. LGTM.
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
🔍 PR Review 2
Made with ❤️ by Ultralytics Actions
Since review 1, the credential-resolution and generator version-sync changes remain consistent, with no newly introduced or still-open concrete defects found in the current diff. LGTM.
|
🎉 The PR has been merged—thank you, @glenn-jocher!
This update brings together smoother SDK authentication through saved |
A user who has run
yolo logincurrently has to provide the same key again to the standalone SDK. Keep Ultralytics credential discovery in the SDK-ownedauth.py, included in both clients through the converter's optionalpython.authProviderhook. Explicit credentials override the environment, which overrides the saved login; an explicit empty string disables authentication. Logout affects newly created clients, and the SDK reads settings without importing the ML package or writing a second credential store.The existing daily synchronization already follows the live API contract and
ultralytics/openapimain. Generator-only updates previously retained the published version, so they could merge without reaching PyPI. Extend that workflow to increment the existing Python version override as a post-release only when generated output changes at the same version, and remove the override when the API contract version advances. Unchanged reruns produce no release. This also releases shared authentication as0.1.31.post1without changing the API contract.Generated output depends on ultralytics/openapi#48, which removes application-specific policy from the converter. No generated files are maintained manually, and no new release workflow or generator version option is introduced. The additions above the usual 50-line threshold consist of the SDK-owned credential provider, its reproducible generated copy, and version handling in the existing synchronization owner; they cover separate required runtime and publication behavior without duplicate stores or test scaffolding. A consumer source file is necessary because the existing package directory is generated; storing the policy there directly would lose it on regeneration.
Validation: existing SDK suite on Python 3.11 and 3.14, Ruff, package build; actual published and current-main
yolo login/logoutwith both clients over local HTTP using isolated settings and dummy credentials; explicit/environment/saved precedence, anonymous opt-out, malformed settings, read-only settings, and no ML imports. Executed the actual workflow steps with real generation for unchanged output, an SDK-only update and repeat, and a new contract version and repeat. All passed.🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
The SDK now reuses credentials saved by
yolo loginand automatically creates post-release versions for generator-only updates.📊 Key Changes
authProviderhook, reading existing Ultralytics settings without importing the ML package or maintaining a separate credential store.api_key,ULTRALYTICS_API_KEY, then the saved login; an explicit empty string disables authentication.yolo login,yolo logout, anonymous authentication, and supported settings directories..postversion when generated output changes without an API contract version change, clear the override for new contract versions, and skip unchanged reruns.0.1.31.post1.🎯 Purpose & Impact
yolo logincan create either SDK client without supplying the key again, while explicit credentials and environment variables retain precedence.