Feature/improved api client#29
Draft
dylanburkey wants to merge 9 commits intogame-by-virtuals:mainfrom
Draft
Conversation
dylanburkey
commented
Jan 28, 2025
Contributor
Author
dylanburkey
left a comment
There was a problem hiding this comment.
The changes in this PR
## Authentication:
- api.py: Uses token-based auth with separate token endpoint
- api_v2.py: Uses direct API key authentication
- api_client.py: Uses Bearer token authentication with better session management
## Error Handling:
- api.py: Basic error handling with ValueError
- api_v2.py: Similar basic error handling
- api_client.py: Advanced error handling with custom exceptions and retries
## Code Organization:
- api.py: Basic class structure
- api_v2.py: Improved structure with better typing
- api_client.py: Full modern Python class with proper documentation, typing, and organization
Contributor
There was a problem hiding this comment.
I'm not sure if we need this, given that we have a pyproject.toml
There was a problem hiding this comment.
pyproject.toml is for abstract dependencies. requirements.txt and requirements-dev.txt are for pinned dependencies.
Reference:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR introduces a new
GameAPIClientclass that improves error handling and implements smart retry logic for the GAME SDK. The changes make the SDK more resilient to transient failures while providing clearer error messages to users.Key Changes
GameAPIClientclass with comprehensive error handlingTesting
Impact
These changes will improve the SDK's reliability by: