pybiolib 1.2.701__py3-none-any.whl → 1.2.716__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.
@@ -0,0 +1,43 @@
1
+ import os
2
+ import shutil
3
+ import sys
4
+
5
+ from biolib._internal import llm_instructions
6
+
7
+
8
+ def add_copilot_prompts(force: bool, silent: bool = False) -> None:
9
+ current_working_directory = os.getcwd()
10
+ config_file_path = f'{current_working_directory}/.biolib/config.yml'
11
+ if not os.path.exists(config_file_path):
12
+ err_string = """
13
+ Error: Current directory has not been initialized as a BioLib application.
14
+ Please run the \"biolib init\" command first"""
15
+ print(err_string, file=sys.stderr)
16
+ exit(1)
17
+ source_path = os.path.join(os.path.dirname(llm_instructions.__file__), '.github')
18
+ destination_path = os.path.join(current_working_directory, '.github')
19
+
20
+ conflicting_files = []
21
+
22
+ for root, _, files in os.walk(source_path):
23
+ relative_dir = os.path.relpath(root, source_path)
24
+ destination_dir = os.path.join(destination_path, relative_dir)
25
+ for file in files:
26
+ source_file = os.path.join(root, file)
27
+ destination_file = os.path.join(destination_dir, file)
28
+ if os.path.exists(destination_file) and not force:
29
+ with open(source_file, 'rb') as fsrc, open(destination_file, 'rb') as fdest:
30
+ if fsrc.read() != fdest.read():
31
+ conflicting_files.append(os.path.relpath(destination_file, current_working_directory))
32
+ else:
33
+ os.makedirs(destination_dir, exist_ok=True)
34
+ shutil.copy2(source_file, destination_file)
35
+
36
+ if conflicting_files:
37
+ print('The following files were not overwritten. Use --force to override them:', file=sys.stderr)
38
+ for conflicting_file in conflicting_files:
39
+ print(f' {conflicting_file}', file=sys.stderr)
40
+ exit(1)
41
+
42
+ if not silent:
43
+ print(f'Prompt and instruction files added to {destination_path}/')
@@ -0,0 +1,9 @@
1
+ Variable names are allowed to be verbose, and should be descriptive.
2
+
3
+ Code comments should only be added for complex logic or unintuitive code that is not adequately explained by the function names themselves.
4
+
5
+ Unit tests are not necessary. Tests should instead be written as simple examples demonstrating the functionality of relevant functions.
6
+
7
+ Always use 4 spaces for indentation.
8
+
9
+ Function definitions should be typed as specifically as possible.
@@ -1,10 +1,4 @@
1
- Variable names are allowed to be verbose, and should be descriptive.
2
-
3
- Code comments should only be added for complex logic or unintuitive code that is not adequately explained by the function names themselves.
4
-
5
- Unit tests are not necessary. Tests should instead be written as simple examples demonstrating the functionality of relevant functions.
6
-
7
- Always use 4 spaces for indentation when writing code.
1
+ Use yarn instead of npm whenever relevant.
8
2
 
9
3
  When running BioLib Apps, use [this file](prompts/biolib_run_apps.prompt.md) as context to understand how that works.
10
4
 
@@ -2,4 +2,5 @@ from .app import * # noqa: F403
2
2
  from .data_record import * # noqa: F403
3
3
  from .experiment import * # noqa: F403
4
4
  from .resource import * # noqa: F403
5
+ from .resource_permission import * # noqa: F403
5
6
  from .resource_version import * # noqa: F403
@@ -0,0 +1,13 @@
1
+ from .typing import TypedDict
2
+
3
+
4
+ class ResourcePermissionDict(TypedDict):
5
+ uuid: str
6
+ created_at: str
7
+ action: str
8
+ resource_uuid: str
9
+ target_resource_uuid: str
10
+
11
+
12
+ class ResourcePermissionDetailedDict(ResourcePermissionDict):
13
+ pass
biolib/cli/init.py CHANGED
@@ -4,6 +4,7 @@ import sys
4
4
  import click
5
5
 
6
6
  from biolib import templates
7
+ from biolib._internal.add_copilot_prompts import add_copilot_prompts
7
8
 
8
9
 
9
10
  @click.command(help='Initialize a project with a .biolib/config.yml file', hidden=True)
@@ -26,6 +27,9 @@ def init() -> None:
26
27
  if not os.path.exists(readme_path):
27
28
  with open(readme_path, 'w') as readme_file:
28
29
  readme_file.write(f'# {project_name}\n')
