Skip to content

Conversation

@arandito
Copy link
Contributor

@arandito arandito commented Nov 4, 2025

Description

This PR removes __init__.py file generation in non-package directories such as docs/*.

Examples

Bedrock Runtime

Before:

docs
├── client
│   ├── __init__.py
│   ├── apply_guardrail.rst
│   └── ...
├── models
│   ├── __init__.py
│   ├── AccessDeniedException.rst
│   └── ...

After:

docs
├── client
│   ├── apply_guardrail.rst
│   └── ...
├── models
│   ├── AccessDeniedException.rst
│   └── ...

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

@arandito arandito requested a review from a team as a code owner November 4, 2025 16:46
.stream()
.map(Paths::get)
.filter(path -> !path.getParent().equals(context.fileManifest().getBaseDir()))
.filter(path -> PACKAGE_DIRECTORIES.contains(path.getName(0).toString()))
Copy link
Contributor

@nateprewitt nateprewitt Nov 4, 2025

Choose a reason for hiding this comment

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

path.getName(0) in this case is always the first path part rather than a qualified path? e.g. src and not /src or aws-sdk-bedrock-runtime/src?

Changes made by these plugins only apply for the duration of the operation
execution and will not affect any other operation invocations.
""");
execution and will not affect any other operation invocations.""");
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems a little strange for the fix. Is it because this adds the newline we need but our actual writer is also always appending a newline so we get two? I think this issue was affecting multiple places. I wonder if we should be doing something more like trimming extra newlines from the end of the final docstring (or not appending them to the end).

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