neuronum 2.0.5__py3-none-any.whl → 2.0.6__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 neuronum might be problematic. Click here for more details.

cli/main.py CHANGED
@@ -7,6 +7,7 @@ import os
7
7
  import neuronum
8
8
  import json
9
9
  import platform
10
+ import glob
10
11
 
11
12
  @click.group()
12
13
  def cli():
@@ -244,8 +245,8 @@ def delete_cell():
244
245
 
245
246
 
246
247
  @click.command()
247
- @click.option('--sync', nargs=1, default=None, help="Optional stream ID for sync.")
248
- @click.option('--stream', nargs=1, default=None, help="Optional stream ID for stream.")
248
+ @click.option('--sync', multiple=True, default=None, help="Optional stream IDs for sync.")
249
+ @click.option('--stream', multiple=True, default=None, help="Optional stream ID for stream.")
249
250
  def init_node(sync, stream):
250
251
 
251
252
  node_type = questionary.select(
@@ -330,11 +331,12 @@ def init_node(sync, stream):
330
331
  nodemd_path = project_path / "NODE.md"
331
332
  nodemd_path.write_text("## Use this NODE.md file to add instructions on how to interact with your node\n")
332
333
 
333
- stx = sync or stream or "n9gW3LxQcecI::stx"
334
+ stx = sync[0] if sync else (stream[0] if stream else "n9gW3LxQcecI::stx")
334
335
 
335
336
  if sync:
336
- sync_path = project_path / "sync.py"
337
- sync_path.write_text(f"""\
337
+ for stx in sync:
338
+ sync_path = project_path / f"sync_{stx.replace('::stx', '')}.py"
339
+ sync_path.write_text(f"""\
338
340
  import neuronum
339
341
  import os
340
342
  from dotenv import load_dotenv
@@ -365,8 +367,9 @@ for operation in stream:
365
367
 
366
368
 
367
369
  if stream:
368
- stream_path = project_path / "stream.py"
369
- stream_path.write_text(f"""\
370
+ for stx in stream:
371
+ stream_path = project_path / f"stream_{stx.replace('::stx', '')}.py"
372
+ stream_path.write_text(f"""\
370
373
  import neuronum
371
374
  import os
372
375
  from dotenv import load_dotenv
@@ -435,7 +438,8 @@ def start_node():
435
438
  click.echo("Starting Node...")
436
439
 
437
440
  project_path = Path.cwd()
438
- script_files = ["main.py", "sync.py", "stream.py"]
441
+
442
+ script_files = ["main.py"] + glob.glob("sync_*.py") + glob.glob("stream_*.py")
439
443
 
440
444
  processes = []
441
445
 
@@ -467,17 +471,20 @@ def stop_node():
467
471
  system_name = platform.system()
468
472
 
469
473
  for pid in pids:
470
- if system_name == "Windows":
471
- subprocess.run(
472
- ["taskkill", "/F", "/PID", str(pid)],
473
- stdout=subprocess.DEVNULL,
474
- stderr=subprocess.DEVNULL
475
- )
476
- else:
477
- os.kill(pid, 9)
474
+ try:
475
+ if system_name == "Windows":
476
+ subprocess.run(
477
+ ["taskkill", "/F", "/PID", str(pid)],
478
+ stdout=subprocess.DEVNULL,
479
+ stderr=subprocess.DEVNULL
480
+ )
481
+ else:
482
+ os.kill(pid, 9)
483
+ except ProcessLookupError:
484
+ click.echo(f"Warning: Process {pid} already stopped or does not exist.")
478
485
 
479
486
  os.remove("node_pid.txt")
480
- click.echo("Node stopped successfully!")
487
+ click.echo(f"Node stopped successfully! {len(pids)} processes terminated.")
481
488
 
482
489
  except FileNotFoundError:
483
490
  click.echo("Error: No active node process found.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: neuronum
3
- Version: 2.0.5
3
+ Version: 2.0.6
4
4
  Summary: Official client library to interact with the Neuronum Network
5
5
  Home-page: https://neuronum.net
6
6
  Author: Neuronum Cybernetics
@@ -35,8 +35,8 @@ Dynamic: summary
35
35
 
36
36
  Build, deploy and automate serverless data infrastructures for an interconnected world with `Neuronum`
37
37
 
38
- ### **What's New in neuronum==2.0.5?**
39
- - **Nodes/Node-CLI**: Logic update: `neuronum init-node --sync` and `neuronum init-node --stream` are not longer required flags
38
+ ### **What's New in neuronum==2.0.6?**
39
+ - **Nodes/Node-CLI**: Improved logic: `neuronum init-node` now supports multiple --stream and --sync flags for better flexibility
40
40
 
41
41
  ### New Feature Set
42
42
  - **Cells/Cell-CLI**: Create and manage Neuronum Cells from the command line
@@ -1,12 +1,12 @@
1
1
  cellai/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  cellai/cellai.py,sha256=g5oBz-Xx6T4-JWzUs-TJ4y9nHtDmA_IpXh_188OqAZA,281
3
3
  cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- cli/main.py,sha256=YujZw9asnHemWPbQx5sNUxNfVSt-C3EiHDS-0OJirko,20530
4
+ cli/main.py,sha256=eTvFa58NO_iCUt9m1gkdDYY_aM1PEto00q-7HGUjITo,20957
5
5
  neuronum/__init__.py,sha256=Drsm263_w3_VWgl1YsKLUr8WwVodqV3TSjqpxLjyq_M,46
6
6
  neuronum/neuronum.py,sha256=rkc16omTxjWBEgBXP0rCeab1S3lYDKz1zx_i-tdFjlY,17544
7
- neuronum-2.0.5.dist-info/licenses/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
8
- neuronum-2.0.5.dist-info/METADATA,sha256=iYe5HGPBrmAIHF_6yHPS8K7bNJP6lweRmWHZlk3ROG0,13986
9
- neuronum-2.0.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
- neuronum-2.0.5.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
11
- neuronum-2.0.5.dist-info/top_level.txt,sha256=gqN5tyGnBKMPSzvWQONO4rpTf4gQPMi77O3KAKx88LQ,20
12
- neuronum-2.0.5.dist-info/RECORD,,
7
+ neuronum-2.0.6.dist-info/licenses/LICENSE,sha256=UiZjNHiCyRP6WoZfbYQh9cv4JW96wIofKXmzBJrYSUk,1125
8
+ neuronum-2.0.6.dist-info/METADATA,sha256=mm1h5C3BDHjbXR9P4gQOh9S42awe0Fbgjh7SxFLMjGk,13988
9
+ neuronum-2.0.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
10
+ neuronum-2.0.6.dist-info/entry_points.txt,sha256=XKYBcRNxGeJpZZkDPsa8HA_RaJ7Km_R_JaUq5T9Nk2U,42
11
+ neuronum-2.0.6.dist-info/top_level.txt,sha256=gqN5tyGnBKMPSzvWQONO4rpTf4gQPMi77O3KAKx88LQ,20
12
+ neuronum-2.0.6.dist-info/RECORD,,