pybiolib 1.2.856__py3-none-any.whl → 1.2.871__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.
@@ -38,6 +38,7 @@ class DockerStatusUpdate(TypedDict, total=False):
38
38
  def process_docker_status_updates(status_updates: Iterable[DockerStatusUpdate], action: str) -> None:
39
39
  with rich.progress.Progress() as progress:
40
40
  layer_id_to_task_id = {}
41
+ overall_task_id = progress.add_task(description=f'[bold blue]{action} Docker image', total=None)
41
42
 
42
43
  for update in status_updates:
43
44
  if 'progressDetail' in update and 'id' in update:
@@ -59,7 +60,39 @@ def process_docker_status_updates(status_updates: Iterable[DockerStatusUpdate],
59
60
  task_id=layer_id_to_task_id[layer_id],
60
61
  total=100,
61
62
  )
63
+ elif 'status' in update and 'id' in update:
64
+ layer_id = update['id']
65
+ status = update['status']
62
66
 
67
+ if layer_id not in layer_id_to_task_id:
68
+ layer_id_to_task_id[layer_id] = progress.add_task(description=f'[cyan]{action} layer {layer_id}')
69
+
70
+ if status in ['Preparing', 'Waiting']:
71
+ progress.update(
72
+ task_id=layer_id_to_task_id[layer_id], description=f'[yellow]{status} layer {layer_id}'
73
+ )
74
+ elif status in ['Pushing', 'Uploading']:
75
+ progress.update(
76
+ task_id=layer_id_to_task_id[layer_id], description=f'[cyan]{status} layer {layer_id}'
77
+ )
78
+ elif status in ['Pushed', 'Uploaded']:
79
+ progress.update(
80
+ task_id=layer_id_to_task_id[layer_id],
81
+ description=f'[green]{status} layer {layer_id}',
82
+ completed=100,
83
+ total=100,
84
+ )
85
+ elif status == 'Layer already exists':
86
+ progress.update(
87
+ task_id=layer_id_to_task_id[layer_id],
88
+ description=f'[green]{status} - layer {layer_id}',
89
+ completed=100,
90
+ total=100,
91
+ )
92
+ elif 'status' in update and update['status']:
93
+ status = update['status']
94
+ if status not in ['Preparing', 'Pushing', 'Pushed', 'Waiting', 'Layer already exists']:
95
+ progress.update(task_id=overall_task_id, description=f'[bold blue]{action} Docker image - {status}')
63
96
  elif 'status' not in update and 'progressDetail' not in update:
64
97
  print(update)
65
98
 
biolib/cli/init.py CHANGED
@@ -26,6 +26,7 @@ def init() -> None:
26
26
 
27
27
  template_dir = templates.init_template()
28
28
  conflicting_files = []
29
+ files_to_overwrite = set()
29
30
 
30
31
  try:
31
32
  # First pass: check for conflicts
@@ -40,11 +41,17 @@ def init() -> None:
40
41
  with open(source_file, 'rb') as fsrc, open(destination_file, 'rb') as fdest:
41
42
  if fsrc.read() != fdest.read():
42
43
  conflicting_files.append(os.path.relpath(destination_file, cwd))
44
+
43
45
  if conflicting_files:
44
- print('The following files were not overwritten. Use --force to override them:', file=sys.stderr)
46
+ print('The following files already exist and would be overwritten:')
47
+ for conflicting_file in conflicting_files:
48
+ print(f' {conflicting_file}')
49
+ print()
50
+
45
51
  for conflicting_file in conflicting_files:
46
- print(f' {conflicting_file}', file=sys.stderr)
47
- exit(1)
52
+ choice = input(f'Overwrite {conflicting_file}? [y/N]: ').lower().strip()
53
+ if choice in ['y', 'yes']:
54
+ files_to_overwrite.add(conflicting_file)
48
55
 
49
56
  replace_app_uri = app_uri if app_uri else 'PUT_APP_URI_HERE'
50
57
 
@@ -61,8 +68,9 @@ def init() -> None:
61
68
 
62
69
  source_file = os.path.join(root, filename)
63
70
  destination_file = os.path.join(destination_dir, filename)
71
+ relative_file_path = os.path.relpath(destination_file, cwd)
64
72
 
