Skip to content

Move interface names to allow separation of sync and async interfaces - #860

Open
kuhe wants to merge 5 commits into
developfrom
kuhe/chore/sync-renames
Open

kuhe wants to merge 5 commits into
developfrom
kuhe/chore/sync-renames

Conversation

@kuhe

@kuhe kuhe commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Move interface names to allow separation of sync and async interfaces.

This is the movement rule:

package/
  aio/file.py -> class AsyncWidget
  file.py -> class Widget

Anything that will have a sync/sync dual interface will exist at path + aio/path.
file.py (root) or some other file at the root will contain shared sync logic.

aio/file.py may import from file.py, but file.py will never import its aio partner.

Reviewers

The git diff shows added classes and deleted classes, but know that:

  • no logic was changed, these are all moves & renames that git is unable to untangle
  • no classes/fns were added except placeholders
  • no classes/fns were deleted

You only need to look at the names and file locations.

Furthermore, all placeholders are marked with the searchable string TODO(sync-api). There are 21 of these in this PR.

@kuhe
kuhe force-pushed the kuhe/chore/sync-renames branch 4 times, most recently from 7ab58e8 to ac075bb Compare October 22, 2026 14:47
@kuhe
kuhe marked this pull request as ready for review October 22, 2026 19:32
@kuhe
kuhe requested a review from a team as a code owner October 22, 2026 19:32
from typing import Protocol, TypedDict

from smithy_core.aio.interfaces.identity import IdentityResolver
from smithy_core.aio.interfaces.identity import AsyncIdentityResolver

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 still makes the root AWSCredentialsResolver depend on AsyncIdentityResolver. I think the async alias should live under aio.identity, with the root name reserved for sync

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

yes, moved

from typing import Any

from smithy_core.aio.interfaces.identity import IdentityResolver
from smithy_core.aio.interfaces.identity import AsyncIdentityResolver

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.

Same dependency direction issue here. Could this type avoid depending on either mode so the root package never imports from aio?

Comment on lines +10 to +13
"AwsConfigOverrides",
"DefaultFileSystem",
"FileSystem",
"SharedConfigContext",

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.

These are async-specific too- should they get Async names while we’re establishing the split?

@@ -0,0 +1,29 @@
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from .chain import IdentityChain

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.

IdentityChain and the resolver/provider classes are async too, but only AsyncStaticCredentialsResolver got renamed



class StandardRegionalEndpointsResolver(EndpointResolver):
class StandardRegionalEndpointsResolver(AsyncEndpointResolver):

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.

Should this be AsyncStandardRegionalEndpointsResolver so the unprefixed name stays available for the sync implementation?

from smithy_core.aio.interfaces.auth import EventSigner
from smithy_core.aio.interfaces.eventstream import EventPublisher, EventReceiver
from smithy_core.aio.interfaces.identity import IdentityResolver
from smithy_core.aio.interfaces.auth import AsyncEventSigner

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.

Can we get a changelog entry for this change too?

@kuhe
kuhe force-pushed the kuhe/chore/sync-renames branch from ac075bb to 4d4dc46 Compare October 23, 2026 14:51
kuhe added 4 commits October 23, 2026 17:38
- Place static/environment resolvers at root (sync, canonical) with aio
  Async-prefixed twins that delegate to the sync component; async imports
  sync, never the reverse.
- Retarget root identity.components.AWSCredentialsResolver and
  IdentityResolverFailure.resolver off aio (generic sync IdentityResolver /
  mode-neutral), removing the root->aio import inversion.
- Async-prefix the genuinely-async credential resolver/provider family
  (Container/IMDS/Process resolvers, IdentityChain, the 5 chain providers)
  reserving bare names for sync twins; update entry points.
- Rename aio config FileSystem/DefaultFileSystem/SharedConfigContext to
  Async*, and the public config functions to the _async suffix
  (load_config_async, parse_config_file_async).
- Rename StandardRegionalEndpointsResolver -> AsyncStandardRegionalEndpointsResolver.
- Update codegen symbols (AsyncIdentityChain, AsyncFileSystem,
  AsyncStandardRegionalEndpointsResolver), regenerate protocol-test goldens
  and the api-snapshot.
- Add smithy-aws-event-stream changelog fragment.
The aws-sdk-python integration-test harness (hand-written, not regenerated
by codegen) still imports HTTPClient from smithy_http.aio.interfaces, which
commit 1 renamed to AsyncHTTPClient. Restore the old name as an alias so the
downstream package tests pass; remove once the SDK harness is updated (see
TODO(sync-renames)).
The aws-sdk-python integration-test harness (hand-written) imports
DuplexEventStream/InputEventStream/OutputEventStream from
smithy_core.aio.eventstream, which commit 1 renamed to the Async* forms.
Restore the old names as aliases so the downstream package tests pass;
remove once the SDK harness is updated (see TODO(sync-renames)).
The shipped public path smithy_aws_core.identity.EnvironmentCredentialsResolver
is awaited by the async client pipeline, and aws-sdk-python's hand-written
integration harness imports it from there and passes it to an async client.
Re-export the async resolver under the bare name so that contract holds; the
sync twin stays at .environment. Marked TODO(sync-api) -- this re-export is the
pre-existing root->aio dependency the branch defers, to be repointed when the
SDK harness adopts an async-aware resolver.
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.

2 participants