flwr-nightly 1.10.0.dev20240719__py3-none-any.whl → 1.10.0.dev20240721__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of flwr-nightly might be problematic. Click here for more details.

flwr/cli/new/new.py CHANGED
@@ -14,9 +14,9 @@
14
14
  # ==============================================================================
15
15
  """Flower command line interface `new` command."""
16
16
 
17
- import os
18
17
  import re
19
18
  from enum import Enum
19
+ from pathlib import Path
20
20
  from string import Template
21
21
  from typing import Dict, Optional
22
22
 
@@ -59,10 +59,10 @@ class TemplateNotFound(Exception):
59
59
 
60
60
  def load_template(name: str) -> str:
61
61
  """Load template from template directory and return as text."""
62
- tpl_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "templates"))
63
- tpl_file_path = os.path.join(tpl_dir, name)
62
+ tpl_dir = (Path(__file__).parent / "templates").absolute()
63
+ tpl_file_path = tpl_dir / name
64
64
 
65
- if not os.path.isfile(tpl_file_path):
65
+ if not tpl_file_path.is_file():
66
66
  raise TemplateNotFound(f"Template '{name}' not found")
67
67
 
68
68
  with open(tpl_file_path, encoding="utf-8") as tpl_file:
@@ -78,14 +78,13 @@ def render_template(template: str, data: Dict[str, str]) -> str:
78
78
  return tpl.template
79
79
 
80
80
 
81
- def create_file(file_path: str, content: str) -> None:
81
+ def create_file(file_path: Path, content: str) -> None:
82
82
  """Create file including all nessecary directories and write content into file."""
83
- os.makedirs(os.path.dirname(file_path), exist_ok=True)
84
- with open(file_path, "w", encoding="utf-8") as f:
85
- f.write(content)
83
+ file_path.parent.mkdir(exist_ok=True)
84
+ file_path.write_text(content)
86
85
 
87
86
 
88
- def render_and_create(file_path: str, template: str, context: Dict[str, str]) -> None:
87
+ def render_and_create(file_path: Path, template: str, context: Dict[str, str]) -> None:
89
88
  """Render template and write to file."""
90
89
  content = render_template(template, context)
91
90
  create_file(file_path, content)
@@ -117,6 +116,21 @@ def new(
117
116
  default=sanitize_project_name(project_name),
118
117
  )
119
118
 
119
+ # Set project directory path
120
+ package_name = re.sub(r"[-_.]+", "-", project_name).lower()
121
+ import_name = package_name.replace("-", "_")
122
+ project_dir = Path.cwd() / package_name
123
+
124
+ if project_dir.exists():
125
+ if not typer.confirm(
126
+ typer.style(
127
+ f"\n💬 {project_name} already exists, do you want to override it?",
128
+ fg=typer.colors.MAGENTA,
129
+ bold=True,
130
+ )
131
+ ):
132
+ return
133
+
120
134
  if username is None:
121
135
  username = prompt_text("Please provide your Flower username")
122
136
 
@@ -158,12 +172,6 @@ def new(
158
172
  )
159
173
  )
160
174
 
