Skip to content

Write Google style docstrings in generated clients - #981

Open
stobrien89 wants to merge 1 commit into
python-client-host-prefixfrom
python-client-google-docstrings
Open

stobrien89 wants to merge 1 commit into
python-client-host-prefixfrom
python-client-google-docstrings

Conversation

@stobrien89

Copy link
Copy Markdown
Contributor

Issue #, if available:

Stacked on #978.

Description of changes:

Generated client methods now use Google style docstrings, like the Java generator, since our docs rely on that style:

Args:
    plugins:
        Callables that change the configuration for this call only.

Returns:
    An instance of `AllQueryStringTypesOutput`.

This replaces the :param plugins: line, the only RST field the generator wrote. The endpoint_uri field doc also uses single backticks now. Model docs are unchanged. The runtime packages still use RST, which can move over separately.

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 23, 2026 17:29
@stobrien89
stobrien89 added this pull request to stack #972 November 23, 2026 17:41
writer,
# Google style sections, as in the Java generator. Each section line
# fits the docstring width, so wrapping keeps its indent.
(docs or f"Invokes the {operation.operation.id.name} operation.")

@arandito arandito Nov 23, 2026 •

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.

Are we converting the model docs format at some point? Generic smithy models use Commonmark so we can directly use those like this. However, AWS models use html so we'll need to convert them to markdown before writing them. We shouldn't force people to install pandoc like java codegen. Instead, we should probably write our own custom transformer or add a dependency that does it for us.

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.

yeah, right now the python generator just writes model docs as-is, so commonmark models are fine but aws html isn't converted yet. agree on no pandoc. I checked the aws models and they barely use any html: p, code, li, a, i, ul, b, note cover almost all of it, and most of the 175 "tags" are just placeholders like <region>. so a small converter in python seems totally doable. I'll do it as its own PR, not in this one

@stobrien89
stobrien89 force-pushed the python-client-google-docstrings branch from 864859c to d7a6a27 Compare November 23, 2026 18:02
arandito
arandito previously approved these changes Nov 23, 2026

@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.

:shipit:

@stobrien89
stobrien89 force-pushed the python-client-google-docstrings branch from 3805daf to 7ea262a Compare November 24, 2026 22:27
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