aboutsummaryrefslogtreecommitdiffstats
path: root/build/scripts/build_info_gen.py
diff options
context:
space:
mode:
authorthegeorg <thegeorg@yandex-team.com>2023-07-19 14:57:19 +0300
committerthegeorg <thegeorg@yandex-team.com>2023-07-19 14:57:19 +0300
commit01afce99830cf704fa3cc78ff1f639becca0f0fc (patch)
treee89e18456b8c4068d40f4b62ae13c308186d5417 /build/scripts/build_info_gen.py
parent3bcd7593d0284b84d24683ba37a625e45343da67 (diff)
downloadydb-01afce99830cf704fa3cc78ff1f639becca0f0fc.tar.gz
Use black to style build/scripts
Diffstat (limited to 'build/scripts/build_info_gen.py')
-rw-r--r--build/scripts/build_info_gen.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/build/scripts/build_info_gen.py b/build/scripts/build_info_gen.py
index d250accb19..ba59e50ac6 100644
--- a/build/scripts/build_info_gen.py
+++ b/build/scripts/build_info_gen.py
@@ -44,8 +44,18 @@ def get_compiler_info(compiler):
compiler_ver_cmd.append('--version')
env = os.environ.copy()
env['LOCALE'] = 'C'
- compiler_ver_out = subprocess.Popen(compiler_ver_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env).stdout.read().decode('utf-8')
- return "\n".join(['{}{}'.format(indent * 2, line.strip()) for line in compiler_ver_out.splitlines() if line.strip()])
+ compiler_ver_out = (
+ subprocess.Popen(compiler_ver_cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env)
+ .stdout.read()
+ .decode('utf-8')
+ )
+ return "\n".join(
+ # fmt: off
+ f'{indent * 2}{line.strip()}'
+ for line in compiler_ver_out.splitlines()
+ if line.strip()
+ # fmt: on
+ )
def filterflags(flags_str):
@@ -64,6 +74,7 @@ def filterflags(flags_str):
if flag.split('=', 1)[0] in badflgs:
continue
yield flag
+
return ' '.join(flags_iter())
@@ -80,5 +91,6 @@ def main():
print(escaped_define("BUILD_COMPILER_VERSION", get_compiler_info(cxx_compiler)), file=result)
print(escaped_define("BUILD_COMPILER_FLAGS", cxx_flags), file=result)
+
if __name__ == "__main__":
main()