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.
Files changed (92) hide show
  1. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/.github/workflows/on_pr.yml +1 -1
  2. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/.github/workflows/on_push_main.yml +1 -1
  3. {haplohub_cli-3.2.0/haplohub_cli.egg-info → haplohub_cli-3.2.2}/PKG-INFO +2 -1
  4. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/_version.py +3 -3
  5. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/algorithm/result/__init__.py +15 -3
  6. haplohub_cli-3.2.2/haplohub_cli/commands/algorithm/tests/test_result_create.py +50 -0
  7. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/api/client.py +3 -0
  8. haplohub_cli-3.2.2/haplohub_cli/types/__init__.py +0 -0
  9. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2/haplohub_cli.egg-info}/PKG-INFO +2 -1
  10. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/SOURCES.txt +2 -0
  11. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/requires.txt +1 -0
  12. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/scm_file_list.json +2 -0
  13. haplohub_cli-3.2.2/haplohub_cli.egg-info/scm_version.json +8 -0
  14. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/pyproject.toml +1 -0
  15. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/uv.lock +404 -402
  16. haplohub_cli-3.2.0/haplohub_cli.egg-info/scm_version.json +0 -8
  17. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/.github/dependabot.yml +0 -0
  18. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/.gitignore +0 -0
  19. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/.pre-commit-config.yaml +0 -0
  20. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/AGENTS.md +0 -0
  21. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/CLAUDE.md +0 -0
  22. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/README.md +0 -0
  23. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/docs/index.md +0 -0
  24. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/docs/release.md +0 -0
  25. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/docs/sdk-coupling.md +0 -0
  26. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/docs/stage-verification.md +0 -0
  27. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/docs/testing.md +0 -0
  28. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/__init__.py +0 -0
  29. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/__init__.py +0 -0
  30. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/auth.py +0 -0
  31. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/auth_web_server.py +0 -0
  32. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/oauth_client.py +0 -0
  33. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/tests/__init__.py +0 -0
  34. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/tests/test_auth_web_server.py +0 -0
  35. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/tests/test_token_storage.py +0 -0
  36. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/auth/token_storage.py +0 -0
  37. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/cli.py +0 -0
  38. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/__init__.py +0 -0
  39. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/algorithm/__init__.py +0 -0
  40. {haplohub_cli-3.2.0/haplohub_cli/commands/cohort → haplohub_cli-3.2.2/haplohub_cli/commands/algorithm}/tests/__init__.py +0 -0
  41. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/__init__.py +0 -0
  42. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/biomarker.py +0 -0
  43. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/member/__init__.py +0 -0
  44. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/member/report.py +0 -0
  45. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/sample.py +0 -0
  46. {haplohub_cli-3.2.0/haplohub_cli/commands → haplohub_cli-3.2.2/haplohub_cli/commands/cohort}/tests/__init__.py +0 -0
  47. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/cohort/tests/test_delete.py +0 -0
  48. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/config.py +0 -0
  49. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/file.py +0 -0
  50. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/login.py +0 -0
  51. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/metadata/__init__.py +0 -0
  52. {haplohub_cli-3.2.0/haplohub_cli/config → haplohub_cli-3.2.2/haplohub_cli/commands/tests}/__init__.py +0 -0
  53. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/tests/test_file.py +0 -0
  54. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/variant.py +0 -0
  55. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/commands/version.py +0 -0
  56. {haplohub_cli-3.2.0/haplohub_cli/core/api → haplohub_cli-3.2.2/haplohub_cli/config}/__init__.py +0 -0
  57. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/config/config.py +0 -0
  58. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/config/config_manager.py +0 -0
  59. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/__init__.py +0 -0
  60. {haplohub_cli-3.2.0/haplohub_cli/core/tests → haplohub_cli-3.2.2/haplohub_cli/core/api}/__init__.py +0 -0
  61. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/checksum.py +0 -0
  62. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/deletion.py +0 -0
  63. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/network.py +0 -0
  64. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/slug.py +0 -0
  65. {haplohub_cli-3.2.0/haplohub_cli/formatters → haplohub_cli-3.2.2/haplohub_cli/core}/tests/__init__.py +0 -0
  66. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/tests/test_checksum.py +0 -0
  67. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/tests/test_network.py +0 -0
  68. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/tests/test_slug.py +0 -0
  69. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/types.py +0 -0
  70. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/core/upload.py +0 -0
  71. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/__init__.py +0 -0
  72. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/algorithm.py +0 -0
  73. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/algorithm_result.py +0 -0
  74. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/biomarker.py +0 -0
  75. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/config.py +0 -0
  76. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/decorators.py +0 -0
  77. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/file.py +0 -0
  78. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/formatter_registry.py +0 -0
  79. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/generic.py +0 -0
  80. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/generic_table.py +0 -0
  81. {haplohub_cli-3.2.0/haplohub_cli → haplohub_cli-3.2.2/haplohub_cli/formatters}/tests/__init__.py +0 -0
  82. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/tests/test_generic_table.py +0 -0
  83. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/utils.py +0 -0
  84. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/formatters/variant.py +0 -0
  85. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/settings.py +0 -0
  86. {haplohub_cli-3.2.0/haplohub_cli/types → haplohub_cli-3.2.2/haplohub_cli/tests}/__init__.py +0 -0
  87. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/tests/test_cli.py +0 -0
  88. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli/types/variant_range.py +0 -0
  89. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/dependency_links.txt +0 -0
  90. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/entry_points.txt +0 -0
  91. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/haplohub_cli.egg-info/top_level.txt +0 -0
  92. {haplohub_cli-3.2.0 → haplohub_cli-3.2.2}/setup.cfg +0 -0
