From 52e34ef51168b12b4c12781bc32704803734b4c5 Mon Sep 17 00:00:00 2001 From: VsevolodX <79542055+VsevolodX@users.noreply.github.com> Date: Tue, 16 Jul 2024 18:15:13 -0700 Subject: [PATCH] update: add main --- src/py/mat3ra/utils/wheel_server.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/py/mat3ra/utils/wheel_server.py b/src/py/mat3ra/utils/wheel_server.py index c8e8fb3..9491d51 100644 --- a/src/py/mat3ra/utils/wheel_server.py +++ b/src/py/mat3ra/utils/wheel_server.py @@ -41,7 +41,7 @@ def inform_user(port): print(f"import micropip\nawait micropip.install('{url_str}')\n") -if __name__ == "__main__": +def main(): parser = argparse.ArgumentParser(description="Python wheel server.") parser.add_argument("--port", type=int, default=8080, help="Port to run the server on.") parser.add_argument("--dir", type=str, default="./dist", help="Directory to serve.") @@ -60,3 +60,7 @@ def inform_user(port): print(f"Serving at http://{bind_addr}:{port}") inform_user(port) httpd.serve_forever() + + +if __name__ == "__main__": + main()