65
- if not os.path.exists(destination_file):
73
+ if not os.path.exists(destination_file) or relative_file_path in files_to_overwrite:
66
74
  try:
67
75
  with open(source_file) as f:
68
76
  content = f.read()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pybiolib
3
- Version: 1.2.856
3
+ Version: 1.2.871
4
4
  Summary: BioLib Python Client
5
5
  License: MIT
6
6
  Keywords: biolib
@@ -21,7 +21,7 @@ biolib/_internal/llm_instructions/.github/instructions/style-react-ts.instructio
21
21
  biolib/_internal/llm_instructions/.github/prompts/biolib_app_inputs.prompt.md,sha256=SMzXZImdID0yKjhE1fG54VrHdD8IVuwRxRKsMF-KjWs,697
22
22
  biolib/_internal/llm_instructions/.github/prompts/biolib_run_apps.prompt.md,sha256=-t1bmGr3zEFa6lKHaLcI98yq4Sg1TCMW8xbelNSHaOA,696
23
23
  biolib/_internal/llm_instructions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
24
- biolib/_internal/push_application.py,sha256=I7yHGcwK6udc2hVmOQIc1BcQBipAMibEjURMI6HgdXk,12502
24
+ biolib/_internal/push_application.py,sha256=snnd3aCPJeByEQTCajDi7Op5TH9-BXjJS9QCS8e6cjY,14347
25
25
  biolib/_internal/runtime.py,sha256=BiHl4klUHr36MCpqKaUso4idHeBZfPAahLYRQrabFqA,486
26
26
  biolib/_internal/templates/__init__.py,sha256=NVbhLUMC8HITzkLvP88Qu7FHaL-SvQord-DX3gh1Ykk,24
27
27
  biolib/_internal/templates/init_template/.biolib/config.yml,sha256=y4ndTgbFvUE1UiGcIOqogT2Wm8jahGffeyU5rlCEltQ,427
@@ -83,7 +83,7 @@ biolib/cli/__init__.py,sha256=IHC2bEyA27pvgp-18SGfFVJOP456elanz7suDP8D084,1316
83
83
  biolib/cli/auth.py,sha256=rpWGmXs6Fz6CGrO9K8ibPRszOdXG78Vig_boKaVCD9A,2082
84
84
  biolib/cli/data_record.py,sha256=t8DfJK2EZ_SNZ9drDA_N5Jqy8DNwf9f5SlFrIaOvtv0,3501
85
85
  biolib/cli/download_container.py,sha256=HIZVHOPmslGE5M2Dsp9r2cCkAEJx__vcsDz5Wt5LRos,483
86
- biolib/cli/init.py,sha256=v6ebi969q4lMfBBjJEUbG50Z8J5vA1fkTYeVfm7iZ7Y,4083
86
+ biolib/cli/init.py,sha256=_dhnKdlRMy2oSNRRsXdjFKVzayy2aiRQkeF948VCCkg,4438
87
87
  biolib/cli/lfs.py,sha256=z2qHUwink85mv9yDgifbVKkVwuyknGhMDTfly_gLKJM,4151
88
88
  biolib/cli/push.py,sha256=pSFEUQkQ69M__eR1nIT9ejW4V4_MtX3lb8ydEc1uKiM,1484
89
89
  biolib/cli/run.py,sha256=MCo0ZqW2pHBxOoCI3i5gAx5D0auW9fmxHqkAF4TRhms,2134
@@ -140,8 +140,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
140
140
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
141
141
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
142
142
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
143
- pybiolib-1.2.856.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
144
- pybiolib-1.2.856.dist-info/METADATA,sha256=8dJ2I-UmDG62OdLmb9QEm4g4DuF-Xu6AEIH1VaaGQrs,1570
145
- pybiolib-1.2.856.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
146
- pybiolib-1.2.856.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
147
- pybiolib-1.2.856.dist-info/RECORD,,
143
+ pybiolib-1.2.871.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
144
+ pybiolib-1.2.871.dist-info/METADATA,sha256=zAOp7nhOZdgj0uu5QPYEqTPLsUfGUBDUekQxby2kgyU,1570
145
+ pybiolib-1.2.871.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
146
+ pybiolib-1.2.871.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
147
+ pybiolib-1.2.871.dist-info/RECORD,,