cloudos-cli 2.49.0__tar.gz → 2.50.0__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 (41) hide show
  1. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/PKG-INFO +1 -1
  2. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/__main__.py +41 -2
  3. cloudos_cli-2.50.0/cloudos_cli/_version.py +1 -0
  4. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/utils/errors.py +15 -1
  5. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli.egg-info/PKG-INFO +1 -1
  6. cloudos_cli-2.49.0/cloudos_cli/_version.py +0 -1
  7. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/LICENSE +0 -0
  8. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/README.md +0 -0
  9. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/__init__.py +0 -0
  10. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/clos.py +0 -0
  11. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/configure/__init__.py +0 -0
  12. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/configure/configure.py +0 -0
  13. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/datasets/__init__.py +0 -0
  14. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/datasets/datasets.py +0 -0
  15. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/import_wf/__init__.py +0 -0
  16. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/import_wf/import_wf.py +0 -0
  17. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/jobs/__init__.py +0 -0
  18. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/jobs/job.py +0 -0
  19. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/link/__init__.py +0 -0
  20. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/link/link.py +0 -0
  21. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/procurement/__init__.py +0 -0
  22. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/procurement/images.py +0 -0
  23. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/queue/__init__.py +0 -0
  24. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/queue/queue.py +0 -0
  25. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/utils/__init__.py +0 -0
  26. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/utils/array_job.py +0 -0
  27. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/utils/cloud.py +0 -0
  28. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/utils/details.py +0 -0
  29. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/utils/last_wf.py +0 -0
  30. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/utils/requests.py +0 -0
  31. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli/utils/resources.py +0 -0
  32. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli.egg-info/SOURCES.txt +0 -0
  33. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli.egg-info/dependency_links.txt +0 -0
  34. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli.egg-info/entry_points.txt +0 -0
  35. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli.egg-info/requires.txt +0 -0
  36. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/cloudos_cli.egg-info/top_level.txt +0 -0
  37. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/setup.cfg +0 -0
  38. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/setup.py +0 -0
  39. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/tests/__init__.py +0 -0
  40. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/tests/functions_for_pytest.py +0 -0
  41. {cloudos_cli-2.49.0 → cloudos_cli-2.50.0}/tests/test_cli_project_create.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudos_cli
3
- Version: 2.49.0
3
+ Version: 2.50.0
4
4
  Summary: Python package for interacting with CloudOS
5
5
  Home-page: https://github.com/lifebit-ai/cloudos-cli
6
6
  Author: David Piñeyro
@@ -9,6 +9,7 @@ from cloudos_cli.utils.errors import BadRequestException
9
9
  import json
10
10
  import time
11
11
  import sys
12
+ import traceback
12
13
  from ._version import __version__
13
14
  from cloudos_cli.configure.configure import ConfigurationProfile
14
15
  from rich.console import Console
@@ -36,12 +37,40 @@ CLOUDOS_URL = 'https://cloudos.lifebit.ai'
36
37
  INIT_PROFILE = 'initialisingProfile'
37
38
 
38
39
 
40
+ def handle_exception(show_traceback=False):
41
+ """Custom exception handler for CloudOS CLI"""
42
+ def exception_handler(exc_type, exc_value, exc_traceback):
43
+ # Handle keyboard interrupt gracefully
44
+ if issubclass(exc_type, KeyboardInterrupt):
45
+ sys.exit(1)
46
+
47
+ if show_traceback:
48
+ # Show full traceback for debugging
49
+ traceback.print_exception(exc_type, exc_value, exc_traceback)
50
+ else:
51
+ # Show only the error message
52
+ click.echo(click.style(f"Error: {exc_value}", fg='red'), err=True)
53
+
54
+ sys.exit(1)
55
+
56
+ return exception_handler
57
+
58
+
39
59
  @click.group()
60
+ @click.option('--debug', is_flag=True, help='Show detailed error information and tracebacks')
40
61
  @click.version_option(__version__)
41
62
  @click.pass_context
42
- def run_cloudos_cli(ctx):
63
+ def run_cloudos_cli(ctx, debug):
43
64
  """CloudOS python package: a package for interacting with CloudOS."""
44
65
  ctx.ensure_object(dict)
66
+ ctx.obj['debug'] = debug
67
+
68
+ # Set up custom exception handling based on debug flag
69
+ if not debug:
70
+ sys.excepthook = handle_exception(show_traceback=False)
71
+ else:
72
+ sys.excepthook = handle_exception(show_traceback=True)
73
+
45
74
  if ctx.invoked_subcommand not in ['datasets']:
46
75
  print(run_cloudos_cli.__doc__ + '\n')
47
76
  print('Version: ' + __version__ + '\n')
@@ -3913,4 +3942,14 @@ def reset_organisation_image(ctx,
3913
3942
 
3914
3943
 
3915
3944
  if __name__ == "__main__":
3916
- run_cloudos_cli()
3945
+ try:
3946
+ run_cloudos_cli()
3947
+ except Exception as e:
3948
+ # Check if debug flag was passed (fallback for cases where Click doesn't handle it)
3949
+ debug_mode = '--debug' in sys.argv
3950
+
3951
+ if debug_mode:
3952
+ traceback.print_exc()
3953
+ else:
3954
+ click.echo(click.style(f"Error: {e}", fg='red'), err=True)
3955
+ sys.exit(1)
@@ -0,0 +1 @@
1
+ __version__ = '2.50.0'
@@ -12,7 +12,21 @@ class BadRequestException(Exception):
12
12
  The request variable returned that caused the error.
13
13
  """
14
14
  def __init__(self, rv):
15
- msg = "Server returned status {}. Reason: {}".format(rv.status_code, rv.reason)
15
+ # Try to get the message from response body first
16
+ error_message = None
17
+ try:
18
+ response_body = rv.json()
19
+ error_message = response_body.get('message')
20
+ except (ValueError, AttributeError):
21
+ # Response is not JSON or doesn't have expected structure
22
+ pass
23
+
24
+ # Prioritize message from response, fallback to reason
25
+ if error_message:
26
+ msg = "Server returned status {}. Message: {}".format(rv.status_code, error_message)
27
+ else:
28
+ msg = "Server returned status {}. Reason: {}".format(rv.status_code, rv.reason)
29
+
16
30
  super(BadRequestException, self).__init__(msg)
17
31
  self.rv = rv
18
32
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: cloudos_cli
3
- Version: 2.49.0
3
+ Version: 2.50.0
4
4
  Summary: Python package for interacting with CloudOS
5
5
  Home-page: https://github.com/lifebit-ai/cloudos-cli
6
6
  Author: David Piñeyro
@@ -1 +0,0 @@
1
- __version__ = '2.49.0'
File without changes
File without changes
File without changes
File without changes