From 077d68f9ed21c1c9e67de0b46d1f17ff8e0d0942 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005287564 Date: Fri, 10 Nov 2023 03:05:36 -0800 Subject: [PATCH] [Codemod][python/main_function] antlir Reviewed By: zsol Differential Revision: D51190702 fbshipit-source-id: f385e85d36e83cd5fe87d40ee06b5f6403db85b4 --- .../dnf/snapshot/targets_from_upstream/BUCK | 2 +- .../snapshot/targets_from_upstream/targets_from_upstream.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/antlir/antlir2/package_managers/dnf/snapshot/targets_from_upstream/BUCK b/antlir/antlir2/package_managers/dnf/snapshot/targets_from_upstream/BUCK index 5a19a0d3607..dc6b5d71dcb 100644 --- a/antlir/antlir2/package_managers/dnf/snapshot/targets_from_upstream/BUCK +++ b/antlir/antlir2/package_managers/dnf/snapshot/targets_from_upstream/BUCK @@ -7,7 +7,7 @@ oncall("antlir_oss") python_binary( name = "targets-from-upstream", srcs = ["targets_from_upstream.py"], - main_module = "antlir.antlir2.package_managers.dnf.snapshot.targets_from_upstream.targets_from_upstream", + main_function = "antlir.antlir2.package_managers.dnf.snapshot.targets_from_upstream.targets_from_upstream.invoke_main", deps = [ third_party.library( "requests", diff --git a/antlir/antlir2/package_managers/dnf/snapshot/targets_from_upstream/targets_from_upstream.py b/antlir/antlir2/package_managers/dnf/snapshot/targets_from_upstream/targets_from_upstream.py index 8faf45cdb84..1a2f523d799 100644 --- a/antlir/antlir2/package_managers/dnf/snapshot/targets_from_upstream/targets_from_upstream.py +++ b/antlir/antlir2/package_managers/dnf/snapshot/targets_from_upstream/targets_from_upstream.py @@ -160,8 +160,12 @@ def main(args) -> None: f.write("\n") -if __name__ == "__main__": +def invoke_main() -> None: parser = argparse.ArgumentParser() parser.add_argument("--dst", type=Path) parser.add_argument("baseurls", nargs="+", type=urlparse) main(parser.parse_args()) + + +if __name__ == "__main__": + invoke_main() # pragma: no cover