pybiolib 1.2.1144__py3-none-any.whl → 1.2.1153__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.
@@ -284,3 +284,16 @@ class DataRecord:
284
284
 
285
285
  def _get_detailed_dict(self) -> types.DataRecordDetailedDict:
286
286
  return cast(types.DataRecordDetailedDict, api_client.get(f'/resources/data-records/{self.uuid}/').json())
287
+
288
+ def delete(self) -> None:
289
+ """Delete the data record.
290
+
291
+ Example::
292
+ >>> record = DataRecord.get_by_uri("account/data-record")
293
+ >>> record.delete()
294
+ """
295
+ try:
296
+ api_client.delete(path=f'/apps/{self.uuid}/')
297
+ logger.info(f'Data record {self.uri} deleted')
298
+ except Exception as error:
299
+ raise Exception(f'Failed to delete data record {self.uri} due to: {error}') from error
@@ -57,6 +57,22 @@ def _get_git_branch_name() -> str:
57
57
  return ''
58
58
 
59
59
 
60
+ def _get_git_commit_hash() -> str:
61
+ try:
62
+ github_actions_commit_hash = os.getenv('GITHUB_SHA')
63
+ if github_actions_commit_hash:
64
+ return github_actions_commit_hash
65
+
66
+ gitlab_ci_commit_hash = os.getenv('CI_COMMIT_SHA')
67
+ if gitlab_ci_commit_hash:
68
+ return gitlab_ci_commit_hash
69
+
70
+ result = subprocess.run(['git', 'rev-parse', 'HEAD'], check=True, stdout=subprocess.PIPE, text=True)
71
+ return result.stdout.strip()
72
+ except BaseException:
73
+ return ''
74
+
75
+
60
76
  def _get_git_repository_url() -> str:
61
77
  try:
62
78
  result = subprocess.run(['git', 'remote', 'get-url', 'origin'], check=True, stdout=subprocess.PIPE, text=True)
@@ -125,6 +141,7 @@ class BiolibAppApi:
125
141
  'state': 'published',
126
142
  'app_version_id_to_copy_images_from': app_version_id_to_copy_images_from,
127
143
  'git_branch_name': _get_git_branch_name(),
144
+ 'git_commit_hash': _get_git_commit_hash(),
128
145
  'git_repository_url': _get_git_repository_url(),
129
146
  }
130
147
  if semantic_version:
biolib/cli/data_record.py CHANGED
@@ -80,3 +80,20 @@ def describe(uri: str, output_as_json: bool) -> None:
80
80
  size_string = str(file_info['size_bytes'])
81
81
  leading_space_string = ' ' * (10 - len(size_string))
82
82
  print(f"{leading_space_string}{size_string} {file_info['path']}")
83
+
84
+
85
+ @data_record.command(help='Delete a Data Record')
86
+ @click.argument('uri', required=True)
87
+ def delete(uri: str) -> None:
88
+ record = DataRecord.get_by_uri(uri=uri)
89
+
90
+ print(f'You are about to delete the data record: {record.uri}')
91
+ print('This action cannot be undone.')
92
+
93
+ confirmation = input(f'To confirm deletion, please type the data record name "{record.name}": ')
94
+ if confirmation != record.name:
95
+ print('Data record name does not match. Deletion cancelled.')
96
+ return
97
+
98
+ record.delete()
99
+ print(f'Data record {record.uri} has been deleted.')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pybiolib
3
- Version: 1.2.1144
3
+ Version: 1.2.1153
4
4
  Summary: BioLib Python Client
5
5
  License: MIT
6
6
  Keywords: biolib
@@ -1,5 +1,5 @@
1
1
  biolib/__init__.py,sha256=o0cpNzP7OwPYfdw5Cq-XgsMYooQdQynZTUO3W-LFuKo,10657
2
- biolib/_data_record/data_record.py,sha256=zKvnh5T-dIVY46-kgVzMBoZ666ZhcTCFQnWvZT0D6RM,12026
2
+ biolib/_data_record/data_record.py,sha256=BM2WEBnn13reSiAqhBtcV8FLewFWSTcMmFV0bD74bM0,12489
3
3
  biolib/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  biolib/_internal/add_copilot_prompts.py,sha256=wcIdrceFcfKSoEjvM4uNzhKZ0I1-MCFkfNO4duqtGHA,1861
