diff --git a/pyproject.toml b/pyproject.toml index 2b789fc3d623..ac1f5b93cb6c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -74,6 +74,7 @@ typer = "^0.12.5" tomli = "^2.0.1" tomli-w = "^1.0.0" pathspec = "^0.12.1" +hatchling = "^1.25.0" # Optional dependencies (Simulation Engine) ray = { version = "==2.10.0", optional = true, python = ">=3.9,<3.12" } # Optional dependencies (REST transport layer) diff --git a/src/py/flwr/cli/install.py b/src/py/flwr/cli/install.py index 7451aa3d2326..6afa42000787 100644 --- a/src/py/flwr/cli/install.py +++ b/src/py/flwr/cli/install.py @@ -189,8 +189,16 @@ def validate_and_install( shutil.copy2(item, install_dir / item.name) try: + # Build wheel subprocess.run( - ["pip", "install", "-e", install_dir, "--no-deps"], + ["python", "-m", "hatchling", "build", "-d", install_dir, "-t", "wheel"], + capture_output=True, + text=True, + check=True, + ) + # Install wheel + subprocess.run( + ["pip", "install", "-e", install_dir / "*.whl", "--no-deps"], capture_output=True, text=True, check=True,