File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
codegen/core/src/main/java/software/amazon/smithy/python/codegen/generators Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change 66
77import java .nio .file .Path ;
88import java .nio .file .Paths ;
9+ import java .util .Set ;
910import java .util .stream .Collectors ;
1011import software .amazon .smithy .python .codegen .GenerationContext ;
1112import software .amazon .smithy .utils .SmithyInternalApi ;
1516 */
1617@ SmithyInternalApi
1718public final class InitGenerator implements Runnable {
19+ // Set of directories that need __init__.py files
20+ private static final Set <String > PACKAGE_DIRECTORIES = Set .of ("src" , "tests" );
1821
1922 private final GenerationContext context ;
2023
@@ -31,6 +34,7 @@ public void run() {
3134 .stream ()
3235 .map (Paths ::get )
3336 .filter (path -> !path .getParent ().equals (context .fileManifest ().getBaseDir ()))
37+ .filter (path -> PACKAGE_DIRECTORIES .contains (path .getName (0 ).toString ()))
3438 .collect (Collectors .groupingBy (Path ::getParent , Collectors .toSet ()));
3539 for (var entry : directories .entrySet ()) {
3640 var initPath = entry .getKey ().resolve ("__init__.py" );
You can’t perform that action at this time.
0 commit comments