Repository navigation
Release 0.3.0: unwrap(unexpected_status_type=), SHELLRENT_TOKEN_CACHE in FileTokenStore, updated spec - #3
Merged
Conversation
- per_page defaults to 15 instead of 20 in the 56 list operations, as in the API. - list_active_monitoring_products and list_private_cloud_sv_products return ServicePaginatedListResponse, list_cloud_vps_products and list_dedicated_server_products the new ServiceServerPaginatedListResponse, with PaginationMeta as meta. - ServiceListResponse, ServiceServerListResponse and their MetaType0 models are removed: an incompatible change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…TokenStore - unwrap() takes the UnexpectedStatus class of another generated client, so that shellrent-internal-sdk raises its own exception instead of the one of shellrent_sdk.client. The default is unchanged. - FileTokenStore() without a directory follows SHELLRENT_TOKEN_CACHE: a directory, or "off" to keep the tokens in memory. The CLI now uses it, with the same behaviour. - Released as 0.3.0, not 0.2.1: the regenerated client removes models. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
shellrent-internal-sdkrevealed two gaps in this package. This PR also brings in the latest copy of the Shellrent API specification.unwrap(response, *, error_type=None, unexpected_status_type=None): every generated client has its ownUnexpectedStatusclass. Another client now passes its own, sounwrap()raises the same exception as that client's generated functions. Without the parameter it still raises theUnexpectedStatusofshellrent_sdk.client, so existing calls keep working. The type isCallable[[int, bytes], Exception], so mypy checks the constructor.FileTokenStore()without a directory now readsSHELLRENT_TOKEN_CACHE, like the CLI does: a directory, oroffto keep the tokens in memory without writing any file. A directory passed as an argument still wins. The CLI now usesFileTokenStore()directly, so both have one implementation and its behaviour is unchanged.spec/openapi.yamlupdated to the latest version and the client regenerated withbin/generate:per_pagedefaults to 15 instead of 20 in the 56 list operations.list_active_monitoring_productsandlist_private_cloud_sv_productsreturnServicePaginatedListResponse.list_cloud_vps_productsandlist_dedicated_server_productsreturn the newServiceServerPaginatedListResponse. In all four,metais aPaginationMeta.ServiceListResponse,ServiceServerListResponseand their*MetaType0models are removed.CLAUDE.md(unexpected_status_typeadded to the interface used byshellrent-internal-sdk) andCHANGELOG.md, with a[0.3.0]section.Notes for reviewers
CLAUDE.mdthat is an incompatible change, and with a patch release anyone pinned to~=0.2.0would pick up the removals.per_pagedefault now receives 15 items per page instead of 20.SHELLRENT_TOKEN_CACHE=off,FileTokenStore.directoryis still the default directory, although no file is written there. This keeps the attribute's type (Path) the same.offtoo, so the behaviour does not depend on the environment.Test plan
tests/unit/test_errors.py: another client'sUnexpectedStatusfor an undocumented status, for a 2xx without a parsed body and for a parsed body outside 2xx. Withoutunexpected_status_type, the exception is this package's, as in 0.2.0. It is also the default with this package's own types.tests/unit/test_token_store.py: directory from the environment, an explicit directory winning over it,off(any case) keeping the tokens in memory without files and not sharing them with other instances, andOAuth2Authwithoff. The default-directory test now clears the variable.tests/unit/test_client.py: the default ofper_pageis 15.ruff format,ruff check,mypy,pytest(130 passed, 3 integration tests skipped without credentials)--resolution lowest-directbin/generaterun again gives no diff🤖 Generated with Claude Code