Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ private void writeSharedOperationInit(PythonWriter writer, OperationShape operat
writer.write("""
:param plugins: A list of callables that modify the configuration dynamically.
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).


});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.Set;
import java.util.stream.Collectors;
import software.amazon.smithy.python.codegen.GenerationContext;
import software.amazon.smithy.utils.SmithyInternalApi;
Expand All @@ -15,6 +16,8 @@
*/
@SmithyInternalApi
public final class InitGenerator implements Runnable {
// Set of directories that need __init__.py files
private static final Set<String> PACKAGE_DIRECTORIES = Set.of("src", "tests");

private final GenerationContext context;

Expand All @@ -31,6 +34,7 @@ public void run() {
.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?

.collect(Collectors.groupingBy(Path::getParent, Collectors.toSet()));
for (var entry : directories.entrySet()) {
var initPath = entry.getKey().resolve("__init__.py");
Expand Down
Loading