161
- # Set project directory path
162
- cwd = os.getcwd()
163
- package_name = re.sub(r"[-_.]+", "-", project_name).lower()
164
- import_name = package_name.replace("-", "_")
165
- project_dir = os.path.join(cwd, package_name)
166
-
167
175
  context = {
168
176
  "project_name": project_name,
169
177
  "package_name": package_name,
@@ -252,7 +260,7 @@ def new(
252
260
 
253
261
  for file_path, value in files.items():
254
262
  render_and_create(
255
- file_path=os.path.join(project_dir, file_path),
263
+ file_path=project_dir / file_path,
256
264
  template=value["template"],
257
265
  context=context,
258
266
  )
@@ -11,10 +11,10 @@ dependencies = [
11
11
  "flwr[simulation]>=1.9.0,<2.0",
12
12
  "flwr-datasets>=0.0.2,<1.0.0",
13
13
  "torch==2.2.1",
14
- "transformers>=4.30.0,<5.0"
15
- "evaluate>=0.4.0,<1.0"
16
- "datasets>=2.0.0, <3.0"
17
- "scikit-learn>=1.3.1, <2.0"
14
+ "transformers>=4.30.0,<5.0",
15
+ "evaluate>=0.4.0,<1.0",
16
+ "datasets>=2.0.0, <3.0",
17
+ "scikit-learn>=1.3.1, <2.0",
18
18
  ]
19
19
 
20
20
  [tool.hatch.build.targets.wheel]
@@ -9,9 +9,9 @@ description = ""
9
9
  license = "Apache-2.0"
10
10
  dependencies = [
11
11
  "flwr[simulation]>=1.9.0,<2.0",
12
- "jax==0.4.26",
13
- "jaxlib==0.4.26",
14
- "scikit-learn==1.4.2",
12
+ "jax==0.4.13",
13
+ "jaxlib==0.4.13",
14
+ "scikit-learn==1.3.2",
15
15
  ]
16
16
 
17
17
  [tool.hatch.build.targets.wheel]
@@ -480,8 +480,12 @@ def _run_simulation(
480
480
  if verbose_logging:
481
481
  update_console_handler(level=DEBUG, timestamps=True, colored=True)
482
482
  else:
483
- backend_config["init_args"]["logging_level"] = WARNING
484
- backend_config["init_args"]["log_to_driver"] = True
483
+ backend_config["init_args"]["logging_level"] = backend_config["init_args"].get(
484
+ "logging_level", WARNING
485
+ )
486
+ backend_config["init_args"]["log_to_driver"] = backend_config["init_args"].get(
487
+ "log_to_driver", True
488
+ )
485
489
 
486
490
  if enable_tf_gpu_growth:
487
491
  # Check that Backend config has also enabled using GPU growth
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: flwr-nightly
3
- Version: 1.10.0.dev20240719
3
+ Version: 1.10.0.dev20240721
4
4
  Summary: Flower: A Friendly Federated Learning Framework
5
5
  Home-page: https://flower.ai
6
6
  License: Apache-2.0
@@ -33,7 +33,7 @@ Classifier: Typing :: Typed
33
33
  Provides-Extra: rest
34
34
  Provides-Extra: simulation
35
35
  Requires-Dist: cryptography (>=42.0.4,<43.0.0)
36
- Requires-Dist: grpcio (>=1.60.0,<2.0.0,!=1.64.2,!=1.65.0)
36
+ Requires-Dist: grpcio (>=1.60.0,<2.0.0,!=1.64.2,!=1.65.1)
37
37
  Requires-Dist: iterators (>=0.0.2,<0.0.3)
38
38
  Requires-Dist: numpy (>=1.21.0,<2.0.0)
39
39
  Requires-Dist: pathspec (>=0.12.1,<0.13.0)
@@ -6,7 +6,7 @@ flwr/cli/config_utils.py,sha256=6g5gxdEKSYVomwG9w8Pfa-RzMWdbV6XchdUpJ5rzDhg,6817
6
6
  flwr/cli/example.py,sha256=1bGDYll3BXQY2kRqSN-oICqS5n1b9m0g0RvXTopXHl4,2215
7
7
  flwr/cli/install.py,sha256=AI6Zv2dQVDHpLDX1Z_vX5XHVxmZo1OU3ndCSrD2stzQ,7059
8
8
  flwr/cli/new/__init__.py,sha256=cQzK1WH4JP2awef1t2UQ2xjl1agVEz9rwutV18SWV1k,789
9
- flwr/cli/new/new.py,sha256=0JsF-ey_03K1IXq4iY3WHDy11MIODyurflkTZtT3OZk,9457
9
+ flwr/cli/new/new.py,sha256=gUz0qiqDyVrb107pDnBAJwYhWcQXM3K4a533KXhsYxI,9614
10
10
  flwr/cli/new/templates/__init__.py,sha256=4luU8RL-CK8JJCstQ_ON809W9bNTkY1l9zSaPKBkgwY,725
11
11
  flwr/cli/new/templates/app/.gitignore.tpl,sha256=XixnHdyeMB2vwkGtGnwHqoWpH-9WChdyG0GXe57duhc,3078
12
12
  flwr/cli/new/templates/app/README.flowertune.md.tpl,sha256=PqzkGm0g6Zy-vZK9_0EO3f_U6g1r69lGc4UL8kds5Q8,2696
@@ -42,8 +42,8 @@ flwr/cli/new/templates/app/code/task.mlx.py.tpl,sha256=nrfZ1aGOs_ayb70j7XdAmwFYa
42
42
  flwr/cli/new/templates/app/code/task.pytorch.py.tpl,sha256=TU4uNtJ9wtxeVvoHD3_K89EFWmrIvdECdASzRX-4Uvk,3694
43
43
  flwr/cli/new/templates/app/code/task.tensorflow.py.tpl,sha256=cPOUUS07QbblT9PGFucwu9lY1clRA4-W4DQGA7cpcao,1044
44
44
  flwr/cli/new/templates/app/pyproject.flowertune.toml.tpl,sha256=XBcU_XPYt7GecNjeBmD915fZGsF189QMb_IzFl4ATTA,777
45
- flwr/cli/new/templates/app/pyproject.hf.toml.tpl,sha256=kU2cAmlxC_DuJXU6zbNcXy2RmyjEsNTjyXDyeeHClnY,776
46
- flwr/cli/new/templates/app/pyproject.jax.toml.tpl,sha256=njY9toiCCaKCM2yqPsAytlD-jgWF3-aUQmg3vBjbTi0,651
45
+ flwr/cli/new/templates/app/pyproject.hf.toml.tpl,sha256=T9LczlVvebZv10YHPi5Yd1K_MGen7kj6QEkGych7nmU,780
46
+ flwr/cli/new/templates/app/pyproject.jax.toml.tpl,sha256=fbVZTD5mYghFWpS3nFjHjqBTbD9VzEbnn1HTdznRUWU,651
47
47
  flwr/cli/new/templates/app/pyproject.mlx.toml.tpl,sha256=ztZC5kQhjzVUUnvlfhOPebn1dx9QJOHRP4JARuZ_5EQ,750
48
48
  flwr/cli/new/templates/app/pyproject.numpy.toml.tpl,sha256=5KiJUl6gm7rmW4xIBgF5qK5s2YMnMkouHBdOHuWUmcw,604
49
49
  flwr/cli/new/templates/app/pyproject.pytorch.toml.tpl,sha256=Ur0D2S98AnoiVcy_pTQnxSuLssioQe6yzGWQ1rLkTU8,692
@@ -262,7 +262,7 @@ flwr/simulation/ray_transport/__init__.py,sha256=wzcEEwUUlulnXsg6raCA1nGpP3LlAQD
262
262
  flwr/simulation/ray_transport/ray_actor.py,sha256=3j0HgzjrlYjnzdTRy8aA4Nf6VoUvxi1hGRQkGSU5z6c,19020
263
263
  flwr/simulation/ray_transport/ray_client_proxy.py,sha256=4KWWGSnfEBe3aGc0Ln5_1yRcZ52wKmOA7gXJKkMglvM,7302
264
264
  flwr/simulation/ray_transport/utils.py,sha256=TYdtfg1P9VfTdLMOJlifInGpxWHYs9UfUqIv2wfkRLA,2392
265
- flwr/simulation/run_simulation.py,sha256=LagfAOFRaB2w6DhbIBNktm9lgBCjFXW19wYHSFn3SqE,22175
265
+ flwr/simulation/run_simulation.py,sha256=efscduj2l9c2v3_f4al0Hqkm-Y_BPKDr6YNbmCUt8yo,22319
266
266
  flwr/superexec/__init__.py,sha256=9h94ogLxi6eJ3bUuJYq3E3pApThSabTPiSmPAGlTkHE,800
267
267
  flwr/superexec/app.py,sha256=xam9I3SKFGoFXfM_UE-Z92N-fVc6n1T69_Ihz8bFMfQ,6404
268
268
  flwr/superexec/deployment.py,sha256=Nqzzm9N5zPZy9wH7SLgdaDod0-B9ixlsiCUYX6JhmNw,5845
@@ -270,8 +270,8 @@ flwr/superexec/exec_grpc.py,sha256=vYbZyV89MuvYDH1XzVYHkKmGfOcU6FWh8rTcIJk2TIQ,1
270
270
  flwr/superexec/exec_servicer.py,sha256=4R1f_9v0vly_bXpIYaXAeV1tO5LAy1AYygGGGNZmlQk,2194
271
271
  flwr/superexec/executor.py,sha256=5ua0AU2cfisyD79dosP-POF3w0FRH2I5Wko_PPKLWqU,2153
272
272
  flwr/superexec/simulation.py,sha256=yOykF9zqFwHwkEN5gKHf7dMYdc1BVOysKpFPwlXIoOY,4663
273
- flwr_nightly-1.10.0.dev20240719.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
274
- flwr_nightly-1.10.0.dev20240719.dist-info/METADATA,sha256=uUxTicfl_cj9_CQEFdvVvyjl06EphWU1db1jvN8cO48,15672
275
- flwr_nightly-1.10.0.dev20240719.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
276
- flwr_nightly-1.10.0.dev20240719.dist-info/entry_points.txt,sha256=7qBQcA-bDGDxnJmLd9FYqglFQubjCNqyg9M8a-lukps,336
277
- flwr_nightly-1.10.0.dev20240719.dist-info/RECORD,,
273
+ flwr_nightly-1.10.0.dev20240721.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
274
+ flwr_nightly-1.10.0.dev20240721.dist-info/METADATA,sha256=AWSB0EXC_gLxvDfXzUMiS-0BUVBBOMgS8lFRI-jyN9w,15672
275
+ flwr_nightly-1.10.0.dev20240721.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
276
+ flwr_nightly-1.10.0.dev20240721.dist-info/entry_points.txt,sha256=7qBQcA-bDGDxnJmLd9FYqglFQubjCNqyg9M8a-lukps,336
277
+ flwr_nightly-1.10.0.dev20240721.dist-info/RECORD,,