@@ -13,7 +13,7 @@ jobs:
13
13
  python-version: ["3.10", "3.11", "3.12", "3.13"]
14
14
 
15
15
  steps:
16
- - uses: actions/checkout@v6
16
+ - uses: actions/checkout@v7
17
17
  - uses: astral-sh/setup-uv@v7
18
18
  with:
19
19
  python-version: ${{ matrix.python-version }}
@@ -15,7 +15,7 @@ jobs:
15
15
  name: Build python package
16
16
  runs-on: ubuntu-latest
17
17
  steps:
18
- - uses: actions/checkout@v6
18
+ - uses: actions/checkout@v7
19
19
  with:
20
20
  fetch-depth: 0
21
21
  - uses: hynek/build-and-inspect-python-package@v2
@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: haplohub-cli
3
- Version: 3.2.0
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.0'
22
- __version_tuple__ = version_tuple = (3, 2, 0)
21
+ __version__ = version = '3.2.2'
22
+ __version_tuple__ = version_tuple = (3, 2, 2)
23
23
 
24
- __commit_id__ = commit_id = 'gd9453247c'
24
+ __commit_id__ = commit_id = 'g9bab1d8f9'
@@ -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("--input-json", "-i", type=types.FILE_PATH, required=False, help="The input JSON")
54
- @click.option("--input-file", "-f", type=types.FILE_PATH, required=False, help="The input file")
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
- input_data = json.loads(input_json)
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.0
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
@@ -1,3 +1,4 @@
1
+ certifi>=2026.10.19
1
2
  click>=8.1.8
2
3
  haplohub<4,>=3.1.0
3
4
  pendulum>=3.0.0
@@ -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",
@@ -0,0 +1,8 @@
1
+ {
2
+ "tag": "3.2.2",
3
+ "distance": 0,
4
+ "node": "g9bab1d8f9a91c35232095fc7e4dad9fac2010a92",
5
+ "dirty": false,
6
+ "branch": "HEAD",
7
+ "node_date": "2026-10-21"
8
+ }
@@ -9,6 +9,7 @@ authors = [
9
9
  requires-python = ">=3.10"
10
10
  dynamic = ["version"]
11
11
  dependencies = [
12
+ "certifi>=2026.10.19",
12
13
  "click>=8.1.8",
13
14
  "haplohub>=3.1.0,<4",
14
15
  "pendulum>=3.0.0",