5
5
  biolib/_internal/add_gui_files.py,sha256=MrtvkIpe70tVVJYBBsMbRhjsxf55hFzlzn-ea2oinTc,2218
@@ -72,7 +72,7 @@ biolib/biolib_api_client/__init__.py,sha256=E5EMa19wJoblwSdQPYrxc_BtIeRsAuO0L_jQ
72
72
  biolib/biolib_api_client/api_client.py,sha256=IONzXeFCHl4wuct6fqOC_7NiTv_zFy6ys0hsAtvLzTA,7578
73
73
  biolib/biolib_api_client/app_types.py,sha256=P2MbwYZ0VsPUcbcX27lSvVlAYSbkz_IqWTcbxFyuu7I,2477
74
74
  biolib/biolib_api_client/auth.py,sha256=kjm0ZHnH3I8so3su2sZbBxNHYp-ZUdrZ5lwQ0K36RSw,949
75
- biolib/biolib_api_client/biolib_app_api.py,sha256=N8l6tDsLy7CUNZ3z6hoa2vYlQ_g4Y43udLbinigZz-4,5464
75
+ biolib/biolib_api_client/biolib_app_api.py,sha256=slnJVuWtN_Et1PSnjN7mPmYWJvk0Rp-h0rvdrW1R9u8,6041
76
76
  biolib/biolib_api_client/biolib_job_api.py,sha256=3Hzv5Os4d377pKrCzg3i7c5xiy9FiqeVssub690GLdA,7423
77
77
  biolib/biolib_api_client/common_types.py,sha256=RH-1KNHqUF-EkTpfPOSTt5Mq1GPdfju_cqXDesscO1I,123
78
78
  biolib/biolib_api_client/job_types.py,sha256=yBdBwjharbQJuXCi2xKMi0t_r6XxnbWnkchHekTpCJY,1351
@@ -96,7 +96,7 @@ biolib/biolib_errors.py,sha256=eyQolC4oGi350BDEMOd-gAHYVqo2L2lYgv6c4ZdXPjQ,1184
96
96
  biolib/biolib_logging.py,sha256=Y3qALGNYaTHdXP2aPFNWfxN71pk2Z3syMG6XrYcRZT8,2863
97
97
  biolib/cli/__init__.py,sha256=IHC2bEyA27pvgp-18SGfFVJOP456elanz7suDP8D084,1316
98
98
  biolib/cli/auth.py,sha256=p9ZGY6ld2rnMbpsuRskvIQJNUHlSgYgcLTDsYGyUwyw,1407
99
- biolib/cli/data_record.py,sha256=t8DfJK2EZ_SNZ9drDA_N5Jqy8DNwf9f5SlFrIaOvtv0,3501
99
+ biolib/cli/data_record.py,sha256=ypNr-MK_3bvJv0wkZ4V1p_4cU9gfGvFoeXTtghnhrQE,4078
100
100
  biolib/cli/download_container.py,sha256=HIZVHOPmslGE5M2Dsp9r2cCkAEJx__vcsDz5Wt5LRos,483
101
101
  biolib/cli/init.py,sha256=oGo178h_GlDieWjBqHDLAejeUhVKm5ZJnI_o2YqbEZ0,8366
102
102
  biolib/cli/lfs.py,sha256=z2qHUwink85mv9yDgifbVKkVwuyknGhMDTfly_gLKJM,4151
@@ -157,8 +157,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
157
157
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
158
158
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
159
159
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
160
- pybiolib-1.2.1144.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
161
- pybiolib-1.2.1144.dist-info/METADATA,sha256=WPrOMwzh3qoKo6NEAXTbvhA28V0mhgd8bNOJ-W_vKOM,1571
162
- pybiolib-1.2.1144.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
163
- pybiolib-1.2.1144.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
164
- pybiolib-1.2.1144.dist-info/RECORD,,
160
+ pybiolib-1.2.1153.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
161
+ pybiolib-1.2.1153.dist-info/METADATA,sha256=Xy3vY_DtiT1n_r_YYF0bIJS63hVe6ShZEZ4CsnBg8lU,1571
162
+ pybiolib-1.2.1153.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
163
+ pybiolib-1.2.1153.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
164
+ pybiolib-1.2.1153.dist-info/RECORD,,