pybiolib 1.2.802__tar.gz → 1.2.838__tar.gz
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.
- {pybiolib-1.2.802 → pybiolib-1.2.838}/PKG-INFO +1 -1
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/add_copilot_prompts.py +7 -5
- pybiolib-1.2.838/biolib/_internal/llm_instructions/.github/instructions/general-app-knowledge.instructions.md +10 -0
- pybiolib-1.2.838/biolib/_internal/llm_instructions/.github/instructions/style-general.instructions.md +15 -0
- pybiolib-1.2.838/biolib/_internal/llm_instructions/.github/instructions/style-python.instructions.md +16 -0
- pybiolib-1.2.838/biolib/_internal/llm_instructions/.github/instructions/style-react-ts.instructions.md +22 -0
- pybiolib-1.2.838/biolib/_internal/llm_instructions/.github/prompts/biolib_app_inputs.prompt.md +11 -0
- pybiolib-1.2.838/biolib/_internal/llm_instructions/.github/prompts/biolib_run_apps.prompt.md +12 -0
- pybiolib-1.2.838/biolib/_internal/templates/__init__.py +1 -0
- pybiolib-1.2.838/biolib/_internal/templates/init_template/.biolib/config.yml +18 -0
- pybiolib-1.2.838/biolib/_internal/templates/init_template/.github/workflows/biolib.yml +13 -0
- pybiolib-1.2.838/biolib/_internal/templates/init_template/Dockerfile +11 -0
- pybiolib-1.2.838/biolib/_internal/templates/init_template/requirements.txt +1 -0
- pybiolib-1.2.838/biolib/_internal/templates/init_template/run.sh +2 -0
- pybiolib-1.2.838/biolib/_internal/templates/init_template/src/run.py +21 -0
- pybiolib-1.2.838/biolib/_internal/templates/templates.py +5 -0
- pybiolib-1.2.838/biolib/cli/init.py +89 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/pyproject.toml +1 -1
- pybiolib-1.2.802/biolib/_internal/llm_instructions/.github/instructions/code-style.md +0 -13
- pybiolib-1.2.802/biolib/_internal/llm_instructions/.github/instructions/copilot-instructions.md +0 -9
- pybiolib-1.2.802/biolib/_internal/llm_instructions/.github/prompts/biolib_app_inputs.prompt.md +0 -60
- pybiolib-1.2.802/biolib/_internal/llm_instructions/.github/prompts/biolib_run_apps.prompt.md +0 -302
- pybiolib-1.2.802/biolib/cli/init.py +0 -35
- pybiolib-1.2.802/biolib/templates/__init__.py +0 -1
- pybiolib-1.2.802/biolib/templates/example_app.py +0 -30
- {pybiolib-1.2.802 → pybiolib-1.2.838}/LICENSE +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/PYPI_README.md +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_data_record/data_record.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/data_record/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/data_record/data_record.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/data_record/push_data.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/data_record/remote_storage_endpoint.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/file_utils.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/fuse_mount/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/fuse_mount/experiment_fuse_mount.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/http_client.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/lfs/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/lfs/cache.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/libs/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/libs/fusepy/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/llm_instructions/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/push_application.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/runtime.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/tree_utils.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/app.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/data_record.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/experiment.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/file_node.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/push.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/resource.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/resource_permission.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/resource_version.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/result.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/types/typing.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/utils/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_internal/utils/multinode.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_runtime/runtime.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/_session/session.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/api/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/api/client.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/app/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/app/app.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/app/search_apps.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_api_client/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_api_client/api_client.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_api_client/app_types.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_api_client/auth.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_api_client/biolib_app_api.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_api_client/biolib_job_api.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_api_client/common_types.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_api_client/job_types.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_api_client/lfs_types.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_api_client/user_state.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/base_bbf_package.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/file_in_container.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/module_input.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/module_output_v2.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/remote_endpoints.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/remote_stream_seeker.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/saved_job.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/stdout_and_stderr.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/system_exception.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/system_status_update.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_binary_format/utils.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_docker_client/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_download_container.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_errors.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/biolib_logging.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/cli/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/cli/auth.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/cli/data_record.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/cli/download_container.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/cli/lfs.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/cli/push.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/cli/run.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/cli/runtime.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/cli/sdk.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/cli/start.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/.gitignore +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/cloud_utils/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/cloud_utils/cloud_utils.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/cache_state.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/cache_types.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/docker_image_cache.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/executors/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/executors/docker_executor.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/executors/docker_types.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/executors/tars/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/executors/types.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/job_legacy_input_wait_timeout_thread.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/job_max_runtime_timer_thread.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/job_storage.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/job_worker.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/large_file_system.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/mappings.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/utilization_reporter_thread.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/job_worker/utils.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/remote_host_proxy.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/socker_listener_thread.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/socket_sender_thread.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/utils.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/webserver/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/webserver/gunicorn_flask_application.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/webserver/webserver.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/webserver/webserver_types.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/webserver/webserver_utils.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/compute_node/webserver/worker_thread.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/experiments/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/experiments/experiment.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/jobs/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/jobs/job.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/jobs/job_result.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/jobs/types.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/py.typed +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/runtime/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/sdk/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/tables.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/typing_utils.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/user/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/user/sign_in.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/utils/__init__.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/utils/app_uri.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/utils/cache_state.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/utils/multipart_uploader.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/utils/seq_util.py +0 -0
- {pybiolib-1.2.802 → pybiolib-1.2.838}/biolib/utils/zip/remote_zip.py +0 -0
@@ -5,7 +5,7 @@ import sys
|
|
5
5
|
from biolib._internal import llm_instructions
|
6
6
|
|
7
7
|
|
8
|
-
def add_copilot_prompts(force: bool, silent: bool = False) -> None:
|
8
|
+
def add_copilot_prompts(force: bool, style: bool = True, silent: bool = False) -> None:
|
9
9
|
current_working_directory = os.getcwd()
|
10
10
|
config_file_path = f'{current_working_directory}/.biolib/config.yml'
|
11
11
|
if not os.path.exists(config_file_path):
|
@@ -19,12 +19,14 @@ Error: Current directory has not been initialized as a BioLib application.
|
|
19
19
|
|
20
20
|
conflicting_files = []
|
21
21
|
|
22
|
-
for root, _,
|
22
|
+
for root, _, filenames in os.walk(source_path):
|
23
23
|
relative_dir = os.path.relpath(root, source_path)
|
24
24
|
destination_dir = os.path.join(destination_path, relative_dir)
|
25
|
-
for
|
26
|
-
|
27
|
-
|
25
|
+
for filename in filenames:
|
26
|
+
if 'style' in filename and not style:
|
27
|
+
continue
|
28
|
+
source_file = os.path.join(root, filename)
|
29
|
+
destination_file = os.path.join(destination_dir, filename)
|
28
30
|
if os.path.exists(destination_file) and not force:
|
29
31
|
with open(source_file, 'rb') as fsrc, open(destination_file, 'rb') as fdest:
|
30
32
|
if fsrc.read() != fdest.read():
|
@@ -0,0 +1,10 @@
|
|
1
|
+
---
|
2
|
+
applyTo: "**"
|
3
|
+
---
|
4
|
+
|
5
|
+
You are writing code that runs inside a BioLib app. In general, most BioLib apps are structured such that there is a `run.py` or `main.py` file that contains the main function.
|
6
|
+
Other files are usually helper files that contain functions that are called from the main function.
|
7
|
+
|
8
|
+
BioLib apps often contain a Vite React Typescript project that compiles to a single HTML file used to render interactive and visual output.
|
9
|
+
|
10
|
+
BioLib apps run inside a Docker container, which is built from the `Dockerfile` in the root of the app.
|
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
applyTo: '**'
|
3
|
+
---
|
4
|
+
|
5
|
+
# General Coding Guidelines
|
6
|
+
- Variable names are allowed to be verbose, and should be descriptive.
|
7
|
+
- Unit tests are not necessary. Tests should instead be written as simple examples demonstrating the functionality of relevant functions.
|
8
|
+
- Always use 4 spaces for indentation.
|
9
|
+
- Function definitions should be typed as specifically as possible.
|
10
|
+
|
11
|
+
# Code Comment Guidelines
|
12
|
+
- Code comments should only be added for complex logic or unintuitive code that is not adequately explained by the function names themselves.
|
13
|
+
- Avoid comments that simply restate what the code does.
|
14
|
+
- When writing comments explaining some non-trivial logic, explain blocks of code rather than individual lines.
|
15
|
+
- Explain changes to the code in chat, not in comments.
|
pybiolib-1.2.838/biolib/_internal/llm_instructions/.github/instructions/style-python.instructions.md
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
---
|
2
|
+
applyTo: '**/*.py'
|
3
|
+
---
|
4
|
+
|
5
|
+
Apply the [general coding guidelines](./style-general.instructions.md) to all code.
|
6
|
+
|
7
|
+
# Python-specific code style guidelines
|
8
|
+
- Use snake_case for function and variable names, and PascalCase for class names.
|
9
|
+
- Place all imports at the top of the file, grouped in the following order: standard library imports, third-party imports, local application imports. Separate each group with a blank line.
|
10
|
+
- Limit all lines to a maximum of 120 characters.
|
11
|
+
- Prefer single quotes for strings unless the string contains a single quote, in which case use double quotes.
|
12
|
+
- Use blank lines to separate functions, class definitions, and logical sections within functions.
|
13
|
+
- Use type hints for function arguments and return values where possible.
|
14
|
+
- Use docstrings to document functions that are used in the main python script, but not elsewhere.
|
15
|
+
- Avoid using bare except clauses; always specify the exception being caught.
|
16
|
+
- Use list comprehensions and generator expressions where appropriate for clarity and conciseness.
|
@@ -0,0 +1,22 @@
|
|
1
|
+
---
|
2
|
+
applyTo: "**/*.ts,**/*.tsx"
|
3
|
+
---
|
4
|
+
|
5
|
+
Apply the [general coding guidelines](./style-general.instructions.md) to all code.
|
6
|
+
|
7
|
+
# General Project Guidelines
|
8
|
+
- Use yarn instead of npm whenever relevant.
|
9
|
+
- Prefer using `export default function` over exporting at the end of the file.
|
10
|
+
|
11
|
+
# TypeScript Guidelines
|
12
|
+
- Use TypeScript for all new code
|
13
|
+
- Follow functional programming principles where possible
|
14
|
+
- Use interfaces for data structures prefixed with I like `interface IRecord`
|
15
|
+
- Prefer immutable data (const, readonly)
|
16
|
+
- Use optional chaining (?.) and nullish coalescing (??) operators
|
17
|
+
|
18
|
+
# React Guidelines
|
19
|
+
- Use functional components with hooks
|
20
|
+
- Follow the React hooks rules (no conditional hooks)
|
21
|
+
- Prefer one component per file
|
22
|
+
- Use Tailwindcss for styling
|
pybiolib-1.2.838/biolib/_internal/llm_instructions/.github/prompts/biolib_app_inputs.prompt.md
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
mode: 'agent'
|
3
|
+
tools: ['codebase', 'fetch']
|
4
|
+
description: 'Handle changing inputs for a biolib app, by adding, removing or modifying inputs in the config.yml and the python script.'
|
5
|
+
---
|
6
|
+
|
7
|
+
# Main task
|
8
|
+
Your task is to make sure that all inputs are handled correctly in the give Python script and/or biolib config file.
|
9
|
+
Read the documentation [here](https://biolib.com/docs/building-applications/syntax-of-config-yml/) to understand how the inputs are handled in the config.yml file.
|
10
|
+
Inputs in the Python script should be parsed with argparse. If a default is given in the config.yml file, it it is not necessary to set a default in the Python script.
|
11
|
+
Otherwise, the two files should be consistent.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
---
|
2
|
+
mode: 'agent'
|
3
|
+
tools: ['githubRepo', 'codebase', 'fetch']
|
4
|
+
description: 'Handle running biolib apps, including login, running apps, and managing jobs and results.'
|
5
|
+
---
|
6
|
+
|
7
|
+
# Main task
|
8
|
+
Your task is to run one or more biolib apps, using the biolib Python API. You can find general instructions [here](https://biolib.com/docs/using-applications/python/)
|
9
|
+
A few relevant notes:
|
10
|
+
- You will be running this from inside a biolib app, so login is not necessary.
|
11
|
+
- Always look at the relevant app's #githubRepo. Ask the user for the repo, and inform them that it needs to be in the format `author/app_name`.
|
12
|
+
- If you do look at the repo, look at the config.yml to see how it expects inputs to be formatted.
|
@@ -0,0 +1 @@
|
|
1
|
+
from . import templates
|
@@ -0,0 +1,18 @@
|
|
1
|
+
biolib_version: 2
|
2
|
+
|
3
|
+
modules:
|
4
|
+
main:
|
5
|
+
image: 'local-docker://BIOLIB_REPLACE_DOCKER_TAG:latest'
|
6
|
+
command: "bash run.sh"
|
7
|
+
working_directory: /home/biolib/
|
8
|
+
input_files:
|
9
|
+
- COPY / /home/biolib/
|
10
|
+
output_files:
|
11
|
+
- COPY /home/biolib/output/ /
|
12
|
+
|
13
|
+
arguments:
|
14
|
+
-
|
15
|
+
key: --input
|
16
|
+
description: 'Input protein sequences'
|
17
|
+
type: sequence
|
18
|
+
required: true
|
@@ -0,0 +1,13 @@
|
|
1
|
+
name: BioLib Build & Push
|
2
|
+
on: push
|
3
|
+
jobs:
|
4
|
+
build-and-push:
|
5
|
+
runs-on: biolib-github-runner
|
6
|
+
steps:
|
7
|
+
- uses: actions/checkout@v4
|
8
|
+
- name: Build
|
9
|
+
run: docker build -t BIOLIB_REPLACE_DOCKER_TAG:latest .
|
10
|
+
- name: Push
|
11
|
+
run: biolib push $([ "$GITHUB_REF_NAME" != "main" ] && echo -n "--dev") BIOLIB_REPLACE_APP_URI
|
12
|
+
env:
|
13
|
+
BIOLIB_TOKEN: ${{ secrets.BIOLIB_TOKEN }}
|
@@ -0,0 +1 @@
|
|
1
|
+
pybiolib==BIOLIB_REPLACE_PYBIOLIB_VERSION
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import argparse
|
2
|
+
|
3
|
+
from biolib.sdk import Runtime
|
4
|
+
|
5
|
+
|
6
|
+
def parse_args():
|
7
|
+
parser = argparse.ArgumentParser(description='Process some biological sequences.')
|
8
|
+
parser.add_argument('--input', type=str, required=True, help='Input protein sequences')
|
9
|
+
return parser.parse_args()
|
10
|
+
|
11
|
+
|
12
|
+
def main(args):
|
13
|
+
sequence = args.input
|
14
|
+
# Add your processing logic here
|
15
|
+
print(f'Received sequence: {sequence}')
|
16
|
+
|
17
|
+
|
18
|
+
if __name__ == '__main__':
|
19
|
+
args = parse_args()
|
20
|
+
Runtime.set_result_name_prefix_from_fasta(args.input)
|
21
|
+
main(args)
|
@@ -0,0 +1,89 @@
|
|
1
|
+
import os
|
2
|
+
import shutil
|
3
|
+
import sys
|
4
|
+
|
5
|
+
import click
|
6
|
+
|
7
|
+
from biolib import utils # Import like this to let BASE_URL_IS_PUBLIC_BIOLIB be set correctly
|
8
|
+
from biolib._internal.add_copilot_prompts import add_copilot_prompts
|
9
|
+
from biolib._internal.templates import templates
|
10
|
+
from biolib.utils import BIOLIB_PACKAGE_VERSION
|
11
|
+
|
12
|
+
|
13
|
+
@click.command(help='Initialize a BioLib project', hidden=True)
|
14
|
+
def init() -> None:
|
15
|
+
cwd = os.getcwd()
|
16
|
+
|
17
|
+
app_uri = input('What URI do you want to create the application under? (leave blank to skip): ')
|
18
|
+
app_name = app_uri.split('/')[-1] if app_uri else None
|
19
|
+
if not app_uri:
|
20
|
+
print(
|
21
|
+
'Remember to set the app URI in the .biolib/config.yml file later, '
|
22
|
+
'and docker image name in the .biolib/config.yml and .github/workflows/biolib.yml files.'
|
23
|
+
)
|
24
|
+
copilot_input = input('Do you want to include Copilot style prompts? [y/N]: ')
|
25
|
+
include_copilot_style = copilot_input.lower() == 'y'
|
26
|
+
|
27
|
+
template_dir = templates.init_template()
|
28
|
+
conflicting_files = []
|
29
|
+
|
30
|
+
try:
|
31
|
+
# First pass: check for conflicts
|
32
|
+
for root, _, filenames in os.walk(template_dir):
|
33
|
+
relative_dir = os.path.relpath(root, template_dir)
|
34
|
+
destination_dir = cwd if relative_dir == '.' else os.path.join(cwd, relative_dir)
|
35
|
+
for filename in filenames:
|
36
|
+
source_file = os.path.join(root, filename)
|
37
|
+
destination_file = os.path.join(destination_dir, filename)
|
38
|
+
if os.path.exists(destination_file):
|
39
|
+
with open(source_file, 'rb') as fsrc, open(destination_file, 'rb') as fdest:
|
40
|
+
if fsrc.read() != fdest.read():
|
41
|
+
conflicting_files.append(os.path.relpath(destination_file, cwd))
|
42
|
+
if conflicting_files:
|
43
|
+
print('The following files were not overwritten. Use --force to override them:', file=sys.stderr)
|
44
|
+
for conflicting_file in conflicting_files:
|
45
|
+
print(f' {conflicting_file}', file=sys.stderr)
|
46
|
+
exit(1)
|
47
|
+
|
48
|
+
replace_app_uri = app_uri if app_uri else 'PUT_APP_URI_HERE'
|
49
|
+
|
50
|
+
# Second pass: copy files (only if no conflicts)
|
51
|
+
for root, _, filenames in os.walk(template_dir):
|
52
|
+
relative_dir = os.path.relpath(root, template_dir)
|
53
|
+
destination_dir = os.path.join(cwd, relative_dir)
|
54
|
+
os.makedirs(destination_dir, exist_ok=True)
|
55
|
+
|
56
|
+
for filename in filenames:
|
57
|
+
if utils.BASE_URL_IS_PUBLIC_BIOLIB and filename == 'biolib.yml':
|
58
|
+
continue
|
59
|
+
|
60
|
+
source_file = os.path.join(root, filename)
|
61
|
+
destination_file = os.path.join(destination_dir, filename)
|
62
|
+
|
63
|
+
if not os.path.exists(destination_file):
|
64
|
+
try:
|
65
|
+
with open(source_file) as f:
|
66
|
+
content = f.read()
|
67
|
+
|
68
|
+
new_content = content.replace('BIOLIB_REPLACE_PYBIOLIB_VERSION', BIOLIB_PACKAGE_VERSION)
|
69
|
+
new_content = new_content.replace('BIOLIB_REPLACE_APP_URI', replace_app_uri)
|
70
|
+
new_content = new_content.replace(
|
71
|
+
'BIOLIB_REPLACE_DOCKER_TAG',
|
72
|
+
app_name if app_name else 'PUT_DOCKER_TAG_HERE',
|
73
|
+
)
|
74
|
+
|
75
|
+
with open(destination_file, 'w') as f:
|
76
|
+
f.write(new_content)
|
77
|
+
except UnicodeDecodeError:
|
78
|
+
shutil.copy2(source_file, destination_file)
|
79
|
+
|
80
|
+
readme_path = os.path.join(cwd, 'README.md')
|
81
|
+
if not os.path.exists(readme_path) and app_name:
|
82
|
+
with open(readme_path, 'w') as readme_file:
|
83
|
+
readme_file.write(f'# {app_name}\n')
|
84
|
+
|
85
|
+
add_copilot_prompts(force=False, style=include_copilot_style, silent=True)
|
86
|
+
|
87
|
+
except KeyboardInterrupt:
|
88
|
+
print('\nInit command cancelled.', file=sys.stderr)
|
89
|
+
exit(1)
|
@@ -1,13 +0,0 @@
|
|
1
|
-
---
|
2
|
-
applyTo: '**'
|
3
|
-
---
|
4
|
-
|
5
|
-
Variable names are allowed to be verbose, and should be descriptive.
|
6
|
-
|
7
|
-
Code comments should only be added for complex logic or unintuitive code that is not adequately explained by the function names themselves.
|
8
|
-
|
9
|
-
Unit tests are not necessary. Tests should instead be written as simple examples demonstrating the functionality of relevant functions.
|
10
|
-
|
11
|
-
Always use 4 spaces for indentation.
|
12
|
-
|
13
|
-
Function definitions should be typed as specifically as possible.
|
pybiolib-1.2.802/biolib/_internal/llm_instructions/.github/instructions/copilot-instructions.md
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
---
|
2
|
-
applyTo: '**'
|
3
|
-
---
|
4
|
-
|
5
|
-
Use yarn instead of npm whenever relevant.
|
6
|
-
|
7
|
-
When running BioLib Apps, use [this file](../prompts/biolib_run_apps.prompt.md) as context to understand how that works.
|
8
|
-
|
9
|
-
When working with BioLib App inputs, use [this file](../prompts/biolib_app_inputs.prompt.md) as context to understand how the different files should be connected and formatted.
|
pybiolib-1.2.802/biolib/_internal/llm_instructions/.github/prompts/biolib_app_inputs.prompt.md
DELETED
@@ -1,60 +0,0 @@
|
|
1
|
-
# Main task
|
2
|
-
Your task is to make sure that all inputs are handled correctly in the give Python script and/or biolib config file.
|
3
|
-
|
4
|
-
Inputs are defined in the [config.yml](../../.biolib/config.yml) file and the main Python script, usually found in [run.py](../../run.py) or [main.py](../../main.py).
|
5
|
-
|
6
|
-
# Syntax of config.yml
|
7
|
-
The file config.yml contains the information needed to render and run an application on BioLib. This configuration defines the entry to your application and what input arguments the user can set. When you edit an application using the graphical interface on BioLib the config.yml file is automatically updated.
|
8
|
-
|
9
|
-
The config file and python script specify how input options and settings will be rendered to the user of the application, and how inputs will be parsed. The input field should follow this structure:
|
10
|
-
|
11
|
-
```
|
12
|
-
arguments:
|
13
|
-
- key: --data # required
|
14
|
-
description: 'Input Dropdown' # required
|
15
|
-
key_value_separator: ' ' # optional, default is ' '
|
16
|
-
default_value: '' # optional, default is ''
|
17
|
-
type: dropdown # required
|
18
|
-
options:
|
19
|
-
'This will be shown as option one': 'value1'
|
20
|
-
'This will be shown as option two': 'value2'
|
21
|
-
required: true # optional, default is true
|
22
|
-
```
|
23
|
-
|
24
|
-
Under `type` you have the following options:
|
25
|
-
|
26
|
-
* `text` provides a text input field
|
27
|
-
* `file` provides a file select where users can upload an input file
|
28
|
-
* `text-file` provides both a text input field and a file select allowing the user supply either
|
29
|
-
* `sequence` like text-file, with checks for valid FASTA input characters
|
30
|
-
* `hidden` allows the application creator to provide a default input argument without it being shown to the end-user
|
31
|
-
* `toggle` provides a toggle switch where users can choose two options. Note that the options need to be named 'on' : 'value1' and 'off': 'value2'
|
32
|
-
* `number` provides a number input field
|
33
|
-
* `radio` provides a "radio select" where users can select one amongst a number of prespecified options
|
34
|
-
* `dropdown` provides a dropdown menu where users can select one amongst a number of prespecified options
|
35
|
-
* `multiselect` provides a dropdown menu where users can select one or more prespecified options
|
36
|
-
|
37
|
-
`sub_arguments`: Allow you to specify arguments that are only rendered if a user chooses a particular option in the parent argument. For example, an application might allow the user to run one of two commands, where each of these commands would need different input arguments:
|
38
|
-
|
39
|
-
```
|
40
|
-
arguments:
|
41
|
-
- key: --function
|
42
|
-
description: 'Choose a function'
|
43
|
-
key_value_separator: ''
|
44
|
-
default_value: ''
|
45
|
-
type: dropdown
|
46
|
-
options:
|
47
|
-
'Command A': a
|
48
|
-
'Command B': b
|
49
|
-
sub_arguments:
|
50
|
-
a:
|
51
|
-
- key: --argument_a
|
52
|
-
description: "Argument A takes a file input"
|
53
|
-
type: file
|
54
|
-
b:
|
55
|
-
- key: --argument_b
|
56
|
-
description: 'Argument B takes a text input'
|
57
|
-
type: text
|
58
|
-
```
|
59
|
-
|
60
|
-
Inputs in the Python script should be parsed with argparse, and should also enshrine the same requirements and defaults such that use is identical between the frontend and Python.
|