Skip to content

Generate endpoint BDDs for Python clients - #959

Merged
stobrien89 merged 3 commits into
python-client-rpcv2-jsonfrom
python-client-endpoint-rules
Nov 17, 2026
Merged

stobrien89 merged 3 commits into
python-client-rpcv2-jsonfrom
python-client-endpoint-rules

Conversation

@stobrien89

@stobrien89 stobrien89 commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Issue #, if available:

Stacked on #957.

Description of changes:

Python clients now resolve endpoints from the service's endpointBdd trait. Before, the generator rejected any service with endpoint rules.

  • _endpoints.py lowers the trait into _private/endpoints.py. It's a port of the Java EndpointBddGenerator, and the output matches Java byte for byte on all 435 AWS models that carry the trait.
  • The config defaults to BddEndpointResolver(BDD). Each clientContextParams entry becomes a str | None or bool | None config field.
  • Services with no rules get the default manual-endpoint BDD, the same one Java uses.
  • Generation fails on:
    • a service with endpointRuleSet and no endpointBdd (compiling a ruleset needs Smithy's CompileBdd)
    • rules that call non-standard functions such as aws.partition
  • Schemas now keep contextParam, staticContextParams and operationContextParams, which the runtime parameter plan reads. This replaces the stale endpointBdd entry and matches Java.
  • Each endpointTests case becomes a test in tests/test_endpoints.py, using the same layout as Java. Each case gets a rules test, and each operation input also gets a client test that calls the async client. Nested input values are written as dicts instead of models. A case the client can't express is skipped, with the reason.
    • There's a new endpoint-rules-client snapshot. Its source is models/endpoint-rules.smithy, assembled and BDD-compiled by Smithy. The snapshot tests run its generated tests: 14 pass and 1 is skipped (an AWS::Region case).
    • The emitter produces valid test modules for all 435 AWS models. Their only skips are AWS built-ins, which have no config fields yet.
  • Generated pins are bumped to smithy-core ~=0.13.0 and smithy-http ~=0.10.0.

The client snapshots are regenerated, and the protocol vectors still pass.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@stobrien89
stobrien89 requested a review from a team as a code owner November 17, 2026 18:59
@stobrien89
stobrien89 added this pull request to stack #958 November 17, 2026 19:00
@stobrien89
stobrien89 merged commit 56b744e into develop Nov 17, 2026
26 checks passed
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