Skip to content

Generate synchronous client APIs - #122

Merged
kuhe merged 6 commits into
developfrom
kuhe/chore/codegen/sync-api
Nov 10, 2026
Merged

kuhe merged 6 commits into
developfrom
kuhe/chore/codegen/sync-api

Conversation

@kuhe

@kuhe kuhe commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Bumps the version of smithy-python being targeted to latest, including BDD endpoints and sync client APIs.

  • regenerates clients, adds changelog fragments
  • update handwritten packages
  • internalize doc generation

Look at individual commits to filter out the large codegen diff.

@kuhe
kuhe force-pushed the kuhe/chore/codegen/sync-api branch 6 times, most recently from f89e6f9 to a6ac6ad Compare November 9, 2026 21:05
@kuhe
kuhe force-pushed the kuhe/chore/codegen/sync-api branch from a6ac6ad to 8fbc9c5 Compare November 9, 2026 21:40
@kuhe
kuhe marked this pull request as ready for review November 9, 2026 22:48
@kuhe
kuhe requested a review from a team as a code owner November 9, 2026 22:48

@AlexDaines AlexDaines left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aws-credentials-imds and aws-credentials-http still pin smithy-aws-core~=0.12.0 and use the old entry-point group, so they can't be installed with the new sts or any of the 25 clients (all ~=0.13.0). They also import IdentityResolver and HTTPClient, which 0.10 / 0.7 dropped. Is their migration planned, here or before the next release?

Also, the README, docs/index.md and the polly / transcribe-streaming examples still import Async* from <pkg>.client. Those moved to <pkg>.aio.

@arandito arandito left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To build on Alex, aws-credentials-sts only supports async clients in this PR. We should ensure all credential providers work in both modes before releasing.

@jonathan343 jonathan343 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me overall. We will need a follow up to get docs working and sync credential chain working

original_message: str | None = None
"""Original error message from the model."""
return globals().setdefault(name, operation)
return _registry.build(name)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an AI comment. Posting so I don't forget and can look into it sometime in the future


This registry pattern is shared across the generated clients. Resolving a union name through the new registry returns an unrelated marker class, while models.pyi still describes a union of the variant classes. For example:

from aws_sdk_bedrock_runtime.models import ContentBlock, ContentBlockText
isinstance(ContentBlockText(value="hi"), ContentBlock)

This returns True on the base and False on the PR. Likewise, typing.get_args(ContentBlock) now returns an empty tuple. Existing dispatch/validation code can silently change behavior even though it still type-checks. Could the public name resolve lazily to the actual union of the generated variants rather than the registry's marker class?

from .user_agent import aws_user_agent_plugin


logger = logging.getLogger(__name__)


class AsyncSageMakerRuntimeHTTP2Client(AsyncClient):
class SageMakerRuntimeHTTP2Client(Client[SageMakerRuntimeHTTP2Config]):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should either not generate this or throw an error in __init__ saying this client is only available in the async version

client_module = package.modules["client"]
config_module = package.modules["config"]
models_module = package.modules["models"]
client_module = package["aio.client"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need to be in this PR, but our team will need to follow up w/ a PR for documenting the sync clients as well. Just noting so we don't forget

@kuhe
kuhe merged commit 3a7dd19 into develop Nov 10, 2026
4 checks passed
@kuhe
kuhe deleted the kuhe/chore/codegen/sync-api branch November 10, 2026 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants