nextmv 1.0.0.dev3__py3-none-any.whl → 1.0.0.dev5__py3-none-any.whl

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 (135) hide show
  1. nextmv/__about__.py +1 -1
  2. nextmv/__entrypoint__.py +1 -2
  3. nextmv/__init__.py +0 -4
  4. nextmv/_serialization.py +1 -1
  5. nextmv/cli/CONTRIBUTING.md +81 -29
  6. nextmv/cli/cloud/acceptance/create.py +24 -26
  7. nextmv/cli/cloud/acceptance/delete.py +7 -8
  8. nextmv/cli/cloud/acceptance/get.py +9 -10
  9. nextmv/cli/cloud/acceptance/list.py +3 -3
  10. nextmv/cli/cloud/acceptance/update.py +6 -6
  11. nextmv/cli/cloud/account/__init__.py +3 -3
  12. nextmv/cli/cloud/account/create.py +11 -11
  13. nextmv/cli/cloud/account/delete.py +6 -7
  14. nextmv/cli/cloud/account/get.py +3 -3
  15. nextmv/cli/cloud/account/update.py +5 -5
  16. nextmv/cli/cloud/app/create.py +25 -26
  17. nextmv/cli/cloud/app/delete.py +5 -6
  18. nextmv/cli/cloud/app/exists.py +2 -2
  19. nextmv/cli/cloud/app/get.py +2 -2
  20. nextmv/cli/cloud/app/list.py +3 -3
  21. nextmv/cli/cloud/app/push.py +368 -54
  22. nextmv/cli/cloud/app/update.py +12 -12
  23. nextmv/cli/cloud/batch/create.py +26 -28
  24. nextmv/cli/cloud/batch/delete.py +5 -6
  25. nextmv/cli/cloud/batch/get.py +8 -8
  26. nextmv/cli/cloud/batch/list.py +3 -3
  27. nextmv/cli/cloud/batch/metadata.py +4 -4
  28. nextmv/cli/cloud/batch/update.py +6 -6
  29. nextmv/cli/cloud/data/__init__.py +1 -1
  30. nextmv/cli/cloud/data/upload.py +15 -15
  31. nextmv/cli/cloud/ensemble/__init__.py +2 -0
  32. nextmv/cli/cloud/ensemble/create.py +21 -22
  33. nextmv/cli/cloud/ensemble/delete.py +5 -6
  34. nextmv/cli/cloud/ensemble/get.py +4 -4
  35. nextmv/cli/cloud/ensemble/list.py +63 -0
  36. nextmv/cli/cloud/ensemble/update.py +9 -9
  37. nextmv/cli/cloud/input_set/create.py +20 -22
  38. nextmv/cli/cloud/input_set/get.py +3 -3
  39. nextmv/cli/cloud/input_set/list.py +3 -3
  40. nextmv/cli/cloud/input_set/update.py +24 -24
  41. nextmv/cli/cloud/instance/create.py +14 -15
  42. nextmv/cli/cloud/instance/delete.py +5 -6
  43. nextmv/cli/cloud/instance/exists.py +2 -2
  44. nextmv/cli/cloud/instance/get.py +2 -2
  45. nextmv/cli/cloud/instance/list.py +3 -3
  46. nextmv/cli/cloud/instance/update.py +14 -14
  47. nextmv/cli/cloud/managed_input/create.py +14 -16
  48. nextmv/cli/cloud/managed_input/delete.py +6 -7
  49. nextmv/cli/cloud/managed_input/get.py +3 -3
  50. nextmv/cli/cloud/managed_input/list.py +3 -3
  51. nextmv/cli/cloud/managed_input/update.py +9 -9
  52. nextmv/cli/cloud/run/cancel.py +2 -2
  53. nextmv/cli/cloud/run/create.py +32 -33
  54. nextmv/cli/cloud/run/get.py +8 -8
  55. nextmv/cli/cloud/run/input.py +4 -4
  56. nextmv/cli/cloud/run/list.py +6 -6
  57. nextmv/cli/cloud/run/logs.py +9 -10
  58. nextmv/cli/cloud/run/metadata.py +4 -4
  59. nextmv/cli/cloud/run/track.py +32 -33
  60. nextmv/cli/cloud/scenario/create.py +21 -21
  61. nextmv/cli/cloud/scenario/delete.py +5 -6
  62. nextmv/cli/cloud/scenario/get.py +8 -8
  63. nextmv/cli/cloud/scenario/list.py +3 -3
  64. nextmv/cli/cloud/scenario/metadata.py +4 -4
  65. nextmv/cli/cloud/scenario/update.py +6 -6
  66. nextmv/cli/cloud/secrets/create.py +17 -17
  67. nextmv/cli/cloud/secrets/delete.py +5 -6
  68. nextmv/cli/cloud/secrets/get.py +4 -4
  69. nextmv/cli/cloud/secrets/list.py +3 -3
  70. nextmv/cli/cloud/secrets/update.py +17 -20
  71. nextmv/cli/cloud/shadow/create.py +31 -31
  72. nextmv/cli/cloud/shadow/delete.py +5 -6
  73. nextmv/cli/cloud/shadow/get.py +2 -2
  74. nextmv/cli/cloud/shadow/list.py +3 -3
  75. nextmv/cli/cloud/shadow/metadata.py +4 -4
  76. nextmv/cli/cloud/shadow/start.py +3 -3
  77. nextmv/cli/cloud/shadow/stop.py +4 -6
  78. nextmv/cli/cloud/shadow/update.py +6 -6
  79. nextmv/cli/cloud/switchback/create.py +19 -15
  80. nextmv/cli/cloud/switchback/delete.py +5 -6
  81. nextmv/cli/cloud/switchback/get.py +3 -3
  82. nextmv/cli/cloud/switchback/list.py +3 -3
  83. nextmv/cli/cloud/switchback/metadata.py +6 -6
  84. nextmv/cli/cloud/switchback/start.py +4 -4
  85. nextmv/cli/cloud/switchback/stop.py +4 -6
  86. nextmv/cli/cloud/switchback/update.py +6 -6
  87. nextmv/cli/cloud/upload/create.py +2 -2
  88. nextmv/cli/cloud/version/create.py +9 -10
  89. nextmv/cli/cloud/version/delete.py +5 -6
  90. nextmv/cli/cloud/version/exists.py +2 -2
  91. nextmv/cli/cloud/version/get.py +2 -2
  92. nextmv/cli/cloud/version/list.py +3 -3
  93. nextmv/cli/cloud/version/update.py +8 -8
  94. nextmv/cli/community/clone.py +12 -10
  95. nextmv/cli/community/list.py +9 -9
  96. nextmv/cli/configuration/config.py +43 -10
  97. nextmv/cli/configuration/create.py +3 -3
  98. nextmv/cli/configuration/delete.py +7 -7
  99. nextmv/cli/configuration/list.py +3 -3
  100. nextmv/cli/confirm.py +34 -0
  101. nextmv/cli/main.py +27 -36
  102. nextmv/cli/message.py +2 -2
  103. nextmv/cli/version.py +1 -1
  104. nextmv/cloud/__init__.py +0 -38
  105. nextmv/cloud/acceptance_test.py +1 -65
  106. nextmv/cloud/account.py +1 -6
  107. nextmv/cloud/application/__init__.py +192 -54
  108. nextmv/cloud/application/_batch_scenario.py +4 -19
  109. nextmv/cloud/application/_instance.py +3 -3
  110. nextmv/cloud/application/_managed_input.py +2 -2
  111. nextmv/cloud/application/_run.py +8 -1
  112. nextmv/cloud/application/_shadow.py +2 -2
  113. nextmv/cloud/application/_switchback.py +12 -4
  114. nextmv/cloud/application/_version.py +4 -3
  115. nextmv/cloud/client.py +1 -1
  116. nextmv/cloud/shadow.py +43 -4
  117. nextmv/cloud/switchback.py +46 -9
  118. nextmv/default_app/main.py +4 -6
  119. nextmv/deprecated.py +5 -3
  120. nextmv/input.py +0 -52
  121. nextmv/local/executor.py +83 -3
  122. nextmv/local/geojson_handler.py +1 -1
  123. nextmv/local/runner.py +1 -1
  124. nextmv/manifest.py +11 -7
  125. nextmv/model.py +2 -2
  126. nextmv/options.py +10 -255
  127. nextmv/output.py +57 -83
  128. nextmv/run.py +13 -13
  129. nextmv/status.py +1 -51
  130. {nextmv-1.0.0.dev3.dist-info → nextmv-1.0.0.dev5.dist-info}/METADATA +1 -1
  131. nextmv-1.0.0.dev5.dist-info/RECORD +183 -0
  132. nextmv-1.0.0.dev3.dist-info/RECORD +0 -181
  133. {nextmv-1.0.0.dev3.dist-info → nextmv-1.0.0.dev5.dist-info}/WHEEL +0 -0
  134. {nextmv-1.0.0.dev3.dist-info → nextmv-1.0.0.dev5.dist-info}/entry_points.txt +0 -0
  135. {nextmv-1.0.0.dev3.dist-info → nextmv-1.0.0.dev5.dist-info}/licenses/LICENSE +0 -0
