Skip to content

Commit

Permalink
refactor(framework) Install app from .whl in FAB (#4479)
Browse files Browse the repository at this point in the history
Co-authored-by: Chong Shen Ng <[email protected]>
Co-authored-by: Daniel J. Beutel <[email protected]>
  • Loading branch information
3 people authored Nov 12, 2024
1 parent c490fa4 commit 8c82df5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/py/flwr/cli/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,23 +188,25 @@ def validate_and_install(
else:
shutil.copy2(item, install_dir / item.name)

whl_file = config["tool"]["flwr"]["app"]["whl"]
install_whl = install_dir / whl_file
try:
subprocess.run(
["pip", "install", "-e", install_dir, "--no-deps"],
["pip", "install", "--no-deps", install_whl],
capture_output=True,
text=True,
check=True,
)
except subprocess.CalledProcessError as e:
typer.secho(
f"❌ Failed to `pip install` package(s) from {install_dir}:\n{e.stderr}",
f"❌ Failed to install {project_name}:\n{e.stderr}",
fg=typer.colors.RED,
bold=True,
)
raise typer.Exit(code=1) from e

typer.secho(
f"🎊 Successfully installed {project_name} to {install_dir}.",
f"🎊 Successfully installed {project_name}.",
fg=typer.colors.GREEN,
bold=True,
)
Expand Down

0 comments on commit 8c82df5

Please sign in to comment.