From 360f1a03d9c725da8a044c58261452567a836673 Mon Sep 17 00:00:00 2001 From: henry Date: Mon, 9 Oct 2023 13:41:00 -0500 Subject: [PATCH] CI: use Ubuntu 22.04 for testing --- .../linux/shared/update_conan_compiler.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 ci/docker/linux/shared/update_conan_compiler.py diff --git a/ci/docker/linux/shared/update_conan_compiler.py b/ci/docker/linux/shared/update_conan_compiler.py new file mode 100644 index 0000000..928b523 --- /dev/null +++ b/ci/docker/linux/shared/update_conan_compiler.py @@ -0,0 +1,37 @@ +import argparse +import yaml + + +def get_arg_parser(): + parser = argparse.ArgumentParser() + parser.add_argument("settings_file") + parser.add_argument("compiler_name") + parser.add_argument("compiler_version") + return parser + + +def update_settings_file(settings_file, compiler_name, compiler_version): + with open(settings_file) as file: + data = yaml.safe_load(file) + if compiler_name not in data['compiler']: + raise ValueError(f"invalid compiler name: {compiler_name}") + + if compiler_version not in data['compiler'][compiler_name]['version']: + data['compiler'][compiler_name]['version'].append(compiler_version) + print("Compiler data added") + print(data['compiler'][compiler_name]['version']) + with open(settings_file, 'w') as file: + yaml.dump(data, file) + +def main(): + args = get_arg_parser().parse_args() + print(args) + update_settings_file( + args.settings_file, + args.compiler_name, + args.compiler_version + + ) + +if __name__ == '__main__': + main()