pybiolib 1.2.918__py3-none-any.whl → 1.2.931__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.
- biolib/_internal/llm_instructions/.github/prompts/biolib_onboard_repo.prompt.md +19 -0
- biolib/cli/run.py +1 -1
- biolib/jobs/job.py +9 -2
- biolib/jobs/job_result.py +3 -0
- {pybiolib-1.2.918.dist-info → pybiolib-1.2.931.dist-info}/METADATA +1 -1
- {pybiolib-1.2.918.dist-info → pybiolib-1.2.931.dist-info}/RECORD +9 -8
- {pybiolib-1.2.918.dist-info → pybiolib-1.2.931.dist-info}/LICENSE +0 -0
- {pybiolib-1.2.918.dist-info → pybiolib-1.2.931.dist-info}/WHEEL +0 -0
- {pybiolib-1.2.918.dist-info → pybiolib-1.2.931.dist-info}/entry_points.txt +0 -0
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
mode: 'agent'
|
3
|
+
tools: ['githubRepo', 'codebase']
|
4
|
+
description: 'Handle onboarding and implementing code from a GitHub repository into a biolib application, with focus on creating easily editable and maintainable code structure.'
|
5
|
+
---
|
6
|
+
|
7
|
+
# Main task
|
8
|
+
Your task is to help onboard and implement code from a GitHub repository into a biolib application. This involves understanding the repository structure, implementing the core functionality, and ensuring the code is easily editable for future iterations.
|
9
|
+
Generally, you can do this by adding the repository into an src folder as a submodule, and reading the README.md file to understand how to run the code.
|
10
|
+
You will then call the relevant functions or classes from the cloned repository in your biolib application
|
11
|
+
|
12
|
+
## Key requirements:
|
13
|
+
- Always ask the user for the GitHub repository if not already provided. Inform them that it needs to be in the format `author/repo_name`.
|
14
|
+
- Use the #githubRepo tool to examine the repository structure, README, and key files to understand the project.
|
15
|
+
- Focus on creating code that is easily editable and maintainable, as it's likely the implementation won't be perfect on the first attempt.
|
16
|
+
- Structure the code in a modular way that allows for easy modifications and improvements.
|
17
|
+
- Include clear comments for complex logic, but avoid over-commenting obvious code.
|
18
|
+
- Follow the existing biolib application patterns and conventions.
|
19
|
+
- Ensure all dependencies are properly specified in requirements.txt with versions locked down.
|
biolib/cli/run.py
CHANGED
@@ -48,7 +48,7 @@ def _run(local: bool, non_blocking: bool, uri: str, args: Tuple[str]) -> None:
|
|
48
48
|
)
|
49
49
|
|
50
50
|
if blocking:
|
51
|
-
job.save_files('biolib_results')
|
51
|
+
job.save_files('biolib_results', overwrite=True)
|
52
52
|
|
53
53
|
# Write stdout and stderr if it has not been streamed (Markdown is not streamed)
|
54
54
|
if app.version.get('stdout_render_type') == 'markdown' or not sys.stdout.isatty():
|
biolib/jobs/job.py
CHANGED
@@ -226,7 +226,7 @@ class Result:
|
|
226
226
|
|
227
227
|
return self._cached_input_arguments
|
228
228
|
|
229
|
-
def save_input_files(self, output_dir: str) -> None:
|
229
|
+
def save_input_files(self, output_dir: str, overwrite: bool = False) -> None:
|
230
230
|
logger.info('Downloading input files...')
|
231
231
|
module_input = self._get_module_input()
|
232
232
|
|
@@ -236,7 +236,12 @@ class Result:
|
|
236
236
|
# Remove leading slash of file_path
|
237
237
|
destination_file_path = Path(output_dir) / Path(path.lstrip('/'))
|
238
238
|
if destination_file_path.exists():
|
239
|
-
|
239
|
+
if not overwrite:
|
240
|
+
raise BioLibError(f'File {destination_file_path} already exists. Set overwrite=True to overwrite.')
|
241
|
+
else:
|
242
|
+
destination_file_path.rename(
|
243
|
+
f'{destination_file_path}.biolib-renamed.{time.strftime("%Y%m%d%H%M%S")}'
|
244
|
+
)
|
240
245
|
|
241
246
|
dir_path = destination_file_path.parent
|
242
247
|
if dir_path:
|
@@ -252,11 +257,13 @@ class Result:
|
|
252
257
|
output_dir: str,
|
253
258
|
path_filter: Optional[PathFilter] = None,
|
254
259
|
skip_file_if_exists: Optional[bool] = None,
|
260
|
+
overwrite: bool = False,
|
255
261
|
) -> None:
|
256
262
|
self.result.save_files(
|
257
263
|
output_dir=output_dir,
|
258
264
|
path_filter=path_filter,
|
259
265
|
skip_file_if_exists=skip_file_if_exists,
|
266
|
+
overwrite=overwrite,
|
260
267
|
)
|
261
268
|
|
262
269
|
def get_status(self) -> str:
|
biolib/jobs/job_result.py
CHANGED
@@ -39,6 +39,7 @@ class JobResult:
|
|
39
39
|
output_dir: str,
|
40
40
|
path_filter: Optional[PathFilter] = None,
|
41
41
|
skip_file_if_exists: Optional[bool] = None,
|
42
|
+
overwrite: bool = False,
|
42
43
|
) -> None:
|
43
44
|
module_output = self._get_module_output()
|
44
45
|
output_files = module_output.get_files()
|
@@ -68,6 +69,8 @@ class JobResult:
|
|
68
69
|
if skip_file_if_exists:
|
69
70
|
print(f'Skipping {destination_file_path} as a file with that name already exists locally.')
|
70
71
|
continue
|
72
|
+
elif not overwrite:
|
73
|
+
raise BioLibError(f'File {destination_file_path} already exists. Set overwrite=True to overwrite.')
|
71
74
|
else:
|
72
75
|
destination_file_path.rename(
|
73
76
|
f'{destination_file_path}.biolib-renamed.{time.strftime("%Y%m%d%H%M%S")}'
|
@@ -20,6 +20,7 @@ biolib/_internal/llm_instructions/.github/instructions/style-general.instruction
|
|
20
20
|
biolib/_internal/llm_instructions/.github/instructions/style-python.instructions.md,sha256=xfypuPqMsz5ejobDoVI0HjmNqksl16aFuIol1nAhpHg,1034
|
21
21
|
biolib/_internal/llm_instructions/.github/instructions/style-react-ts.instructions.md,sha256=GQoRL-bfPwwNIW4W0yN_guVIqFNVCG2_7adOCaxiz-w,755
|
22
22
|
biolib/_internal/llm_instructions/.github/prompts/biolib_app_inputs.prompt.md,sha256=SMzXZImdID0yKjhE1fG54VrHdD8IVuwRxRKsMF-KjWs,697
|
23
|
+
biolib/_internal/llm_instructions/.github/prompts/biolib_onboard_repo.prompt.md,sha256=BfCkVyafDHFBMu6qcvKlxpnXKJRHNDp5qR_fN4XB9pI,1515
|
23
24
|
biolib/_internal/llm_instructions/.github/prompts/biolib_run_apps.prompt.md,sha256=-t1bmGr3zEFa6lKHaLcI98yq4Sg1TCMW8xbelNSHaOA,696
|
24
25
|
biolib/_internal/llm_instructions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
26
|
biolib/_internal/push_application.py,sha256=e0SnPh64X99ICUt5xPCIfbS3WHkUzMKLFFyaf6u2vqQ,18286
|
@@ -90,7 +91,7 @@ biolib/cli/download_container.py,sha256=HIZVHOPmslGE5M2Dsp9r2cCkAEJx__vcsDz5Wt5L
|
|
90
91
|
biolib/cli/init.py,sha256=OMYIltLJfF8q9VAvzDwNG0-1VixDkFGEN1ic2VhrW7c,4583
|
91
92
|
biolib/cli/lfs.py,sha256=z2qHUwink85mv9yDgifbVKkVwuyknGhMDTfly_gLKJM,4151
|
92
93
|
biolib/cli/push.py,sha256=J8BswMYVeTacZBHbm4K4a2XbS_I8kvfgRZLoby2wi3I,1695
|
93
|
-
biolib/cli/run.py,sha256=
|
94
|
+
biolib/cli/run.py,sha256=RAAXbIx8Bi-4fNkEoz2ODJ0fEtyS7VxD3dkc2fVZwjY,2150
|
94
95
|
biolib/cli/runtime.py,sha256=Xv-nrma5xX8NidWcvbUKcUvuN5TCarZa4A8mPVmF-z0,361
|
95
96
|
biolib/cli/sdk.py,sha256=XisJwTft4QDB_99eGDlz-WBqqRwIqkVg7HyvxWtOG8w,471
|
96
97
|
biolib/cli/start.py,sha256=rg8VVY8rboFhf1iQo3zE3WA5oh_R1VWWfYJEO1gMReY,1737
|
@@ -128,8 +129,8 @@ biolib/compute_node/webserver/worker_thread.py,sha256=7uD9yQPhePYvP2HCJ27EeZ_h6p
|
|
128
129
|
biolib/experiments/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
129
130
|
biolib/experiments/experiment.py,sha256=gY1-d7FgVrcQO3YzOJ0mHS6j7z7rl5XzXEuk7dFi1gU,10460
|
130
131
|
biolib/jobs/__init__.py,sha256=aIb2H2DHjQbM2Bs-dysFijhwFcL58Blp0Co0gimED3w,32
|
131
|
-
biolib/jobs/job.py,sha256=
|
132
|
-
biolib/jobs/job_result.py,sha256=
|
132
|
+
biolib/jobs/job.py,sha256=B9v-dq9li0v9gDfmyyZOnCk-kN0vYPYxoybHWQsCkPg,27403
|
133
|
+
biolib/jobs/job_result.py,sha256=L__GA5dNSDFHoQpAG2xb-tNqp_p4fQl53bAmlcvAt6M,6074
|
133
134
|
biolib/jobs/types.py,sha256=ezvaoTANsWazK6PmfpYcqezdfjP7MNBEBfqIZGoZhz8,997
|
134
135
|
biolib/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
135
136
|
biolib/runtime/__init__.py,sha256=MlRepA11n2H-3plB5rzWyyHK2JmP6PiaP3i6x3vt0mg,506
|
@@ -144,8 +145,8 @@ biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3
|
|
144
145
|
biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
|
145
146
|
biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
|
146
147
|
biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
|
147
|
-
pybiolib-1.2.
|
148
|
-
pybiolib-1.2.
|
149
|
-
pybiolib-1.2.
|
150
|
-
pybiolib-1.2.
|
151
|
-
pybiolib-1.2.
|
148
|
+
pybiolib-1.2.931.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
|
149
|
+
pybiolib-1.2.931.dist-info/METADATA,sha256=hYj-LjppTQ0jEsBW9R2ViJhTCZ8OCPDntrR6mYiIXEg,1570
|
150
|
+
pybiolib-1.2.931.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
151
|
+
pybiolib-1.2.931.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
|
152
|
+
pybiolib-1.2.931.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|