divbase-cli 0.1.0a5__tar.gz → 0.1.0a11__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 (30) hide show
  1. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/PKG-INFO +3 -3
  2. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/pyproject.toml +2 -2
  3. divbase_cli-0.1.0a11/src/divbase_cli/__init__.py +1 -0
  4. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/cli_commands/auth_cli.py +11 -7
  5. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/cli_commands/dimensions_cli.py +1 -4
  6. divbase_cli-0.1.0a11/src/divbase_cli/cli_commands/file_cli.py +1210 -0
  7. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/cli_commands/query_cli.py +4 -4
  8. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/cli_config.py +6 -0
  9. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/cli_exceptions.py +78 -3
  10. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/config_resolver.py +1 -1
  11. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/divbase_cli.py +24 -7
  12. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/services/pre_signed_urls.py +49 -29
  13. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/services/s3_files.py +101 -68
  14. divbase_cli-0.1.0a5/src/divbase_cli/__init__.py +0 -1
  15. divbase_cli-0.1.0a5/src/divbase_cli/cli_commands/file_cli.py +0 -740
  16. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/.gitignore +0 -0
  17. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/README.md +0 -0
  18. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/cli_commands/__init__.py +0 -0
  19. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/cli_commands/shared_args_options.py +0 -0
  20. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/cli_commands/task_history_cli.py +0 -0
  21. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/cli_commands/user_config_cli.py +0 -0
  22. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/cli_commands/version_cli.py +0 -0
  23. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/display_task_history.py +0 -0
  24. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/retries.py +0 -0
  25. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/services/__init__.py +0 -0
  26. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/services/announcements.py +0 -0
  27. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/services/project_versions.py +0 -0
  28. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/user_auth.py +0 -0
  29. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/user_config.py +0 -0
  30. {divbase_cli-0.1.0a5 → divbase_cli-0.1.0a11}/src/divbase_cli/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: divbase-cli
3
- Version: 0.1.0a5
3
+ Version: 0.1.0a11
4
4
  Summary: Command Line Interface for Divbase
5
5
  Project-URL: Homepage, https://divbase.scilifelab-2-prod.sys.kth.se
6
6
  Project-URL: Documentation, https://scilifelabdatacentre.github.io/divbase
@@ -18,9 +18,9 @@ Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Programming Language :: Python :: 3.14
20
20
  Requires-Python: >=3.12
21
- Requires-Dist: divbase-lib==0.1.0a5
21
+ Requires-Dist: divbase-lib==0.1.0a11
22
22
  Requires-Dist: keyring>=25.7.0
23
- Requires-Dist: typer==0.24.1
23
+ Requires-Dist: typer==0.26.7
24
24
  Description-Content-Type: text/markdown
25
25
 
26
26
  # divbase-cli
@@ -8,9 +8,9 @@ authors = [
8
8
  ]
9
9
  requires-python = ">=3.12"
10
10
  dependencies = [
11
- "typer==0.24.1",
11
+ "typer==0.26.7",
12
12
  "keyring>=25.7.0",
13
- "divbase-lib==0.1.0a5",
13
+ "divbase-lib==0.1.0a11",
14
14
  ]
15
15
  dynamic = ["version"]
16
16
 
@@ -0,0 +1 @@
1
+ __version__ = "0.1.0a11"
@@ -11,7 +11,12 @@ from pydantic import SecretStr
11
11
  from rich import print
12
12
 
13
13
  from divbase_cli.cli_config import cli_settings
14
- from divbase_cli.cli_exceptions import DivBaseAPIConnectionError, DivBaseAPIError
14
+ from divbase_cli.cli_exceptions import (
15
+ DivBaseAPIConnectionError,
16
+ DivBaseAPIError,
17
+ InvalidPersonalAccessTokenError,
18
+ PersonalAccessTokenAlreadyExistsError,
19
+ )
15
20
  from divbase_cli.config_resolver import resolve_url_for_non_project_specific_commands
16
21
  from divbase_cli.services.announcements import get_and_display_announcements
17
22
  from divbase_cli.user_auth import (
@@ -109,27 +114,26 @@ def add_pat(
109
114
  """
110
115
  existing = load_stored_user_pat()
111
116
  if existing and not overwrite_existing:
112
- print(
117
+ raise PersonalAccessTokenAlreadyExistsError(
113
118
  f"A personal access token named '{existing.name}' is already stored on your device \n"
114
119
  f"It is due to expire on: {existing.pat_expiry_formatted()} \n"
115
120
  "Append the flag --overwrite-existing (-o) to this command if you want to replace it. \n"
116
121
  "You can only store one PAT at a time."
117
122
  )
118
- raise typer.Exit(code=1)
119
123
 
120
124
  if expires_unix_timestamp and expires_unix_timestamp < time.time():
121
- print("The expiry time you entered is in the past. Please enter a valid expiry time for the PAT.")
122
- raise typer.Exit(code=1)
125
+ raise InvalidPersonalAccessTokenError(
126
+ "The expiry time you entered is in the past. Please enter a valid expiry time for the PAT."
127
+ )
123
128
 
124
129
  pat = SecretStr(
125
130
  typer.prompt("please paste your personal access token now", hide_input=True, confirmation_prompt=False)
126
131
  )
127
132
  if not pat.get_secret_value().startswith(PAT_TOKEN_PREFIX):
128
- print(
133
+ raise InvalidPersonalAccessTokenError(
129
134
  "It looks like the token you entered is not a valid personal access token. "
130
135
  f"Please make sure you copied the entire token, including the '{PAT_TOKEN_PREFIX}' prefix."
131
136
  )
132
- raise typer.Exit(code=1)
133
137
 
134
138
  pat_data = PATData(name=name, pat=pat, pat_expires_at=expires_unix_timestamp)
135
139
  pat_data.dump_pat_data()
@@ -102,11 +102,8 @@ def show_dimensions_index(
102
102
  project_config = resolve_project(project_name=project)
103
103
  logged_in_url = ensure_logged_in(desired_url=project_config.divbase_url)
104
104
 
105
- # These two options are mutually exclusive. But due to how typer handles options, this error will only be raised if --sample-names-output has an input value (i.e. path).
106
- # If the path is missing, it will raise an error about the missing path argument instead...
107
105
  if sample_names_output and sample_names_stdout:
108
- typer.echo("Use only one of --sample-names-output or --sample-names-stdout.", err=True)
109
- raise typer.Exit(code=1)
106
+ raise typer.BadParameter("Use only one of --sample-names-output or --sample-names-stdout.")
110
107
 
111
108
  if unique_samples:
112
109
  response = make_authenticated_request(