tamarind-cli 0.5.1__tar.gz → 0.5.2__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.
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/PKG-INFO +6 -1
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/README.md +5 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/pyproject.toml +1 -1
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/jobs.py +27 -2
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/jobs.py +76 -4
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/resources.py +20 -6
- tamarind_cli-0.5.2/tests/test_org_job_lookup.py +252 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/.github/workflows/ci.yml +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/.github/workflows/publish.yml +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/.gitignore +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/LICENSE +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/docs/architecture.md +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/docs/custom-tools.md +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/install.sh +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/openapi/openapi-python-client.json +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/openapi/pipelines-openapi-python-client.json +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/openapi/pipelines-v1.json +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/openapi/pipelines-v1.lock.json +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/openapi/public-v1.json +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/openapi/public-v1.lock.json +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/scripts/check_custom_tools_provenance.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/scripts/sync_custom_tools_contract.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/scripts/sync_pipelines_contract.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/attribution.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/catalog.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/auth.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/catalog.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/custom_tools.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/commands/files.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/guidance.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/inputs.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/main.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/cli/output.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/config.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_contract.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/build_custom_tool.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/cancel_custom_tool_build.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/create_custom_tool.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/create_custom_tool_upload.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/delete_custom_tool.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/get_custom_tool.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/list_custom_tool_build_logs.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/list_custom_tool_versions.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/list_custom_tools.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/publish_custom_tool.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/custom_tools/update_custom_tool.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/client.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/errors.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_build_error.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_build_event.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_build_log_page.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_build_result.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_build_result_action.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_create_custom_tool_request.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_create_custom_tool_request_gputype.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_create_custom_tool_request_memory.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_create_version_request.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_detail.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_detail_gputype.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_detail_memory.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_gputype.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_memory.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_page.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_custom_tool_status.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_problem.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_problem_errors_type_0_item.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_update_custom_tool_request.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_update_custom_tool_request_gpu_type_type_0.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_update_custom_tool_request_memory_type_0.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_upload_session.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_upload_session_uploadheaders.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_version.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_version_page.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/public_version_status.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/types.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/client.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/packaging.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/resources.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/transport.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/validation.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/errors.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/http.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/api/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/api/pipelines_public/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/api/pipelines_public/get_run.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/api/pipelines_public/list_node_run_molecules.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/client.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/errors.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/__init__.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/node_run_status.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_node_run.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_node_run_molecule.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_node_run_molecule_page.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_node_run_molecule_scores.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_problem.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_problem_errors_type_0_item.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_run.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_run_inputs.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/run_status.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/source.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/types.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/resources.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/transport.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/py.typed +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/rest.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/uploads.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_agent_contract.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_attribution.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_batch_prevalidate.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_bugbash.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_catalog_examples.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_cli_commands.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_config.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_custom_tools_cli.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_custom_tools_generation.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_custom_tools_packaging.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_custom_tools_sdk.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_errors.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_file_filters.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_inputs.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_jobs.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_output.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_pep561.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_pipelines_sdk.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_rest.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/tests/test_sdk_resources.py +0 -0
- {tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/uv.lock +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: tamarind-cli
|
|
3
|
-
Version: 0.5.
|
|
3
|
+
Version: 0.5.2
|
|
4
4
|
Summary: Command-line interface AND Python SDK for the Tamarind Bio platform — submit, monitor, and download protein/molecule jobs from your terminal, scripts, or an AI agent.
|
|
5
5
|
Project-URL: Homepage, https://tamarind.bio
|
|
6
6
|
Project-URL: Documentation, https://app.tamarind.bio/api-docs
|
|
@@ -95,6 +95,11 @@ tamarind submit boltz --input job.yaml --name my-run \
|
|
|
95
95
|
tamarind jobs
|
|
96
96
|
tamarind status my-run
|
|
97
97
|
tamarind results my-run --download ./out
|
|
98
|
+
|
|
99
|
+
# A job run by another member of your organization
|
|
100
|
+
tamarind jobs --organization
|
|
101
|
+
tamarind status their-run --organization # or --email teammate@example.com
|
|
102
|
+
tamarind results their-run --organization --download ./out
|
|
98
103
|
```
|
|
99
104
|
|
|
100
105
|
Set individual fields inline instead of a file:
|
|
@@ -69,6 +69,11 @@ tamarind submit boltz --input job.yaml --name my-run \
|
|
|
69
69
|
tamarind jobs
|
|
70
70
|
tamarind status my-run
|
|
71
71
|
tamarind results my-run --download ./out
|
|
72
|
+
|
|
73
|
+
# A job run by another member of your organization
|
|
74
|
+
tamarind jobs --organization
|
|
75
|
+
tamarind status their-run --organization # or --email teammate@example.com
|
|
76
|
+
tamarind results their-run --organization --download ./out
|
|
72
77
|
```
|
|
73
78
|
|
|
74
79
|
Set individual fields inline instead of a file:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tamarind-cli"
|
|
3
|
-
version = "0.5.
|
|
3
|
+
version = "0.5.2"
|
|
4
4
|
description = "Command-line interface AND Python SDK for the Tamarind Bio platform — submit, monitor, and download protein/molecule jobs from your terminal, scripts, or an AI agent."
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
requires-python = ">=3.10"
|
|
@@ -20,6 +20,12 @@ from .. import output
|
|
|
20
20
|
from ..guidance import rewrite_validation_guidance
|
|
21
21
|
from ..inputs import effective_job_name, effective_job_type, resolve_job_input
|
|
22
22
|
|
|
23
|
+
_ORG_LOOKUP_HELP = (
|
|
24
|
+
"Find the job across your org's members (a name several members share, "
|
|
25
|
+
"and batch subjobs, need --email)."
|
|
26
|
+
)
|
|
27
|
+
_EMAIL_LOOKUP_HELP = "The job belongs to this org member."
|
|
28
|
+
|
|
23
29
|
|
|
24
30
|
def _gen_name(tool: str) -> str:
|
|
25
31
|
return f"{tool}-{uuid.uuid4().hex[:8]}"
|
|
@@ -677,11 +683,15 @@ def register(app: typer.Typer) -> None:
|
|
|
677
683
|
def status(
|
|
678
684
|
ctx: typer.Context,
|
|
679
685
|
job_name: str = typer.Argument(..., help="Job name."),
|
|
686
|
+
organization: bool = typer.Option(False, "--organization", help=_ORG_LOOKUP_HELP),
|
|
687
|
+
email: Optional[str] = typer.Option(None, "--email", help=_EMAIL_LOOKUP_HELP),
|
|
680
688
|
) -> None:
|
|
681
689
|
"""Show one job's current status and metadata."""
|
|
682
690
|
state = ctx.obj
|
|
683
691
|
with state.rest_client() as client:
|
|
684
|
-
job = jobs_helpers.fetch_job(
|
|
692
|
+
job = jobs_helpers.fetch_job(
|
|
693
|
+
client, job_name, organization=organization, job_email=email
|
|
694
|
+
)
|
|
685
695
|
output.emit(
|
|
686
696
|
_sanitize_job_output(job),
|
|
687
697
|
state.output,
|
|
@@ -694,6 +704,8 @@ def register(app: typer.Typer) -> None:
|
|
|
694
704
|
job_name: str = typer.Argument(..., help="Job name."),
|
|
695
705
|
poll_interval: float = typer.Option(10.0, "--poll-interval", help="Seconds between polls."),
|
|
696
706
|
timeout: Optional[float] = typer.Option(None, "--timeout", help="Give up after N seconds."),
|
|
707
|
+
organization: bool = typer.Option(False, "--organization", help=_ORG_LOOKUP_HELP),
|
|
708
|
+
email: Optional[str] = typer.Option(None, "--email", help=_EMAIL_LOOKUP_HELP),
|
|
697
709
|
) -> None:
|
|
698
710
|
"""Block until a job reaches a terminal state."""
|
|
699
711
|
state = ctx.obj
|
|
@@ -704,6 +716,8 @@ def register(app: typer.Typer) -> None:
|
|
|
704
716
|
poll_interval=poll_interval,
|
|
705
717
|
timeout=timeout,
|
|
706
718
|
on_poll=lambda j: output.info(f" status: {jobs_helpers.job_status(j)}", state.output),
|
|
719
|
+
organization=organization,
|
|
720
|
+
job_email=email,
|
|
707
721
|
)
|
|
708
722
|
output.emit(
|
|
709
723
|
_sanitize_job_output(final),
|
|
@@ -728,6 +742,8 @@ def register(app: typer.Typer) -> None:
|
|
|
728
742
|
wait: bool = typer.Option(False, "--wait", help="Wait for the job to finish first."),
|
|
729
743
|
poll_interval: float = typer.Option(10.0, "--poll-interval", help="Seconds between polls when --wait."),
|
|
730
744
|
timeout: Optional[float] = typer.Option(None, "--timeout", help="With --wait, give up after N seconds."),
|
|
745
|
+
organization: bool = typer.Option(False, "--organization", help=_ORG_LOOKUP_HELP),
|
|
746
|
+
email: Optional[str] = typer.Option(None, "--email", help=_EMAIL_LOOKUP_HELP),
|
|
731
747
|
) -> None:
|
|
732
748
|
"""Download results, or explicitly request a credential-bearing URL."""
|
|
733
749
|
state = ctx.obj
|
|
@@ -750,6 +766,8 @@ def register(app: typer.Typer) -> None:
|
|
|
750
766
|
on_poll=lambda j: output.info(
|
|
751
767
|
f" status: {jobs_helpers.job_status(j)}", state.output
|
|
752
768
|
),
|
|
769
|
+
organization=organization,
|
|
770
|
+
job_email=email,
|
|
753
771
|
)
|
|
754
772
|
if _failed_terminal(final):
|
|
755
773
|
result = {
|
|
@@ -762,9 +780,16 @@ def register(app: typer.Typer) -> None:
|
|
|
762
780
|
human=f"{job_name}: {jobs_helpers.job_status(final)}",
|
|
763
781
|
)
|
|
764
782
|
raise typer.Exit(ExitCode.JOB_FAILED)
|
|
783
|
+
owner = jobs_helpers.resolve_owner(
|
|
784
|
+
client, job_name, organization=organization, job_email=email, job=final
|
|
785
|
+
)
|
|
765
786
|
url = _result_url(
|
|
766
787
|
rest.get_result(
|
|
767
|
-
client,
|
|
788
|
+
client,
|
|
789
|
+
job_name=job_name,
|
|
790
|
+
job_email=owner,
|
|
791
|
+
file_name=file,
|
|
792
|
+
pdbs_only=pdbs_only or None,
|
|
768
793
|
)
|
|
769
794
|
)
|
|
770
795
|
result = {"jobName": job_name}
|
|
@@ -73,16 +73,77 @@ def is_success(status: str | None) -> bool:
|
|
|
73
73
|
|
|
74
74
|
|
|
75
75
|
def fetch_job(
|
|
76
|
-
client: HTTPClient,
|
|
76
|
+
client: HTTPClient,
|
|
77
|
+
name: str,
|
|
78
|
+
*,
|
|
79
|
+
organization: bool = False,
|
|
80
|
+
job_email: str | None = None,
|
|
81
|
+
timeout: float | None = None,
|
|
77
82
|
) -> dict[str, Any]:
|
|
78
|
-
"""Fetch a single job by name. Raises NotFoundError if it doesn't exist.
|
|
79
|
-
|
|
83
|
+
"""Fetch a single job by name. Raises NotFoundError if it doesn't exist.
|
|
84
|
+
|
|
85
|
+
``organization`` searches every org member visible to the caller and refuses a name that
|
|
86
|
+
several members share; ``job_email`` reads one named member's job.
|
|
87
|
+
"""
|
|
88
|
+
if job_email is not None and not job_email.strip():
|
|
89
|
+
raise ValidationError("Job owner email may not be blank.")
|
|
90
|
+
try:
|
|
91
|
+
resp = rest.get_jobs(
|
|
92
|
+
client, job_name=name, organization=organization, job_email=job_email, timeout=timeout
|
|
93
|
+
)
|
|
94
|
+
except NotFoundError as exc:
|
|
95
|
+
if organization and job_email is None:
|
|
96
|
+
# The org-wide name search skips batch subjobs and pipeline steps.
|
|
97
|
+
exc.message = f"{exc.message} Batch subjobs and pipeline steps need the owner's email."
|
|
98
|
+
raise
|
|
99
|
+
if organization and job_email is None:
|
|
100
|
+
owners = _matching_owners(resp, name)
|
|
101
|
+
if len(owners) > 1:
|
|
102
|
+
# A usage problem, not a transport one: typed so `wait` never reports it as a timeout.
|
|
103
|
+
raise ValidationError(
|
|
104
|
+
f"Job '{name}' matches jobs from {len(owners)} org members "
|
|
105
|
+
f"({', '.join(owners)}); pass the owner's email."
|
|
106
|
+
)
|
|
80
107
|
job = _extract_single(resp, name)
|
|
81
108
|
if job is None:
|
|
82
109
|
raise NotFoundError(f"Job '{name}' not found")
|
|
83
110
|
return job
|
|
84
111
|
|
|
85
112
|
|
|
113
|
+
def _matching_owners(resp: Any, name: str) -> list[str]:
|
|
114
|
+
if not isinstance(resp, dict):
|
|
115
|
+
return []
|
|
116
|
+
rows = resp.get("jobs") if "jobs" in resp else [
|
|
117
|
+
v for k, v in resp.items() if k.isdigit() and isinstance(v, dict)
|
|
118
|
+
]
|
|
119
|
+
return sorted({
|
|
120
|
+
str(r["User"]) for r in rows or [] if job_name(r) == name and r.get("User")
|
|
121
|
+
})
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def resolve_owner(
|
|
125
|
+
client: HTTPClient,
|
|
126
|
+
name: str,
|
|
127
|
+
*,
|
|
128
|
+
organization: bool = False,
|
|
129
|
+
job_email: str | None = None,
|
|
130
|
+
job: dict[str, Any] | None = None,
|
|
131
|
+
) -> str | None:
|
|
132
|
+
"""The stored owner email of another member's job, or None for the caller's own job.
|
|
133
|
+
|
|
134
|
+
Read from the job row because ``/result`` matches the owner exactly and has no
|
|
135
|
+
org-wide mode.
|
|
136
|
+
"""
|
|
137
|
+
if not organization and job_email is None:
|
|
138
|
+
return None
|
|
139
|
+
if job is None:
|
|
140
|
+
job = fetch_job(client, name, organization=organization, job_email=job_email)
|
|
141
|
+
owner = job.get("User") or job_email
|
|
142
|
+
if not owner:
|
|
143
|
+
raise TamarindError(f"Could not resolve the owner of job '{name}'.")
|
|
144
|
+
return str(owner)
|
|
145
|
+
|
|
146
|
+
|
|
86
147
|
def _extract_single(resp: Any, name: str) -> dict[str, Any] | None:
|
|
87
148
|
if not isinstance(resp, dict):
|
|
88
149
|
return None
|
|
@@ -129,6 +190,8 @@ def wait_for_job(
|
|
|
129
190
|
poll_interval: float = 10.0,
|
|
130
191
|
timeout: float | None = None,
|
|
131
192
|
on_poll: Callable[[dict[str, Any]], None] | None = None,
|
|
193
|
+
organization: bool = False,
|
|
194
|
+
job_email: str | None = None,
|
|
132
195
|
) -> dict[str, Any]:
|
|
133
196
|
"""Block until ``name`` reaches a terminal status (or ``timeout`` elapses).
|
|
134
197
|
|
|
@@ -147,7 +210,13 @@ def wait_for_job(
|
|
|
147
210
|
f"Job '{name}'{status_text} after {timeout:.0f}s"
|
|
148
211
|
)
|
|
149
212
|
try:
|
|
150
|
-
job = fetch_job(
|
|
213
|
+
job = fetch_job(
|
|
214
|
+
client,
|
|
215
|
+
name,
|
|
216
|
+
organization=organization,
|
|
217
|
+
job_email=job_email,
|
|
218
|
+
timeout=remaining,
|
|
219
|
+
)
|
|
151
220
|
except TamarindError as exc:
|
|
152
221
|
# Only a generic transport timeout is eligible for deadline
|
|
153
222
|
# translation. Preserve typed API failures (auth, budget, rate
|
|
@@ -162,6 +231,9 @@ def wait_for_job(
|
|
|
162
231
|
f"Job '{name}' did not return status before the {timeout:.0f}s deadline"
|
|
163
232
|
) from exc
|
|
164
233
|
raise
|
|
234
|
+
if organization and job_email is None and job.get("User"):
|
|
235
|
+
# Pin the first match so a same-named job submitted mid-wait can't take over.
|
|
236
|
+
job_email, organization = str(job["User"]), False
|
|
165
237
|
if on_poll is not None:
|
|
166
238
|
on_poll(job)
|
|
167
239
|
last_status = job_status(job)
|
|
@@ -13,7 +13,7 @@ from typing import Any, Callable
|
|
|
13
13
|
|
|
14
14
|
from . import catalog, rest, uploads
|
|
15
15
|
from .http import HTTPClient
|
|
16
|
-
from .jobs import fetch_job, wait_for_job
|
|
16
|
+
from .jobs import fetch_job, resolve_owner, wait_for_job
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
class Jobs:
|
|
@@ -50,22 +50,36 @@ class Jobs:
|
|
|
50
50
|
"""List jobs (GET /jobs). Accepts the same filters as :func:`tamarind.rest.get_jobs`."""
|
|
51
51
|
return rest.get_jobs(self._http, **kwargs)
|
|
52
52
|
|
|
53
|
-
def status(
|
|
53
|
+
def status(
|
|
54
|
+
self, name: str, *, organization: bool = False, job_email: str | None = None,
|
|
55
|
+
timeout: float | None = None,
|
|
56
|
+
) -> dict[str, Any]:
|
|
54
57
|
"""Fetch one job by name (raises NotFoundError if absent)."""
|
|
55
|
-
return fetch_job(
|
|
58
|
+
return fetch_job(
|
|
59
|
+
self._http, name, organization=organization, job_email=job_email, timeout=timeout
|
|
60
|
+
)
|
|
56
61
|
|
|
57
62
|
def wait(
|
|
58
63
|
self, name: str, *, poll_interval: float = 10.0, timeout: float | None = None,
|
|
59
64
|
on_poll: Callable[[dict[str, Any]], None] | None = None,
|
|
65
|
+
organization: bool = False, job_email: str | None = None,
|
|
60
66
|
) -> dict[str, Any]:
|
|
61
67
|
"""Block until ``name`` reaches a terminal status; returns the final job."""
|
|
62
|
-
return wait_for_job(
|
|
68
|
+
return wait_for_job(
|
|
69
|
+
self._http, name, poll_interval=poll_interval, timeout=timeout, on_poll=on_poll,
|
|
70
|
+
organization=organization, job_email=job_email,
|
|
71
|
+
)
|
|
63
72
|
|
|
64
73
|
def results(
|
|
65
74
|
self, name: str, *, job_email: str | None = None, file_name: str | None = None,
|
|
66
|
-
pdbs_only: bool | None = None,
|
|
75
|
+
pdbs_only: bool | None = None, organization: bool = False,
|
|
67
76
|
) -> Any:
|
|
68
|
-
"""Get a presigned result URL (POST /result).
|
|
77
|
+
"""Get a presigned result URL (POST /result).
|
|
78
|
+
|
|
79
|
+
``organization`` finds the owner across your org's members first.
|
|
80
|
+
"""
|
|
81
|
+
if organization and job_email is None:
|
|
82
|
+
job_email = resolve_owner(self._http, name, organization=True)
|
|
69
83
|
return rest.get_result(
|
|
70
84
|
self._http, job_name=name, job_email=job_email, file_name=file_name, pdbs_only=pdbs_only,
|
|
71
85
|
)
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
"""`status` / `wait` / `results` can address a job owned by another org member."""
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
|
|
5
|
+
import httpx
|
|
6
|
+
import pytest
|
|
7
|
+
import respx
|
|
8
|
+
from typer.testing import CliRunner
|
|
9
|
+
|
|
10
|
+
from tamarind import Tamarind
|
|
11
|
+
from tamarind.cli.main import app
|
|
12
|
+
from tamarind import jobs as jh
|
|
13
|
+
from tamarind.errors import NotFoundError, ValidationError
|
|
14
|
+
|
|
15
|
+
runner = CliRunner()
|
|
16
|
+
|
|
17
|
+
API = "https://api.test/"
|
|
18
|
+
ENV = {"TAMARIND_API_KEY": "k", "TAMARIND_API_BASE": API}
|
|
19
|
+
MEMBER = "member@example.com"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def _job(status="Complete", user=MEMBER):
|
|
23
|
+
row = {"JobName": "job-1", "Type": "boltz", "JobStatus": status}
|
|
24
|
+
if user is not None:
|
|
25
|
+
row["User"] = user
|
|
26
|
+
return {"0": row, "statuses": {status: 1}}
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
@respx.mock
|
|
30
|
+
def test_status_organization_sends_org_lookup():
|
|
31
|
+
route = respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job()))
|
|
32
|
+
|
|
33
|
+
res = runner.invoke(app, ["--json", "status", "job-1", "--organization"], env=ENV)
|
|
34
|
+
|
|
35
|
+
assert res.exit_code == 0, res.stdout
|
|
36
|
+
params = route.calls.last.request.url.params
|
|
37
|
+
assert params["jobName"] == "job-1"
|
|
38
|
+
assert params["organization"] == "true"
|
|
39
|
+
assert "jobEmail" not in params
|
|
40
|
+
assert json.loads(res.stdout)["User"] == MEMBER
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@respx.mock
|
|
44
|
+
def test_status_email_sends_member_lookup():
|
|
45
|
+
route = respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job()))
|
|
46
|
+
|
|
47
|
+
res = runner.invoke(app, ["--json", "status", "job-1", "--email", MEMBER], env=ENV)
|
|
48
|
+
|
|
49
|
+
assert res.exit_code == 0, res.stdout
|
|
50
|
+
params = route.calls.last.request.url.params
|
|
51
|
+
assert params["jobEmail"] == MEMBER
|
|
52
|
+
assert "organization" not in params
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@respx.mock
|
|
56
|
+
def test_status_default_stays_caller_scoped():
|
|
57
|
+
route = respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job(user=None)))
|
|
58
|
+
|
|
59
|
+
res = runner.invoke(app, ["--json", "status", "job-1"], env=ENV)
|
|
60
|
+
|
|
61
|
+
assert res.exit_code == 0, res.stdout
|
|
62
|
+
params = route.calls.last.request.url.params
|
|
63
|
+
assert "organization" not in params
|
|
64
|
+
assert "jobEmail" not in params
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@respx.mock
|
|
68
|
+
def test_wait_organization_polls_org_lookup():
|
|
69
|
+
route = respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job()))
|
|
70
|
+
|
|
71
|
+
res = runner.invoke(
|
|
72
|
+
app, ["--json", "wait", "job-1", "--organization", "--poll-interval", "0"], env=ENV
|
|
73
|
+
)
|
|
74
|
+
|
|
75
|
+
assert res.exit_code == 0, res.stdout
|
|
76
|
+
assert route.calls.last.request.url.params["organization"] == "true"
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
@respx.mock
|
|
80
|
+
def test_results_organization_resolves_owner_then_requests_their_result():
|
|
81
|
+
jobs = respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job()))
|
|
82
|
+
result = respx.post(f"{API}result").mock(
|
|
83
|
+
return_value=httpx.Response(200, json="https://storage.test/r.zip?signature=s")
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
res = runner.invoke(
|
|
87
|
+
app, ["--json", "results", "job-1", "--organization", "--show-url"], env=ENV
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
assert res.exit_code == 0, res.stdout
|
|
91
|
+
assert jobs.calls.last.request.url.params["organization"] == "true"
|
|
92
|
+
assert json.loads(result.calls.last.request.content) == {
|
|
93
|
+
"jobName": "job-1",
|
|
94
|
+
"jobEmail": MEMBER,
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
@respx.mock
|
|
99
|
+
def test_results_email_sends_the_stored_owner_not_the_typed_one():
|
|
100
|
+
jobs = respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job()))
|
|
101
|
+
result = respx.post(f"{API}result").mock(
|
|
102
|
+
return_value=httpx.Response(200, json="https://storage.test/r.zip?signature=s")
|
|
103
|
+
)
|
|
104
|
+
|
|
105
|
+
res = runner.invoke(
|
|
106
|
+
app, ["--json", "results", "job-1", "--email", MEMBER.upper(), "--show-url"], env=ENV
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
assert res.exit_code == 0, res.stdout
|
|
110
|
+
assert jobs.calls.last.request.url.params["jobEmail"] == MEMBER.upper()
|
|
111
|
+
assert json.loads(result.calls.last.request.content)["jobEmail"] == MEMBER
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
@respx.mock
|
|
115
|
+
def test_blank_email_is_refused_before_any_request():
|
|
116
|
+
jobs = respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job()))
|
|
117
|
+
result = respx.post(f"{API}result").mock(
|
|
118
|
+
return_value=httpx.Response(200, json="https://storage.test/r.zip?signature=s")
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
for cmd in (["status", "job-1"], ["results", "job-1", "--show-url"]):
|
|
122
|
+
res = runner.invoke(app, ["--json", *cmd, "--email", " "], env=ENV)
|
|
123
|
+
assert res.exit_code != 0
|
|
124
|
+
|
|
125
|
+
assert not jobs.called
|
|
126
|
+
assert not result.called
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
@respx.mock
|
|
130
|
+
def test_wait_organization_pins_the_first_match():
|
|
131
|
+
route = respx.get(f"{API}jobs").mock(
|
|
132
|
+
side_effect=[
|
|
133
|
+
httpx.Response(200, json=_job(status="Running")),
|
|
134
|
+
httpx.Response(200, json=_job(status="Complete")),
|
|
135
|
+
]
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
res = runner.invoke(
|
|
139
|
+
app, ["--json", "wait", "job-1", "--organization", "--poll-interval", "0"], env=ENV
|
|
140
|
+
)
|
|
141
|
+
|
|
142
|
+
assert res.exit_code == 0, res.stdout
|
|
143
|
+
first, second = (call.request.url.params for call in route.calls)
|
|
144
|
+
assert first["organization"] == "true" and "jobEmail" not in first
|
|
145
|
+
assert second["jobEmail"] == MEMBER and "organization" not in second
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
@respx.mock
|
|
149
|
+
def test_organization_not_found_points_at_email():
|
|
150
|
+
respx.get(f"{API}jobs").mock(
|
|
151
|
+
return_value=httpx.Response(404, json={"error": "Job job-1 not found"})
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
with Tamarind(api_key="k", api_base=API) as tm:
|
|
155
|
+
try:
|
|
156
|
+
tm.jobs.status("job-1", organization=True)
|
|
157
|
+
except NotFoundError as exc:
|
|
158
|
+
assert "owner's email" in exc.message
|
|
159
|
+
else:
|
|
160
|
+
raise AssertionError("expected NotFoundError")
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
@respx.mock
|
|
164
|
+
def test_sdk_results_organization_resolves_owner():
|
|
165
|
+
respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job()))
|
|
166
|
+
result = respx.post(f"{API}result").mock(
|
|
167
|
+
return_value=httpx.Response(200, json="https://storage.test/r.zip?signature=s")
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
with Tamarind(api_key="k", api_base=API) as tm:
|
|
171
|
+
tm.jobs.results("job-1", organization=True)
|
|
172
|
+
|
|
173
|
+
assert json.loads(result.calls.last.request.content)["jobEmail"] == MEMBER
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
@respx.mock
|
|
177
|
+
def test_results_organization_without_owner_refuses_before_requesting_result():
|
|
178
|
+
respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job(user=None)))
|
|
179
|
+
result = respx.post(f"{API}result").mock(
|
|
180
|
+
return_value=httpx.Response(200, json="https://storage.test/r.zip?signature=s")
|
|
181
|
+
)
|
|
182
|
+
|
|
183
|
+
res = runner.invoke(
|
|
184
|
+
app, ["--json", "results", "job-1", "--organization", "--show-url"], env=ENV
|
|
185
|
+
)
|
|
186
|
+
|
|
187
|
+
assert res.exit_code != 0
|
|
188
|
+
assert not result.called
|
|
189
|
+
|
|
190
|
+
|
|
191
|
+
@respx.mock
|
|
192
|
+
def test_sdk_status_forwards_org_scope():
|
|
193
|
+
route = respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job()))
|
|
194
|
+
|
|
195
|
+
with Tamarind(api_key="k", api_base=API) as tm:
|
|
196
|
+
job = tm.jobs.status("job-1", organization=True)
|
|
197
|
+
|
|
198
|
+
assert job["User"] == MEMBER
|
|
199
|
+
assert route.calls.last.request.url.params["organization"] == "true"
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
@respx.mock
|
|
203
|
+
def test_organization_name_shared_by_two_members_is_refused():
|
|
204
|
+
other = "other@example.com"
|
|
205
|
+
collision = {
|
|
206
|
+
"0": {"JobName": "job-1", "JobStatus": "Complete", "User": other},
|
|
207
|
+
"1": {"JobName": "job-1", "JobStatus": "Complete", "User": MEMBER},
|
|
208
|
+
"statuses": {"Complete": 2},
|
|
209
|
+
}
|
|
210
|
+
respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=collision))
|
|
211
|
+
result = respx.post(f"{API}result").mock(
|
|
212
|
+
return_value=httpx.Response(200, json="https://storage.test/r.zip?signature=s")
|
|
213
|
+
)
|
|
214
|
+
|
|
215
|
+
for cmd in (["status", "job-1"], ["results", "job-1", "--show-url"]):
|
|
216
|
+
res = runner.invoke(app, ["--json", *cmd, "--organization"], env=ENV)
|
|
217
|
+
assert isinstance(res.exception, ValidationError)
|
|
218
|
+
assert "pass the owner's email" in str(res.exception)
|
|
219
|
+
|
|
220
|
+
assert not result.called
|
|
221
|
+
|
|
222
|
+
|
|
223
|
+
@respx.mock
|
|
224
|
+
def test_results_email_falls_back_to_the_given_owner_when_user_is_absent():
|
|
225
|
+
respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=_job(user=None)))
|
|
226
|
+
result = respx.post(f"{API}result").mock(
|
|
227
|
+
return_value=httpx.Response(200, json="https://storage.test/r.zip?signature=s")
|
|
228
|
+
)
|
|
229
|
+
|
|
230
|
+
res = runner.invoke(
|
|
231
|
+
app, ["--json", "results", "job-1", "--email", MEMBER, "--show-url"], env=ENV
|
|
232
|
+
)
|
|
233
|
+
|
|
234
|
+
assert res.exit_code == 0, res.stdout
|
|
235
|
+
assert json.loads(result.calls.last.request.content)["jobEmail"] == MEMBER
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
@respx.mock
|
|
239
|
+
def test_wait_does_not_report_an_owner_collision_as_a_timeout(monkeypatch):
|
|
240
|
+
collision = {
|
|
241
|
+
"0": {"JobName": "job-1", "JobStatus": "Running", "User": "other@example.com"},
|
|
242
|
+
"1": {"JobName": "job-1", "JobStatus": "Running", "User": MEMBER},
|
|
243
|
+
"statuses": {"Running": 2},
|
|
244
|
+
}
|
|
245
|
+
respx.get(f"{API}jobs").mock(return_value=httpx.Response(200, json=collision))
|
|
246
|
+
# The response lands after the wait deadline has passed.
|
|
247
|
+
ticks = iter([0.0, 0.1, 2.0])
|
|
248
|
+
monkeypatch.setattr(jh.time, "monotonic", lambda: next(ticks))
|
|
249
|
+
|
|
250
|
+
with Tamarind(api_key="k", api_base=API) as tm:
|
|
251
|
+
with pytest.raises(ValidationError, match="pass the owner's email"):
|
|
252
|
+
tm.jobs.wait("job-1", organization=True, timeout=1.0)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/api/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/custom_tools/_generated/models/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_problem.py
RENAMED
|
File without changes
|
|
File without changes
|
{tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/public_run.py
RENAMED
|
File without changes
|
|
File without changes
|
{tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/run_status.py
RENAMED
|
File without changes
|
{tamarind_cli-0.5.1 → tamarind_cli-0.5.2}/src/tamarind/pipelines/_generated/models/source.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|