From b511962a1f08ec65a7dc3ad509aa766d7226e847 Mon Sep 17 00:00:00 2001 From: Brett Williams Date: Wed, 12 Mar 2025 00:48:46 -0500 Subject: [PATCH] This works --- cross_py_builder/agent_manager.py | 10 +++++----- cross_py_builder/build_agent.py | 8 +++++--- setup.py | 2 +- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/cross_py_builder/agent_manager.py b/cross_py_builder/agent_manager.py index 6447685..2ba1f3f 100755 --- a/cross_py_builder/agent_manager.py +++ b/cross_py_builder/agent_manager.py @@ -13,8 +13,8 @@ import requests from packaging.version import Version from tabulate import tabulate -from build_agent import build_agent_version -from zeroconf_server import ZeroconfServer +from .build_agent import build_agent_version +from .zeroconf_server import ZeroconfServer DEFAULT_PORT = 9001 TIMEOUT = 10 @@ -32,9 +32,9 @@ def find_server_ips(): ZeroconfServer.stop() # get known hosts - with open("../known_hosts", "r") as file: - lines = file.readlines() - hostnames.extend(lines) + # with open("../known_hosts", "r") as file: + # lines = file.readlines() + # hostnames.extend(lines) return hostnames diff --git a/cross_py_builder/build_agent.py b/cross_py_builder/build_agent.py index ea5bd19..7a6e5f3 100755 --- a/cross_py_builder/build_agent.py +++ b/cross_py_builder/build_agent.py @@ -15,7 +15,7 @@ import glob import shutil import uuid import platform -from zeroconf_server import ZeroconfServer +from .zeroconf_server import ZeroconfServer APP_NAME = "cross_py_builder" build_agent_version = "0.1.34" @@ -394,8 +394,7 @@ def delete_cache(): return jsonify(job_cache()), 200 -if __name__ == "__main__": - +def main(): print(f"===== {APP_NAME} Build Agent (v{build_agent_version}) =====") ZeroconfServer.configure("_crosspybuilder._tcp.local.", socket.gethostname(), app_port) try: @@ -405,3 +404,6 @@ if __name__ == "__main__": pass finally: ZeroconfServer.stop() + +if __name__ == "__main__": + main() diff --git a/setup.py b/setup.py index 9995ef9..cdfa891 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( entry_points={ "console_scripts": [ "cross-py-agent=cross_py_builder.build_agent:main", - "cross_py_builder=cross_py_builder.agent_manager:main", + "cross-py-builder=cross_py_builder.agent_manager:main", ], }, author="Brett Williams",