Skip to content

Commit

Permalink
Merge pull request #341 from OpenMined/yash/fixes
Browse files Browse the repository at this point in the history
de-bug report
  • Loading branch information
yashgorana authored Nov 6, 2024
2 parents adbfb8a + 65a41d8 commit bf6a394
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 10 deletions.
12 changes: 9 additions & 3 deletions syftbox/app/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
from syftbox.app.manager import install_app, list_app, uninstall_app
from syftbox.lib.lib import DEFAULT_CONFIG_PATH, ClientConfig

app = Typer(name="SyftBox Apps", pretty_exceptions_enable=False, no_args_is_help=True, help="Manage SyftBox apps")
app = Typer(
name="SyftBox Apps",
help="Manage SyftBox apps",
no_args_is_help=True,
pretty_exceptions_enable=False,
context_settings={"help_option_names": ["-h", "--help"]},
)
state = {"config": None}

CONFIG_OPTS = Option("-c", "--config", "--config-path", help="Path to the SyftBox config file")
CONFIG_OPTS = Option("-c", "--config", "--config_path", help="Path to the SyftBox config file")


@app.command()
Expand Down Expand Up @@ -54,7 +60,7 @@ def uninstall(
config = load_conf(config_path)
result = uninstall_app(app_name, config)
if not result:
rprint(f"App not found [bold]'{app_name}'[/bold]")
rprint(f"[bold red]Error:[/bold red] '{app_name}' app not found")
sys.exit(1)

rprint(f"Uninstalled app [bold]'{app_name}'[/bold] from {result}")
Expand Down
6 changes: 5 additions & 1 deletion syftbox/client/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@
from syftbox.client.utils.net import get_free_port, is_port_in_use
from syftbox.lib.lib import DEFAULT_CONFIG_PATH, DEFAULT_SERVER_URL, DEFAULT_SYNC_FOLDER

app = Typer(name="SyftBox Client", pretty_exceptions_enable=False)
app = Typer(
name="SyftBox Client",
pretty_exceptions_enable=False,
context_settings={"help_option_names": ["-h", "--help"]},
)

# Define options separately to keep the function signature clean
# fmt: off
Expand Down
10 changes: 7 additions & 3 deletions syftbox/lib/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,13 @@
def debug_report() -> str:
config_path = os.environ.get("SYFTBOX_CLIENT_CONFIG_PATH", DEFAULT_CONFIG_PATH)
client_config = None
apps = []
app_dir = None
try:
client_config = ClientConfig.load(config_path)
app_list = list_app(client_config)
result = list_app(client_config)
app_dir = str(result.apps_dir)
apps = [app.name for app in result.apps]
client_config = asdict(client_config)
del client_config["_server_client"]
except Exception:
Expand Down Expand Up @@ -43,8 +47,8 @@ def debug_report() -> str:
"command": syftbox_path or "syftbox executable not found in PATH",
"client_config_path": str(config_path),
"client_config": client_config,
"apps_dir": str(app_list.apps_dir),
"apps": app_list.apps,
"apps_dir": app_dir,
"apps": apps,
},
"syftbox_env": {key: value for key, value in os.environ.items() if key.startswith("SYFT")},
}
Expand Down
3 changes: 2 additions & 1 deletion syftbox/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@

app = Typer(
name="SyftBox",
no_args_is_help=True,
help="SyftBox CLI",
no_args_is_help=True,
pretty_exceptions_enable=False,
context_settings={"help_option_names": ["-h", "--help"]},
)


Expand Down
6 changes: 5 additions & 1 deletion syftbox/server/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@
from syftbox.client.cli import VERBOSE_OPTS
from syftbox.server.server import app as fastapi_app

app = Typer(name="SyftBox Server", pretty_exceptions_enable=False)
app = Typer(
name="SyftBox Server",
pretty_exceptions_enable=False,
context_settings={"help_option_names": ["-h", "--help"]},
)


# Define options separately to keep the function signature clean
Expand Down
2 changes: 1 addition & 1 deletion syftbox/server/templates/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ show_debug_and_exit() {
echo "Alias : $py"
echo "Version : $($py -V)"
echo "which : $(which $py)"
echo "python/[ip env vars"
echo "python env vars"
env | grep -E "(PYTHON|PIP)" || echo "-"
echo
info "Python Virtual Environment"
Expand Down

0 comments on commit bf6a394

Please sign in to comment.