@@ -7,7 +7,8 @@ from typing import Any
7
7
 
8
8
  import yaml
9
9
 
10
- from nextmv.cli.message import error
10
+ from nextmv.cli.confirm import get_confirmation
11
+ from nextmv.cli.message import error, success, warning
11
12
  from nextmv.cloud.account import Account
12
13
  from nextmv.cloud.application import Application
13
14
  from nextmv.cloud.client import Client
@@ -59,6 +60,18 @@ def save_config(config: dict[str, Any]) -> None:
59
60
  yaml.safe_dump(config, file)
60
61
 
61
62
 
63
+ def non_profile_keys() -> set[str]:
64
+ """
65
+ Returns the set of keys that are not profile names in the configuration.
66
+
67
+ Returns
68
+ -------
69
+ set[str]
70
+ The set of non-profile keys.
71
+ """
72
+ return {API_KEY_KEY, ENDPOINT_KEY}
73
+
74
+
62
75
  def build_client(profile: str | None = None) -> Client:
63
76
  """
64
77
  Builds a `cloud.Client` using the API key and endpoint for the given
@@ -91,23 +104,35 @@ def build_client(profile: str | None = None) -> Client:
91
104
 
92
105
  if profile is not None:
93
106
  if profile not in config:
94
- error(f"Profile [magenta]{profile}[/magenta] does not exist.")
107
+ error(
108
+ f"Profile [magenta]{profile}[/magenta] does not exist. "
109
+ "Create it using [code]nextmv configuration create[/code] with the --profile option."
110
+ )
95
111
 
96
112
  api_key = config[profile].get(API_KEY_KEY)
97
113
  if api_key is None or api_key == "":
98
- error(f"API key for profile [magenta]{profile}[/magenta] is not set or is empty.")
114
+ error(
115
+ f"API key for profile [magenta]{profile}[/magenta] is not set or is empty. "
116
+ "Set it using [code]nextmv configuration create[/code] with the --profile and --api-key options."
117
+ )
99
118
 
100
119
  endpoint = config[profile].get(ENDPOINT_KEY)
101
120
  if endpoint is None or endpoint == "":
102
- error(f"Endpoint for profile [magenta]{profile}[/magenta] is not set or is empty.")
121
+ error(
122
+ f"Endpoint for profile [magenta]{profile}[/magenta] is not set or is empty. "
123
+ "Please run [code]nextmv configuration create[/code]."
124
+ )
103
125
  else:
104
126
  api_key = config.get(API_KEY_KEY)
105
127
  if api_key is None or api_key == "":
106
- error("Default API key is not set or is empty.")
128
+ error(
129
+ "Default API key is not set or is empty. "
130
+ "Please run [code]nextmv configuration create[/code] with the --api-key option."
131
+ )
107
132
 
108
133
  endpoint = config.get(ENDPOINT_KEY)
109
134
  if endpoint is None or endpoint == "":
110
- error("Default endpoint is not set or is empty.")
135
+ error("Default endpoint is not set or is empty. Please run [code]nextmv configuration create[/code].")
111
136
 
112
137
  return Client(api_key=api_key, url=f"https://{endpoint}")
113
138
 
@@ -137,13 +162,21 @@ def build_app(app_id: str, profile: str | None = None) -> Application:
137
162
  """
