haplohub-cli 3.2.0__tar.gz → 3.2.1__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.
- {haplohub_cli-3.2.0/haplohub_cli.egg-info → haplohub_cli-3.2.1}/PKG-INFO +1 -1
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/_version.py +3 -3
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/algorithm/result/__init__.py +15 -3
- haplohub_cli-3.2.1/haplohub_cli/commands/algorithm/tests/test_result_create.py +50 -0
- haplohub_cli-3.2.1/haplohub_cli/types/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1/haplohub_cli.egg-info}/PKG-INFO +1 -1
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli.egg-info/SOURCES.txt +2 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli.egg-info/scm_file_list.json +2 -0
- haplohub_cli-3.2.1/haplohub_cli.egg-info/scm_version.json +8 -0
- haplohub_cli-3.2.0/haplohub_cli.egg-info/scm_version.json +0 -8
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/.github/dependabot.yml +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/.github/workflows/on_pr.yml +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/.github/workflows/on_push_main.yml +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/.gitignore +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/.pre-commit-config.yaml +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/AGENTS.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/CLAUDE.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/README.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/docs/index.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/docs/release.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/docs/sdk-coupling.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/docs/stage-verification.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/docs/testing.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/auth/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/auth/auth.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/auth/auth_web_server.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/auth/oauth_client.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/auth/tests/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/auth/tests/test_auth_web_server.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/auth/tests/test_token_storage.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/auth/token_storage.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/cli.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/algorithm/__init__.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/commands/cohort → haplohub_cli-3.2.1/haplohub_cli/commands/algorithm}/tests/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/cohort/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/cohort/biomarker.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/cohort/member/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/cohort/member/report.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/cohort/sample.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/commands → haplohub_cli-3.2.1/haplohub_cli/commands/cohort}/tests/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/cohort/tests/test_delete.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/config.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/file.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/login.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/metadata/__init__.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/config → haplohub_cli-3.2.1/haplohub_cli/commands/tests}/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/tests/test_file.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/variant.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/version.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/core/api → haplohub_cli-3.2.1/haplohub_cli/config}/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/config/config.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/config/config_manager.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/__init__.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/core/tests → haplohub_cli-3.2.1/haplohub_cli/core/api}/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/api/client.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/checksum.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/deletion.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/network.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/slug.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/formatters → haplohub_cli-3.2.1/haplohub_cli/core}/tests/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/tests/test_checksum.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/tests/test_network.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/tests/test_slug.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/types.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/core/upload.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/algorithm.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/algorithm_result.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/biomarker.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/config.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/decorators.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/file.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/formatter_registry.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/generic.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/generic_table.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli → haplohub_cli-3.2.1/haplohub_cli/formatters}/tests/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/tests/test_generic_table.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/utils.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/variant.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/settings.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/types → haplohub_cli-3.2.1/haplohub_cli/tests}/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/tests/test_cli.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/types/variant_range.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli.egg-info/dependency_links.txt +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli.egg-info/entry_points.txt +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli.egg-info/requires.txt +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli.egg-info/top_level.txt +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/pyproject.toml +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/setup.cfg +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/uv.lock +0 -0
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '3.2.
|
|
22
|
-
__version_tuple__ = version_tuple = (3, 2,
|
|
21
|
+
__version__ = version = '3.2.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (3, 2, 1)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g3cb30f685'
|
{haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/commands/algorithm/result/__init__.py
RENAMED
|
@@ -50,8 +50,14 @@ def get(id):
|
|
|
50
50
|
@click.option("--cohort", "-c", type=types.HAPLOHUB_ID, required=True, help="The ID of the cohort")
|
|
51
51
|
@click.option("--member", "-m", type=types.HAPLOHUB_ID, required=False, help="The member id (its latest sample is scored)")
|
|
52
52
|
@click.option("--sample", "-s", type=types.HAPLOHUB_ID, required=False, help="The sample id to run on")
|
|
53
|
-
@click.option(
|
|
54
|
-
|
|
53
|
+
@click.option(
|
|
54
|
+
"--input-json",
|
|
55
|
+
"-i",
|
|
56
|
+
metavar="JSON",
|
|
57
|
+
required=False,
|
|
58
|
+
help="""The algorithm input as an inline JSON string, e.g. '{"pgs_model_ids": "PGS000001"}'""",
|
|
59
|
+
)
|
|
60
|
+
@click.option("--input-file", "-f", type=types.FILE_PATH, required=False, help="Path to a JSON file with the algorithm input")
|
|
55
61
|
def create(
|
|
56
62
|
algorithm: str,
|
|
57
63
|
cohort: str,
|
|
@@ -65,7 +71,13 @@ def create(
|
|
|
65
71
|
raise click.ClickException("Only one of --input-json or --input-file can be provided")
|
|
66
72
|
|
|
67
73
|
if input_json is not None:
|
|
68
|
-
|
|
74
|
+
try:
|
|
75
|
+
input_data = json.loads(input_json)
|
|
76
|
+
except json.JSONDecodeError as e:
|
|
77
|
+
raise click.BadParameter(
|
|
78
|
+
f"not valid JSON ({e.msg}). To read the input from a file, use --input-file.",
|
|
79
|
+
param_hint="--input-json",
|
|
80
|
+
) from e
|
|
69
81
|
elif input_file is not None:
|
|
70
82
|
with open(input_file, "r") as f:
|
|
71
83
|
input_data = json.load(f)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import tempfile
|
|
3
|
+
from unittest import TestCase
|
|
4
|
+
from unittest.mock import patch
|
|
5
|
+
|
|
6
|
+
from click.testing import CliRunner
|
|
7
|
+
|
|
8
|
+
from haplohub_cli.commands.algorithm.result import create
|
|
9
|
+
|
|
10
|
+
BASE_ARGS = ["--algorithm", "pgsc_calc", "--cohort", "coh-abc123", "--sample", "smp-abc123"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class ResultCreateInputTestCase(TestCase):
|
|
14
|
+
def _invoke(self, *args):
|
|
15
|
+
with patch("haplohub_cli.commands.algorithm.result.client") as client:
|
|
16
|
+
result = CliRunner().invoke(create, [*BASE_ARGS, *args])
|
|
17
|
+
return result, client
|
|
18
|
+
|
|
19
|
+
def _sent_input(self, client):
|
|
20
|
+
(request,), _ = client.algorithm_result.create_algorithm_result.call_args
|
|
21
|
+
return request.input
|
|
22
|
+
|
|
23
|
+
def test_input_json_takes_an_inline_json_string(self):
|
|
24
|
+
result, client = self._invoke("-i", '{"pgs_model_ids": "PGS000001"}')
|
|
25
|
+
|
|
26
|
+
self.assertEqual(result.exit_code, 0, result.output)
|
|
27
|
+
self.assertEqual(self._sent_input(client), {"pgs_model_ids": "PGS000001"})
|
|
28
|
+
|
|
29
|
+
def test_input_file_reads_json_from_a_path(self):
|
|
30
|
+
with tempfile.NamedTemporaryFile("w", suffix=".json") as f:
|
|
31
|
+
json.dump({"pgs_model_ids": "PGS000002"}, f)
|
|
32
|
+
f.flush()
|
|
33
|
+
result, client = self._invoke("-f", f.name)
|
|
34
|
+
|
|
35
|
+
self.assertEqual(result.exit_code, 0, result.output)
|
|
36
|
+
self.assertEqual(self._sent_input(client), {"pgs_model_ids": "PGS000002"})
|
|
37
|
+
|
|
38
|
+
def test_a_path_passed_to_input_json_points_to_input_file(self):
|
|
39
|
+
result, client = self._invoke("-i", "input.json")
|
|
40
|
+
|
|
41
|
+
self.assertEqual(result.exit_code, 2)
|
|
42
|
+
self.assertIn("--input-json", result.output)
|
|
43
|
+
self.assertIn("--input-file", result.output)
|
|
44
|
+
client.algorithm_result.create_algorithm_result.assert_not_called()
|
|
45
|
+
|
|
46
|
+
def test_help_shows_json_not_a_file_path(self):
|
|
47
|
+
result = CliRunner().invoke(create, ["--help"])
|
|
48
|
+
|
|
49
|
+
self.assertIn("-i, --input-json JSON", result.output)
|
|
50
|
+
self.assertIn("-f, --input-file FILE_PATH", result.output)
|
|
File without changes
|
|
@@ -41,6 +41,8 @@ haplohub_cli/commands/variant.py
|
|
|
41
41
|
haplohub_cli/commands/version.py
|
|
42
42
|
haplohub_cli/commands/algorithm/__init__.py
|
|
43
43
|
haplohub_cli/commands/algorithm/result/__init__.py
|
|
44
|
+
haplohub_cli/commands/algorithm/tests/__init__.py
|
|
45
|
+
haplohub_cli/commands/algorithm/tests/test_result_create.py
|
|
44
46
|
haplohub_cli/commands/cohort/__init__.py
|
|
45
47
|
haplohub_cli/commands/cohort/biomarker.py
|
|
46
48
|
haplohub_cli/commands/cohort/sample.py
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
"haplohub_cli/commands/__init__.py",
|
|
27
27
|
"haplohub_cli/commands/algorithm/__init__.py",
|
|
28
28
|
"haplohub_cli/commands/algorithm/result/__init__.py",
|
|
29
|
+
"haplohub_cli/commands/algorithm/tests/__init__.py",
|
|
30
|
+
"haplohub_cli/commands/algorithm/tests/test_result_create.py",
|
|
29
31
|
"haplohub_cli/commands/cohort/__init__.py",
|
|
30
32
|
"haplohub_cli/commands/cohort/biomarker.py",
|
|
31
33
|
"haplohub_cli/commands/cohort/member/__init__.py",
|
|
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
|
{haplohub_cli-3.2.0/haplohub_cli/core/api → haplohub_cli-3.2.1/haplohub_cli/config}/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{haplohub_cli-3.2.0/haplohub_cli/core/tests → haplohub_cli-3.2.1/haplohub_cli/core/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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{haplohub_cli-3.2.0/haplohub_cli → haplohub_cli-3.2.1/haplohub_cli/formatters}/tests/__init__.py
RENAMED
|
File without changes
|
{haplohub_cli-3.2.0 → haplohub_cli-3.2.1}/haplohub_cli/formatters/tests/test_generic_table.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
|