30
+
31
+ add_copilot_prompts(force=False, silent=True)
32
+
29
33
  except KeyboardInterrupt:
30
34
  print('\nInit command cancelled.', file=sys.stderr)
31
35
  exit(1)
biolib/cli/sdk.py CHANGED
@@ -1,10 +1,6 @@
1
- import os
2
- import shutil
3
- import sys
4
-
5
1
  import click
6
2
 
7
- from biolib._internal import llm_instructions
3
+ from biolib._internal.add_copilot_prompts import add_copilot_prompts
8
4
 
9
5
 
10
6
  @click.group(name='sdk', help='Advanced commands for developers')
@@ -16,38 +12,5 @@ def sdk():
16
12
  name='add-copilot-prompts', help='Add BioLib-specific GitHub Copilot prompts and instructions to your repository'
17
13
  )
18
14
  @click.option('--force', is_flag=True, help='Force overwrite existing files.')
19
- def add_copilot_prompts(force: bool) -> None:
20
- current_working_directory = os.getcwd()
21
- config_file_path = f'{current_working_directory}/.biolib/config.yml'
22
- if not os.path.exists(config_file_path):
23
- err_string = """
24
- Error: Current directory has not been initialized as a BioLib application.
25
- Please run the "biolib init" command first"""
26
- click.echo(err_string, file=sys.stderr)
27
- exit(1)
28
- source_path = os.path.join(os.path.dirname(llm_instructions.__file__), '.github')
29
- destination_path = os.path.join(current_working_directory, '.github')
30
-
31
- conflicting_files = []
32
-
33
- for root, _, files in os.walk(source_path):
34
- relative_dir = os.path.relpath(root, source_path)
35
- destination_dir = os.path.join(destination_path, relative_dir)
36
- for file in files:
37
- source_file = os.path.join(root, file)
38
- destination_file = os.path.join(destination_dir, file)
39
- if os.path.exists(destination_file) and not force:
40
- with open(source_file, 'rb') as fsrc, open(destination_file, 'rb') as fdest:
41
- if fsrc.read() != fdest.read():
42
- conflicting_files.append(os.path.relpath(destination_file, current_working_directory))
43
- else:
44
- os.makedirs(destination_dir, exist_ok=True)
45
- shutil.copy2(source_file, destination_file)
46
-
47
- if conflicting_files:
48
- click.echo('The following files were not overwritten. Use --force to override them:', file=sys.stderr)
49
- for conflicting_file in conflicting_files:
50
- click.echo(f' {conflicting_file}', file=sys.stderr)
51
- exit(1)
52
-
53
- click.echo(f'Prompt and instruction files added to {destination_path}/')
15
+ def add_copilot_prompts_command(force: bool) -> None:
16
+ add_copilot_prompts(force)
@@ -227,7 +227,7 @@ http {{
227
227
  proxy_set_header cookie "";
228
228
  proxy_ssl_server_name on;
229
229
  }}