138
163
  client = build_client(profile)
139
164
  exists = Application.exists(client=client, id=app_id)
140
- if not exists:
165
+ if exists:
166
+ return Application(client=client, id=app_id)
167
+
168
+ warning(f"Application with ID [magenta]{app_id}[/magenta] does not exist.")
169
+ should_create = get_confirmation(f"Do you want to create a new application with ID [magenta]{app_id}[/magenta]?")
170
+ if not should_create:
141
171
  error(
142
- f"Application with ID [magenta]{app_id}[/magenta] does not exist. "
143
- "Use [code]nextmv cloud app create[/code] to create a new application."
172
+ f"Application with ID [magenta]{app_id}[/magenta] was not created and does not exist. "
173
+ "Use [code]nextmv cloud app create[/code] to create a new app."
144
174
  )
145
175
 
146
- return Application(client=client, id=app_id)
176
+ app = Application.new(client=client, id=app_id, name=app_id)
177
+ success(f"Application with ID and name [magenta]{app_id}[/magenta] created successfully.")
178
+
179
+ return app
147
180
 
148
181
 
149
182
  def build_account(account_id: str | None = None, profile: str | None = None) -> Account:
@@ -58,14 +58,14 @@ def create(
58
58
  [bold][underline]Examples[/underline][/bold]
59
59
 
60
60
  - Default configuration.
61
- $ [green]nextmv configuration create --api-key NEXTMV_API_KEY[/green]
61
+ $ [dim]nextmv configuration create --api-key NEXTMV_API_KEY[/dim]
62
62
 
63
63
  - Configure a profile named [magenta]hare[/magenta].
64
- $ [green]nextmv configuration create --api-key NEXTMV_API_KEY --profile hare[/green]
64
+ $ [dim]nextmv configuration create --api-key NEXTMV_API_KEY --profile hare[/dim]
65
65
  """
66
66
 
67
67
  if profile is not None and profile.strip().lower() == "default":
68
- error("[code]default[/code] is a reserved profile name.")
68
+ error("[magenta]default[/magenta] is a reserved profile name.")
69
69
 
70
70
  endpoint = str(endpoint)
71
71
  if endpoint.startswith("https://"):
@@ -5,9 +5,9 @@ This module defines the configuration delete command for the Nextmv CLI.
5
5
  from typing import Annotated
6
6
 
7
7
  import typer
8
- from rich.prompt import Confirm
9
8
 
10
9
  from nextmv.cli.configuration.config import load_config, save_config
10
+ from nextmv.cli.confirm import get_confirmation
11
11
  from nextmv.cli.message import error, info, success
12
12
 
13
13
  # Set up subcommand application.
@@ -36,25 +36,25 @@ def delete(
36
36
  ] = False,
37
37
  ) -> None:
38
38
  """
39
- Delete a profile from the configuration. Use the [code]--yes[/code]
40
- flag to skip the confirmation prompt.
39
+ Delete a profile from the configuration.
40
+
41
+ Use the --yes flag to skip the confirmation prompt.
41
42
 
42
43
  [bold][underline]Examples[/underline][/bold]
43
44
 
44
45
  - Delete a profile named [magenta]hare[/magenta].
45
- $ [green]nextmv configuration delete --profile hare[/green]
46
+ $ [dim]nextmv configuration delete --profile hare[/dim]
46
47
 
47
48
  - Delete a profile named [magenta]hare[/magenta] without confirmation prompt.
48
- $ [green]nextmv configuration delete --profile hare --yes[/green]
49
+ $ [dim]nextmv configuration delete --profile hare --yes[/dim]
49
50
  """
50
51
  config = load_config()
51
52
  if profile not in config:
52
53
  error(f"Profile [magenta]{profile}[/magenta] does not exist.")
53
54
 
54
55
  if not yes:
55
- confirm = Confirm.ask(
56
+ confirm = get_confirmation(
56
57
  f"Are you sure you want to delete profile [magenta]{profile}[/magenta]? This action cannot be undone.",
57
- default=False,
58
58
  )
59
59
 
60
60
  if not confirm:
@@ -6,7 +6,7 @@ import typer
6
6
  from rich.console import Console
7
7
  from rich.table import Table
8
8
 
9
- from nextmv.cli.configuration.config import API_KEY_KEY, ENDPOINT_KEY, load_config, obscure_api_key
9
+ from nextmv.cli.configuration.config import API_KEY_KEY, ENDPOINT_KEY, load_config, non_profile_keys, obscure_api_key
10
10
  from nextmv.cli.message import error
11
11
 
12
12
  # Set up subcommand application.
@@ -22,7 +22,7 @@ def list() -> None:
22
22
  [bold][underline]Examples[/underline][/bold]
23
23
 
24
24
  - Show current configuration and all profiles.
25
- $ [green]nextmv configuration list[/green]
25
+ $ [dim]nextmv configuration list[/dim]
26
26
  """
27
27
 
28
28
  config = load_config()
@@ -38,7 +38,7 @@ def list() -> None:
38
38
 
39
39
  for k, v in config.items():
40
40
  # Skip default configuration.
41
- if k in {API_KEY_KEY, ENDPOINT_KEY}:
41
+ if k in non_profile_keys():
42
42
  continue
43
43
 
44
44
  profile = {
nextmv/cli/confirm.py ADDED
@@ -0,0 +1,34 @@
1
+ import sys
2
+
3
+ from rich.prompt import Confirm
4
+
5
+
6
+ def get_confirmation(msg: str, default: bool = False) -> bool:
7
+ """
8
+ Method to get a yes/no confirmation from the user.
9
+
10
+ Parameters
11
+ ----------
12
+ msg : str
13
+ The message to display to the user.
14
+ default : bool, optional
15
+ The default value if the user just presses Enter. Default is False.
16
+
17
+ Returns
18
+ -------
19
+ bool
20
+ True if the user confirmed, False otherwise.
21
+ """
22
+
23
+ # If this is not an interactive terminal, do not ask for confirmation, to
24
+ # avoid hanging indefinitely waiting for a user response.
25
+ if not sys.stdin.isatty():
26
+ return default
27
+
28
+ return Confirm.ask(
29
+ msg,
30
+ default=default,
31
+ case_sensitive=False,
32
+ show_default=True,
33
+ show_choices=True,
34
+ )
nextmv/cli/main.py CHANGED
@@ -13,22 +13,25 @@ about the features used here. An example of Rich markup can be found in the
13
13
  epilog of the Typer application defined below.
14
14
  """
15
15
 
16
- import os
17
16
  import sys
18
17
  from typing import Annotated
19
18
 
20
19
  import rich
21
20
  import typer
22
- from rich.prompt import Confirm
21
+ from typer import rich_utils
23
22
 
24
23
  from nextmv.cli.cloud import app as cloud_app
25
24
  from nextmv.cli.community import app as community_app
26
25
  from nextmv.cli.configuration import app as configuration_app
27
26
  from nextmv.cli.configuration.config import CONFIG_DIR, GO_CLI_PATH, load_config
27
+ from nextmv.cli.confirm import get_confirmation
28
28
  from nextmv.cli.message import error, info, success, warning
29
29
  from nextmv.cli.version import app as version_app
30
30
  from nextmv.cli.version import version_callback
31
31
 
32
+ # Disable dim text for the extended help of commands.
33
+ rich_utils.STYLE_HELPTEXT = ""
34
+
32
35
  # Main CLI application.
33
36
  app = typer.Typer(
34
37
  help="The Nextmv Command Line Interface (CLI).",
@@ -66,6 +69,15 @@ def callback(
66
69
  environment.
67
70
  """
68
71
 
72
+ # Skip checks for help commands.
73
+ if "--help" in sys.argv or "-h" in sys.argv:
74
+ return
75
+
76
+ # Skip checks for certain commands.
77
+ ignored_commands = {"configuration", "version"}
78
+ if ctx.invoked_subcommand in ignored_commands:
79
+ return
80
+
69
81
  handle_go_cli()
70
82
  handle_config_existence(ctx)
71
83
 
@@ -80,19 +92,21 @@ def handle_go_cli() -> None:
80
92
 
81
93
  exists = go_cli_exists()
82
94
  if exists:
83
- delete = Confirm.ask(
95
+ delete = get_confirmation(
84
96
  "Do you want to delete the [italic red]deprecated[/italic red] Nextmv CLI "
85
- f"at [magenta]{GO_CLI_PATH}[/magenta] now?",
86
- default=False,
97
+ f"at [magenta]{GO_CLI_PATH}[/magenta] now?"
87
98
  )
88
99
  if delete:
89
100
  remove_go_cli()
90
- else:
91
- info(
92
- msg="You can delete the [italic red]deprecated[/italic red] Nextmv CLI later by removing "
93
- f"[magenta]{GO_CLI_PATH}[/magenta]. Make sure you also clean up your [code]PATH[/code].",
94
- emoji=":bulb:",
95
- )
101
+ return
102
+
103
+ info(
104
+ msg="You can delete the [italic red]deprecated[/italic red] Nextmv CLI later by removing "
105
+ f"[magenta]{GO_CLI_PATH}[/magenta]. "
106
+ "Make sure you also clean up your [code]PATH[/code], "
107
+ f"by removing references to [magenta]{CONFIG_DIR}[/magenta] from it.",
108
+ emoji=":bulb:",
109
+ )
96
110
 
97
111
 
98
112
  def handle_config_existence(ctx: typer.Context) -> None:
@@ -105,10 +119,6 @@ def handle_config_existence(ctx: typer.Context) -> None:
105
119
  The Typer context object.
106
120
  """
107
121
 
108
- ignored_commands = {"configuration", "version"}
109
- if ctx.invoked_subcommand in ignored_commands:
110
- return
111
-
112
122
  config = load_config()
113
123
  if config == {}:
114
124
  error("No configuration found. Please run [code]nextmv configuration create[/code].")
@@ -130,11 +140,9 @@ def go_cli_exists() -> bool:
130
140
  if exists:
131
141
  warning(
132
142
  "A [italic red]deprecated[/italic red] Nextmv CLI is installed at "
133
- f"[magenta]{GO_CLI_PATH}[/magenta]. You must delete it to avoid conflicts."
143
+ f"[magenta]{GO_CLI_PATH}[/magenta]. You should delete it to avoid conflicts."
134
144
  )
135
145
 
136
- check_config_in_path()
137
-
138
146
  return exists
139
147
 
140
148
 
@@ -145,24 +153,7 @@ def remove_go_cli() -> None:
145
153
 
146
154
  if GO_CLI_PATH.exists():
147
155
  GO_CLI_PATH.unlink()
148
- success(f"Deleted deprecated [magenta]{GO_CLI_PATH}[/magenta].")
149
-
150
- check_config_in_path()
151
-
152
-
153
- def check_config_in_path() -> None:
154
- """
155
- Check if the configuration directory is in the PATH and notify the user.
156
- """
157
-
158
- path_dirs = os.environ.get("PATH", "").split(os.pathsep)
159
- config_dir_str = str(CONFIG_DIR)
160
-
161
- if config_dir_str in path_dirs:
162
- warning(
163
- f"[magenta]{CONFIG_DIR}[/magenta] was found in your [code]PATH[/code]. "
164
- f"You should remove any entries related to [magenta]{CONFIG_DIR}[/magenta] from your [code]PATH[/code]."
165
- )
156
+ success(f"Deleted [italic red]deprecated[/italic red] [magenta]{GO_CLI_PATH}[/magenta].")
166
157
 
167
158
 
168
159
  def main() -> None:
nextmv/cli/message.py CHANGED
@@ -31,7 +31,7 @@ def error(msg: str) -> None:
31
31
  if not msg.endswith("."):
32
32
  msg += "."
33
33
 
34
- rich.print(f"[red]Error:[/red] {msg}", file=sys.stderr)
34
+ rich.print(f":x: [red]Error:[/red] {msg}", file=sys.stderr)
35
35
 
36
36
  raise typer.Exit(code=1)
37
37
 
@@ -67,7 +67,7 @@ def warning(msg: str) -> None:
67
67
  if not msg.endswith("."):
68
68
  msg += "."
69
69
 
70
- rich.print(f":construction: {msg}", file=sys.stderr)
70
+ rich.print(f":construction: [yellow] Warning:[/yellow] {msg}", file=sys.stderr)
71
71
 
72
72
 
73
73
  def info(msg: str, emoji: str | None = None) -> None:
nextmv/cli/version.py CHANGED
@@ -18,7 +18,7 @@ def version() -> None:
18
18
  [bold][underline]Examples[/underline][/bold]
19
19
 
20
20
  - Show the version.
21
- $ [green]nextmv version[/green]
21
+ $ [dim]nextmv version[/dim]
22
22
  """
23
23
 
24
24
  version_callback(True)
nextmv/cloud/__init__.py CHANGED
@@ -1,42 +1,5 @@
1
1
  """Functionality for interacting with the Nextmv Cloud."""
2
2
 
3
- # These imports are kept for backwards compatibility but the preferred import path is
4
- # from nextmv directly. These imports will be removed in a future release.
5
- from nextmv.manifest import MANIFEST_FILE_NAME as MANIFEST_FILE_NAME
6
- from nextmv.manifest import Manifest as Manifest
7
- from nextmv.manifest import ManifestBuild as ManifestBuild
8
- from nextmv.manifest import ManifestContent as ManifestContent
9
- from nextmv.manifest import ManifestContentMultiFile as ManifestContentMultiFile
10
- from nextmv.manifest import ManifestContentMultiFileInput as ManifestContentMultiFileInput
11
- from nextmv.manifest import ManifestContentMultiFileOutput as ManifestContentMultiFileOutput
12
- from nextmv.manifest import ManifestOption as ManifestOption
13
- from nextmv.manifest import ManifestPython as ManifestPython
14
- from nextmv.manifest import ManifestPythonModel as ManifestPythonModel
15
- from nextmv.manifest import ManifestRuntime as ManifestRuntime
16
- from nextmv.manifest import ManifestType as ManifestType
17
- from nextmv.polling import PollingOptions as PollingOptions
18
- from nextmv.polling import poll as poll
19
- from nextmv.run import ErrorLog as ErrorLog
20
- from nextmv.run import ExternalRunResult as ExternalRunResult
21
- from nextmv.run import Format as Format
22
- from nextmv.run import FormatInput as FormatInput
23
- from nextmv.run import FormatOutput as FormatOutput
24
- from nextmv.run import Metadata as Metadata
25
- from nextmv.run import RunConfiguration as RunConfiguration
26
- from nextmv.run import RunInformation as RunInformation
27
- from nextmv.run import RunLog as RunLog
28
- from nextmv.run import RunQueuing as RunQueuing
29
- from nextmv.run import RunResult as RunResult
30
- from nextmv.run import RunType as RunType
31
- from nextmv.run import RunTypeConfiguration as RunTypeConfiguration
32
- from nextmv.run import TrackedRun as TrackedRun
33
- from nextmv.run import TrackedRunStatus as TrackedRunStatus
34
- from nextmv.run import run_duration as run_duration
35
- from nextmv.safe import safe_id as safe_id
36
- from nextmv.safe import safe_name_and_id as safe_name_and_id
37
- from nextmv.status import Status as Status
38
- from nextmv.status import StatusV2 as StatusV2
39
-
40
3
  from .acceptance_test import AcceptanceTest as AcceptanceTest
41
4
  from .acceptance_test import AcceptanceTestResults as AcceptanceTestResults
42
5
  from .acceptance_test import Comparison as Comparison
@@ -52,7 +15,6 @@ from .acceptance_test import MetricToleranceType as MetricToleranceType
52
15
  from .acceptance_test import MetricType as MetricType
53
16
  from .acceptance_test import ResultStatistics as ResultStatistics
54
17
  from .acceptance_test import StatisticType as StatisticType
55
- from .acceptance_test import ToleranceType as ToleranceType
56
18
  from .account import Account as Account
57
19
  from .account import AccountMember as AccountMember
58
20
  from .account import Queue as Queue
@@ -13,7 +13,7 @@ StatisticType : Enum
13
13
  Type of statistical process for collapsing multiple values of a metric.
14
14
  Comparison : Enum
15
15
  Comparison operators to use for comparing two metrics.
16
- ToleranceType : Enum
16
+ MetricToleranceType : Enum
17
17
  Type of tolerance used for a metric.
18
18
  ExperimentStatus : Enum
19
19
  Status of an acceptance test experiment.
@@ -46,7 +46,6 @@ from enum import Enum
46
46
 
47
47
  from nextmv.base_model import BaseModel
48
48
  from nextmv.cloud.batch_experiment import ExperimentStatus
49
- from nextmv.deprecated import deprecated
50
49
 
51
50
 
52
51
  class MetricType(str, Enum):
@@ -212,69 +211,6 @@ class Comparison(str, Enum):
212
211
  """Not equal to metric type."""
213
212
 
214
213
 
215
- class ToleranceType(str, Enum):
216
- """
217
- !!! warning
218
- `ToleranceType` is deprecated, use `MetricToleranceType` instead.
219
-
220
- Type of tolerance used for a metric.
221
-
222
- You can import the `ToleranceType` class directly from `cloud`:
223
-
224
- ```python
225
- from nextmv.cloud import ToleranceType
226
- ```
227
-
228
- This enumeration defines the different types of tolerances that can be used
229
- when comparing metrics in acceptance tests.
230
-
231
- Attributes
232
- ----------
233
- undefined : str
234
- Undefined tolerance type (empty string).
235
- absolute : str
236
- Absolute tolerance type, using a fixed value.
237
- relative : str
238
- Relative tolerance type, using a percentage.
239
-
240
- Examples
241
- --------
242
- >>> from nextmv.cloud import ToleranceType
243
- >>> tol_type = ToleranceType.absolute
244
- >>> tol_type
245
- <ToleranceType.absolute: 'absolute'>
246
- """
247
-
248
- undefined = ""
249
- """ToleranceType is deprecated, please use MetricToleranceType instead.
250
- Undefined tolerance type."""
251
- absolute = "absolute"
252
- """ToleranceType is deprecated, please use MetricToleranceType instead.
253
- Absolute tolerance type."""
254
- relative = "relative"
255
- """ToleranceType is deprecated, please use MetricToleranceType instead.
256
- Relative tolerance type."""
257
-
258
-
259
- # Override __getattribute__ to emit deprecation warnings when enum values are accessed
260
- _original_getattribute = ToleranceType.__class__.__getattribute__
261
-
262
-
263
- def _deprecated_getattribute(cls, name: str):
264
- # Only emit deprecation warning if this is specifically the ToleranceType class
265
- if cls is ToleranceType and name in ("undefined", "absolute", "relative"):
266
- deprecated(
267
- f"ToleranceType.{name}",
268
- "ToleranceType is deprecated and will be removed in a future version. "
269
- "Please use MetricToleranceType instead",
270
- )
271
-
272
- return _original_getattribute(cls, name)
273
-
274
-
275
- ToleranceType.__class__.__getattribute__ = _deprecated_getattribute
276
-
277
-
278
214
  class MetricToleranceType(str, Enum):
279
215
  """
280
216
  Type of tolerance used for a metric.
nextmv/cloud/account.py CHANGED
@@ -21,7 +21,7 @@ from pydantic import AliasChoices, Field
21
21
 
22
22
  from nextmv.base_model import BaseModel
23
23
  from nextmv.cloud.client import Client
24
- from nextmv.status import Status, StatusV2
24
+ from nextmv.status import StatusV2
25
25
 
26
26
 
27
27
  class QueuedRun(BaseModel):
@@ -57,8 +57,6 @@ class QueuedRun(BaseModel):
57
57
  ID of the application version used for the run.
58
58
  execution_class : str
59
59
  Execution class used for the run.
60
- status : Status
61
- Deprecated: use status_v2.
62
60
  status_v2 : StatusV2
63
61
  Status of the run.
64
62
 
@@ -74,7 +72,6 @@ class QueuedRun(BaseModel):
74
72
  ... "application_instance_id": "appins-123456",
75
73
  ... "application_version_id": "appver-123456",
76
74
  ... "execution_class": "standard",
77
- ... "status": "RUNNING",
78
75
  ... "status_v2": "RUNNING"
79
76
  ... })
80
77
  >>> print(queued_run.name)
@@ -99,8 +96,6 @@ class QueuedRun(BaseModel):
99
96
  """ID of the application version used for the run."""
100
97
  execution_class: str
101
98
  """Execution class used for the run."""
102
- status: Status
103
- """Deprecated: use status_v2."""
104
99
  status_v2: StatusV2
105
100
  """Status of the run."""
106
101