diff --git a/src/python/grpcio_sleuth/setup.py b/src/python/grpcio_sleuth/setup.py index 1bb8334c4fa28..196cfefb7de86 100644 --- a/src/python/grpcio_sleuth/setup.py +++ b/src/python/grpcio_sleuth/setup.py @@ -50,18 +50,24 @@ class custom_build_ext(build_ext): def run(self): # Discover the compiler. - compiler_path = shutil.which('gcc') or shutil.which('clang') or shutil.which('cc') + compiler_path = ( + shutil.which("gcc") or shutil.which("clang") or shutil.which("cc") + ) bazel_env = os.environ.copy() if compiler_path: print(f"Setting CC={compiler_path} for Bazel build") - bazel_env['CC'] = compiler_path + bazel_env["CC"] = compiler_path else: - print("Warning: Could not find C compiler (gcc, clang, or cc) in PATH for Bazel") + print( + "Warning: Could not find C compiler (gcc, clang, or cc) in PATH for Bazel" + ) # Run the bazel build command bazel_cmd = [_BAZEL_PATH, "build", "//test/cpp/sleuth:sleuth.so"] print(f"Running command: {' '.join(bazel_cmd)}") - result = subprocess.run(bazel_cmd, cwd=GRPC_ROOT, check=False, env=bazel_env) + result = subprocess.run( + bazel_cmd, cwd=GRPC_ROOT, check=False, env=bazel_env + ) if result.returncode != 0: print("Bazel build failed!") sys.exit(result.returncode)