@@ -335,52 +335,16 @@ def fix_hermetic(relative_dir, hide_output=False):
335335 )
336336
337337
338- def compile_protos (hide_output = False , is_esm = False ):
339- """
340- Compiles protos into .json, .js, and .d.ts files using
341- compileProtos script from google-gax.
342- """
343- logger .debug ("Compiling protos..." )
344- command = (
345- ["npx" , "compileProtos" , "src" ]
346- if not is_esm
347- else ["npx" , "compileProtos" , "esm/src" , "--esm" ]
348- )
349- shell .run (command , hide_output = hide_output )
350-
351-
352- def compile_protos_hermetic (relative_dir , is_esm = False , hide_output = False ):
353- """
354- Compiles protos into .json, .js, and .d.ts files using
355- compileProtos script from google-gax. Assumes that compileProtos
356- is already installed in a well known location on disk (node_modules/.bin).
357- """
358- logger .debug ("Compiling protos..." )
359- command = (
360- [f"{ _TOOLS_DIRECTORY } /node_modules/.bin/compileProtos" , "esm/src" , "--esm" ]
361- if not is_esm
362- else [f"{ _TOOLS_DIRECTORY } /node_modules/.bin/compileProtos" , "esm/src" , "--esm" ]
363- )
364- shell .run (
365- command ,
366- cwd = relative_dir ,
367- check = True ,
368- hide_output = hide_output ,
369- )
370-
371-
372338def postprocess_gapic_library (hide_output = False , is_esm = False ):
373339 logger .debug ("Post-processing GAPIC library..." )
374340 install (hide_output = hide_output )
375341 fix (hide_output = hide_output )
376- compile_protos (hide_output = hide_output , is_esm = is_esm )
377342 logger .debug ("Post-processing completed" )
378343
379344
380345def postprocess_gapic_library_hermetic (relative_dir , hide_output = False , is_esm = False ):
381346 logger .debug ("Post-processing GAPIC library..." )
382347 fix_hermetic (relative_dir , hide_output = hide_output )
383- compile_protos_hermetic (relative_dir , hide_output = hide_output , is_esm = is_esm )
384348 logger .debug ("Post-processing completed" )
385349
386350
0 commit comments