Skip to content

Commit

Permalink
Merge branch 'main' into change-override-config-type
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll authored Jul 16, 2024
2 parents b8b9937 + 517016c commit 36a46ba
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 9 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ pycryptodome = "^3.18.0"
iterators = "^0.0.2"
typer = { version = "^0.9.0", extras=["all"] }
tomli = "^2.0.1"
tomli-w = "^1.0.0"
pathspec = "^0.12.1"
# Optional dependencies (Simulation Engine)
ray = { version = "==2.10.0", optional = true, python = ">=3.8,<3.12" }
Expand Down
16 changes: 15 additions & 1 deletion src/py/flwr/cli/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
from typing import Optional

import pathspec
import tomli_w
import typer
from typing_extensions import Annotated

Expand Down Expand Up @@ -93,15 +94,28 @@ def build(

allowed_extensions = {".py", ".toml", ".md"}

# Remove the 'federations' field from 'tool.flwr' if it exists
if (
"tool" in conf
and "flwr" in conf["tool"]
and "federations" in conf["tool"]["flwr"]
):
del conf["tool"]["flwr"]["federations"]

toml_contents = tomli_w.dumps(conf)

with zipfile.ZipFile(fab_filename, "w", zipfile.ZIP_DEFLATED) as fab_file:
fab_file.writestr("pyproject.toml", toml_contents)

# Continue with adding other files
for root, _, files in os.walk(directory, topdown=True):
# Filter directories and files based on .gitignore
files = [
f
for f in files
if not ignore_spec.match_file(Path(root) / f)
and f != fab_filename
and Path(f).suffix in allowed_extensions
and f != "pyproject.toml" # Exclude the original pyproject.toml
]

for file in files:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "$package_name"
version = "1.0.0"
description = ""
license = { text = "Apache License (2.0)" }
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.9.0,<2.0",
"flwr-datasets>=0.1.0,<1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/py/flwr/cli/new/templates/app/pyproject.hf.toml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "$package_name"
version = "1.0.0"
description = ""
license = { text = "Apache License (2.0)" }
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.9.0,<2.0",
"flwr-datasets>=0.0.2,<1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/py/flwr/cli/new/templates/app/pyproject.jax.toml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "$package_name"
version = "1.0.0"
description = ""
license = {text = "Apache License (2.0)"}
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.9.0,<2.0",
"jax==0.4.26",
Expand Down
2 changes: 1 addition & 1 deletion src/py/flwr/cli/new/templates/app/pyproject.mlx.toml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "$package_name"
version = "1.0.0"
description = ""
license = { text = "Apache License (2.0)" }
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.9.0,<2.0",
"flwr-datasets[vision]>=0.0.2,<1.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/py/flwr/cli/new/templates/app/pyproject.numpy.toml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "$package_name"
version = "1.0.0"
description = ""
license = { text = "Apache License (2.0)" }
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.9.0,<2.0",
"numpy>=1.21.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "$package_name"
version = "1.0.0"
description = ""
license = { text = "Apache License (2.0)" }
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.9.0,<2.0",
"flwr-datasets[vision]>=0.0.2,<1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "$package_name"
version = "1.0.0"
description = ""
license = { text = "Apache License (2.0)" }
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.9.0,<2.0",
"flwr-datasets[vision]>=0.0.2,<1.0.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "hatchling.build"
name = "$package_name"
version = "1.0.0"
description = ""
license = { text = "Apache License (2.0)" }
license = "Apache-2.0"
dependencies = [
"flwr[simulation]>=1.9.0,<2.0",
"flwr-datasets[vision]>=0.0.2,<1.0.0",
Expand Down

0 comments on commit 36a46ba

Please sign in to comment.