@@ -138,15 +138,17 @@ private static List<ConfigProperty> getHttpProperties(GenerationContext context)
138138 if (usesHttp2 (context )) {
139139 clientBuilder
140140 .initialize (writer -> {
141- writer .addDependency (SmithyPythonDependency .SMITHY_HTTP .withOptionalDependencies ("awscrt" ));
141+ writer .addDependency (SmithyPythonDependency .SMITHY_HTTP );
142+ writer .addDependency (SmithyPythonDependency .AWS_CRT );
142143 writer .addImport ("smithy_http.aio.crt" , "AWSCRTHTTPClient" );
143144 writer .write ("self.http_client = http_client or AWSCRTHTTPClient()" );
144145 });
145146
146147 } else {
147148 clientBuilder
148149 .initialize (writer -> {
149- writer .addDependency (SmithyPythonDependency .SMITHY_HTTP .withOptionalDependencies ("aiohttp" ));
150+ writer .addDependency (SmithyPythonDependency .SMITHY_HTTP );
151+ writer .addDependency (SmithyPythonDependency .AIO_HTTP );
150152 writer .addImport ("smithy_http.aio.aiohttp" , "AIOHTTPClient" );
151153 writer .write ("self.http_client = http_client or AIOHTTPClient()" );
152154 });
@@ -171,11 +173,12 @@ private static boolean usesHttp2(GenerationContext context) {
171173 return true ;
172174 }
173175
174- // Bidirectional streaming REQUIRES h2 inherently
176+ // enable CRT/http2 client if the service supports any event streams (single or bi-directional)
177+ // TODO: Long term, only bi-directional evenstreams strictly require h2
175178 var eventIndex = EventStreamIndex .of (context .model ());
176179 var topDownIndex = TopDownIndex .of (context .model ());
177180 for (OperationShape operation : topDownIndex .getContainedOperations (context .settings ().service ())) {
178- if (eventIndex .getInputInfo (operation ).isPresent () && eventIndex .getOutputInfo (operation ).isPresent ()) {
181+ if (eventIndex .getInputInfo (operation ).isPresent () || eventIndex .getOutputInfo (operation ).isPresent ()) {
179182 return true ;
180183 }
181184 }
0 commit comments