haplohub-cli 3.2.0__tar.gz → 3.2.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.
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/.github/workflows/on_pr.yml +1 -1
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/.github/workflows/on_push_main.yml +1 -1
- {haplohub_cli-3.2.0/haplohub_cli.egg-info → haplohub_cli-3.2.2}/PKG-INFO +2 -1
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/_version.py +3 -3
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/algorithm/result/__init__.py +15 -3
- haplohub_cli-3.2.2/haplohub_cli/commands/algorithm/tests/test_result_create.py +50 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/api/client.py +3 -0
- haplohub_cli-3.2.2/haplohub_cli/types/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2/haplohub_cli.egg-info}/PKG-INFO +2 -1
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/SOURCES.txt +2 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/requires.txt +1 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/scm_file_list.json +2 -0
- haplohub_cli-3.2.2/haplohub_cli.egg-info/scm_version.json +8 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/pyproject.toml +1 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/uv.lock +404 -402
- haplohub_cli-3.2.0/haplohub_cli.egg-info/scm_version.json +0 -8
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/.github/dependabot.yml +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/.gitignore +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/.pre-commit-config.yaml +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/AGENTS.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/CLAUDE.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/README.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/docs/index.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/docs/release.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/docs/sdk-coupling.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/docs/stage-verification.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/docs/testing.md +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/auth.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/auth_web_server.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/oauth_client.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/tests/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/tests/test_auth_web_server.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/tests/test_token_storage.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/token_storage.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/cli.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/algorithm/__init__.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/commands/cohort → haplohub_cli-3.2.2/haplohub_cli/commands/algorithm}/tests/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/biomarker.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/member/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/member/report.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/sample.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/commands → haplohub_cli-3.2.2/haplohub_cli/commands/cohort}/tests/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/tests/test_delete.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/config.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/file.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/login.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/metadata/__init__.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/config → haplohub_cli-3.2.2/haplohub_cli/commands/tests}/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/tests/test_file.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/variant.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/version.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/core/api → haplohub_cli-3.2.2/haplohub_cli/config}/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/config/config.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/config/config_manager.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/__init__.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/core/tests → haplohub_cli-3.2.2/haplohub_cli/core/api}/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/checksum.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/deletion.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/network.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/slug.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/formatters → haplohub_cli-3.2.2/haplohub_cli/core}/tests/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/tests/test_checksum.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/tests/test_network.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/tests/test_slug.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/types.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/upload.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/algorithm.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/algorithm_result.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/biomarker.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/config.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/decorators.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/file.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/formatter_registry.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/generic.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/generic_table.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli → haplohub_cli-3.2.2/haplohub_cli/formatters}/tests/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/tests/test_generic_table.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/utils.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/variant.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/settings.py +0 -0
- {haplohub_cli-3.2.0/haplohub_cli/types → haplohub_cli-3.2.2/haplohub_cli/tests}/__init__.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/tests/test_cli.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/types/variant_range.py +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/dependency_links.txt +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/entry_points.txt +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/top_level.txt +0 -0
- {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/setup.cfg +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: haplohub-cli
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.2
|
|
4
4
|
Summary: HaploHub Command Line Interface
|
|
5
5
|
Author-email: Mike Polcari <mike@haplotype-labs.com>, Ilya Khrustalev <ilya@haplotype-labs.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: certifi>=2026.10.19
|
|
8
9
|
Requires-Dist: click>=8.1.8
|
|
9
10
|
Requires-Dist: haplohub<4,>=3.1.0
|
|
10
11
|
Requires-Dist: pendulum>=3.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.2'
|
|
22
|
+
__version_tuple__ = version_tuple = (3, 2, 2)
|
|
23
23
|
|
|
24
|
-
__commit_id__ = commit_id = '
|
|
24
|
+
__commit_id__ = commit_id = 'g9bab1d8f9'
|
{haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/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)
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from functools import cached_property
|
|
2
2
|
|
|
3
|
+
import certifi
|
|
3
4
|
import click
|
|
4
5
|
from haplohub import ApiClient, Configuration
|
|
5
6
|
|
|
@@ -22,11 +23,13 @@ class Client:
|
|
|
22
23
|
config = Configuration(
|
|
23
24
|
host=api_url,
|
|
24
25
|
api_key={"ApiKeyAuth": self.token_storage.get_api_key(api_url)},
|
|
26
|
+
ssl_ca_cert=certifi.where(),
|
|
25
27
|
)
|
|
26
28
|
else:
|
|
27
29
|
config = Configuration(
|
|
28
30
|
host=api_url,
|
|
29
31
|
access_token=self.token_storage.get_access_token(api_url),
|
|
32
|
+
ssl_ca_cert=certifi.where(),
|
|
30
33
|
)
|
|
31
34
|
return ApiClient(config)
|
|
32
35
|
|
|
File without changes
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: haplohub-cli
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.2
|
|
4
4
|
Summary: HaploHub Command Line Interface
|
|
5
5
|
Author-email: Mike Polcari <mike@haplotype-labs.com>, Ilya Khrustalev <ilya@haplotype-labs.com>
|
|
6
6
|
Requires-Python: >=3.10
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: certifi>=2026.10.19
|
|
8
9
|
Requires-Dist: click>=8.1.8
|
|
9
10
|
Requires-Dist: haplohub<4,>=3.1.0
|
|
10
11
|
Requires-Dist: pendulum>=3.0.0
|
|
@@ -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",
|