230
-
230
+
231
231
  location ~* "^/api/jobs/(?<job_id>[a-z0-9-]{{36}})/main_result/$" {{
232
232
  proxy_pass https://$upstream_hostname/api/jobs/$job_id/main_result/;
233
233
  proxy_set_header authorization "";
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pybiolib
3
- Version: 1.2.701
3
+ Version: 1.2.716
4
4
  Summary: BioLib Python Client
5
5
  License: MIT
6
6
  Keywords: biolib
@@ -1,6 +1,7 @@
1
1
  biolib/__init__.py,sha256=RL-YmqW1WUKk2FGuEt-8kzzlK1QZKcEtzBUsifWUNQM,10626
2
2
  biolib/_data_record/data_record.py,sha256=zKvnh5T-dIVY46-kgVzMBoZ666ZhcTCFQnWvZT0D6RM,12026
3
3
  biolib/_internal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ biolib/_internal/add_copilot_prompts.py,sha256=jhyAMhQZZTvRFxARCdGxlZwtLDczRxjZEDl9-xzWZ34,1852
4
5
  biolib/_internal/data_record/__init__.py,sha256=fGdME6JGRU_2VxpJbYpGXYndjN-feUkmKY4fuMyq3cg,76
5
6
  biolib/_internal/data_record/data_record.py,sha256=SD3-tKQY2RZv9ZSVNUhd2ISDYV64Fk1Sc642qyf_Vis,4618
6
7
  biolib/_internal/data_record/push_data.py,sha256=-L3a_7zZzDCXabBu3O4lWPMAMeBbeRPTrBlEM-_5SCI,2693
@@ -13,19 +14,21 @@ biolib/_internal/lfs/__init__.py,sha256=gSWo_xg61UniYgD7yNYxeT4I9uaXBCBSi3_nmZjn
13
14
  biolib/_internal/lfs/cache.py,sha256=pQS2np21rdJ6I3DpoOutnzPHpLOZgUIS8TMltUJk_k4,2226
14
15
  biolib/_internal/libs/__init__.py,sha256=Jdf4tNPqe_oIIf6zYml6TiqhL_02Vyqwge6IELrAFhw,98
15
16
  biolib/_internal/libs/fusepy/__init__.py,sha256=AWDzNFS-XV_5yKb0Qx7kggIhPzq1nj_BZS5y2Nso08k,41944
16
- biolib/_internal/llm_instructions/.github/copilot-instructions.md,sha256=OAaZIipjpTA7_9dVygvLejdJRz5Gu1jOlT8bMsZh71c,697
17
+ biolib/_internal/llm_instructions/.github/code-style.md,sha256=ODwlSFrQqZoZuXg2GVHV_BoSrFigu6gbnhDd68XMxRY,452
18
+ biolib/_internal/llm_instructions/.github/copilot-instructions.md,sha256=GCGYxfjenwKjy6srtNMPqwIZzgau5o6xYkcFJb4SwVk,337
17
19
  biolib/_internal/llm_instructions/.github/prompts/biolib_app_inputs.prompt.md,sha256=DcBUNaViuNfXoomj-IVUcIcBtJlXuIYOroUfDM_R6wU,3212
18
20
  biolib/_internal/llm_instructions/.github/prompts/biolib_run_apps.prompt.md,sha256=HYv-MgpQKIU7Hv90SvZ3tqXY6KWxYVnqamXDRyInOHM,7926
19
21
  biolib/_internal/llm_instructions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
22
  biolib/_internal/push_application.py,sha256=Ffj3iZ0nma4KHTB-PKCeFvhCHHhAEhgKClxnfBUpL8U,12296
21
23
  biolib/_internal/runtime.py,sha256=BiHl4klUHr36MCpqKaUso4idHeBZfPAahLYRQrabFqA,486
22
24
  biolib/_internal/tree_utils.py,sha256=_Q_6_NDtIiROcefymqxEVddjqti6Mt3OZ4U0GcDW61s,3904
23
- biolib/_internal/types/__init__.py,sha256=xLgOQJFh3GRtiqIJq7MaqHReZx4pp34_zcaFQ_JjuJ4,198
25
+ biolib/_internal/types/__init__.py,sha256=WvtlSHh77QhYVTLeRpoPAzqvByLzbEPf_ZqYGHFlQug,247
24
26
  biolib/_internal/types/app.py,sha256=Mz2QGD_jESX-K9JYnLWPo4YA__Q_1FQQTk9pvidCohU,118
25
27
  biolib/_internal/types/data_record.py,sha256=9r_vdhVs60YTnzU4XQFXfDrfS2P2MqD3BH2xa7lk6ck,852
26
28
  biolib/_internal/types/experiment.py,sha256=D94iBdn2nS92lRW-TOs1a2WKXJD5ZtmzL4ypggKX2ys,176
27
29
  biolib/_internal/types/file_node.py,sha256=T6BIqo662f3nwMBRqtBHYsg6YuuUaKpiokHcVjv9_ME,283
28
30
  biolib/_internal/types/resource.py,sha256=uUI9Rt5ehkXv9NEDW9zsaPXiTXxnj811rSUW3g_joJw,437
31
+ biolib/_internal/types/resource_permission.py,sha256=4VXQ3NuXZYXSaZhnp78G0ljEnkQ-ud9gGgYgo2dGO3g,249
29
32
  biolib/_internal/types/resource_version.py,sha256=cU0YFHqxO-wX_Y6CoeK0Iei61gFwVoyR_kPOSTQ4mCs,304
30
33
  biolib/_internal/types/typing.py,sha256=qrsk8hHcGEbDpU1QQFzHAKnhQxkMe7uJ6pxHeAnfv1Y,414
31
34
  biolib/_internal/utils/__init__.py,sha256=p5vsIFyu-zYqBgdSMfwW9NC_jk7rXvvCbV4Bzd3As7c,630
@@ -67,12 +70,12 @@ biolib/cli/__init__.py,sha256=IHC2bEyA27pvgp-18SGfFVJOP456elanz7suDP8D084,1316
67
70
  biolib/cli/auth.py,sha256=rpWGmXs6Fz6CGrO9K8ibPRszOdXG78Vig_boKaVCD9A,2082
68
71
  biolib/cli/data_record.py,sha256=t8DfJK2EZ_SNZ9drDA_N5Jqy8DNwf9f5SlFrIaOvtv0,3501
69
72
  biolib/cli/download_container.py,sha256=HIZVHOPmslGE5M2Dsp9r2cCkAEJx__vcsDz5Wt5LRos,483
70
- biolib/cli/init.py,sha256=GBMSrRAgNISqyqyisF2cYrKioTXJqFgkwASgA8VLnXc,936
73
+ biolib/cli/init.py,sha256=PZLzQYbT7u78J1qSCcs-frVfWHohkrZHxLGRSmMdRg4,1061
71
74
  biolib/cli/lfs.py,sha256=z2qHUwink85mv9yDgifbVKkVwuyknGhMDTfly_gLKJM,4151
72
75
  biolib/cli/push.py,sha256=RxB4RHpjtL27Fpq7WRGojJ53R9jUuE1Cq9_NmHFzNsM,1306
73
76
  biolib/cli/run.py,sha256=MCo0ZqW2pHBxOoCI3i5gAx5D0auW9fmxHqkAF4TRhms,2134
74
77
  biolib/cli/runtime.py,sha256=Xv-nrma5xX8NidWcvbUKcUvuN5TCarZa4A8mPVmF-z0,361
75
- biolib/cli/sdk.py,sha256=YTeriA-jC5XuEbhMMQ4DlOZXM2y0vN5YsKDNoAeZao8,2140
78
+ biolib/cli/sdk.py,sha256=XisJwTft4QDB_99eGDlz-WBqqRwIqkVg7HyvxWtOG8w,471
76
79
  biolib/cli/start.py,sha256=rg8VVY8rboFhf1iQo3zE3WA5oh_R1VWWfYJEO1gMReY,1737
77
80
  biolib/compute_node/.gitignore,sha256=GZdZ4g7HftqfOfasFpBC5zV1YQAbht1a7EzcXD6f3zg,45
78
81
  biolib/compute_node/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -95,7 +98,7 @@ biolib/compute_node/job_worker/large_file_system.py,sha256=XXqRlVtYhs-Ji9zQGIk5K
95
98
  biolib/compute_node/job_worker/mappings.py,sha256=Z48Kg4nbcOvsT2-9o3RRikBkqflgO4XeaWxTGz-CNvI,2499
96
99
  biolib/compute_node/job_worker/utilization_reporter_thread.py,sha256=7tm5Yk9coqJ9VbEdnO86tSXI0iM0omwIyKENxdxiVXk,8575
97
100
  biolib/compute_node/job_worker/utils.py,sha256=wgxcIA8yAhUPdCwyvuuJ0JmreyWmmUoBO33vWtG60xg,1282
98
- biolib/compute_node/remote_host_proxy.py,sha256=1EZnB0WWG359Yy22xBoqRqGEmmlA12rpiG5u8B2381M,16533
101
+ biolib/compute_node/remote_host_proxy.py,sha256=4rNR4iCmtwo5Wej-B1BcoZboNANCHEd0N_G5Uh1u9zI,16525
99
102
  biolib/compute_node/socker_listener_thread.py,sha256=T5_UikA3MB9bD5W_dckYLPTgixh72vKUlgbBvj9dbM0,1601
100
103
  biolib/compute_node/socket_sender_thread.py,sha256=YgamPHeUm2GjMFGx8qk-99WlZhEs-kAb3q_2O6qByig,971
101
104
  biolib/compute_node/utils.py,sha256=fWtFIcGatek1NaVOT9Vaey6UFp8GKLYGLAVu8jgOwi8,4861
@@ -126,8 +129,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
126
129
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
127
130
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
128
131
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
129
- pybiolib-1.2.701.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
130
- pybiolib-1.2.701.dist-info/METADATA,sha256=r4sy2tMZgB6dLiUiCnJAPjL-cuw09JWJvayRQIAMsE8,1570
131
- pybiolib-1.2.701.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
132
- pybiolib-1.2.701.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
133
- pybiolib-1.2.701.dist-info/RECORD,,
132
+ pybiolib-1.2.716.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
133
+ pybiolib-1.2.716.dist-info/METADATA,sha256=fubamF_xtsMsBYPyf9XVYzmVDUpVwWwLx3UcODfpHXQ,1570
134
+ pybiolib-1.2.716.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
135
+ pybiolib-1.2.716.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
136
+ pybiolib-1.2.716.dist-info/RECORD,,