deepctl-cmd-update 0.2.6__tar.gz → 0.2.7__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.
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/PKG-INFO +1 -1
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/pyproject.toml +1 -1
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/command.py +25 -6
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/PKG-INFO +1 -1
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/README.md +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/setup.cfg +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/__init__.py +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/installation.py +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/models.py +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/plugin_update_check.py +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/startup_check.py +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/version_check.py +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/SOURCES.txt +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/dependency_links.txt +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/entry_points.txt +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/requires.txt +0 -0
- {deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/top_level.txt +0 -0
|
@@ -69,8 +69,16 @@ class UpdateCommand(BaseCommand):
|
|
|
69
69
|
auth_manager: Any, # Not used for update command
|
|
70
70
|
client: Any, # Not used for update command
|
|
71
71
|
**kwargs: Any,
|
|
72
|
-
) -> dict[str, Any]:
|
|
73
|
-
"""Handle the update command execution.
|
|
72
|
+
) -> UpdateResult | dict[str, Any]:
|
|
73
|
+
"""Handle the update command execution.
|
|
74
|
+
|
|
75
|
+
Returns the model rather than a dict wherever the exit code has to
|
|
76
|
+
be non-zero: BaseCommand.exit_code_for reads `.status` off the
|
|
77
|
+
result, and a dict has none, so a dict always exits 0. The three
|
|
78
|
+
failure paths carry status="error" (exit 1) and the decline path
|
|
79
|
+
status="cancelled" (exit 2). output_result unwraps either, so the
|
|
80
|
+
JSON payload is the same shape from both.
|
|
81
|
+
"""
|
|
74
82
|
console = get_console()
|
|
75
83
|
|
|
76
84
|
# Extract arguments from kwargs
|
|
@@ -93,10 +101,13 @@ class UpdateCommand(BaseCommand):
|
|
|
93
101
|
version_info = asyncio.run(version_checker.check_version(force=True))
|
|
94
102
|
except Exception as e:
|
|
95
103
|
print_error(f"Failed to check for updates: {e}")
|
|
104
|
+
# status="error" on the model, not a dict: see the docstring.
|
|
105
|
+
# A command that failed has to exit 1, as the README says.
|
|
96
106
|
return UpdateResult(
|
|
107
|
+
status="error",
|
|
97
108
|
success=False,
|
|
98
109
|
message=f"Failed to check for updates: {e}",
|
|
99
|
-
)
|
|
110
|
+
)
|
|
100
111
|
|
|
101
112
|
# Display version info
|
|
102
113
|
message = format_version_message(version_info)
|
|
@@ -167,14 +178,20 @@ class UpdateCommand(BaseCommand):
|
|
|
167
178
|
# Confirm update
|
|
168
179
|
if not yes and not Confirm.ask("\nDo you want to proceed with the update?"):
|
|
169
180
|
print_info("Update cancelled")
|
|
181
|
+
# Return the model, not .model_dump(): BaseCommand.exit_code_for
|
|
182
|
+
# reads `.status` off the result, and a plain dict has none -- a
|
|
183
|
+
# declined update used to exit 0 while its own payload said
|
|
184
|
+
# "Update cancelled by user". status="cancelled" is the documented
|
|
185
|
+
# exit 2.
|
|
170
186
|
return UpdateResult(
|
|
187
|
+
status="cancelled",
|
|
171
188
|
success=False,
|
|
172
189
|
message="Update cancelled by user",
|
|
173
190
|
current_version=version_info.current_version,
|
|
174
191
|
latest_version=version_info.latest_version,
|
|
175
192
|
update_available=version_info.update_available,
|
|
176
193
|
installation_method=install_info.method.value,
|
|
177
|
-
)
|
|
194
|
+
)
|
|
178
195
|
|
|
179
196
|
# Execute update
|
|
180
197
|
print_info("Updating deepctl...")
|
|
@@ -212,13 +229,14 @@ class UpdateCommand(BaseCommand):
|
|
|
212
229
|
console.print(f"[yellow]{shlex.join(update_command)}[/yellow]")
|
|
213
230
|
|
|
214
231
|
return UpdateResult(
|
|
232
|
+
status="error",
|
|
215
233
|
success=False,
|
|
216
234
|
message=f"Update failed: {error_msg}",
|
|
217
235
|
current_version=version_info.current_version,
|
|
218
236
|
latest_version=version_info.latest_version,
|
|
219
237
|
update_available=version_info.update_available,
|
|
220
238
|
installation_method=install_info.method.value,
|
|
221
|
-
)
|
|
239
|
+
)
|
|
222
240
|
|
|
223
241
|
except Exception as e:
|
|
224
242
|
print_error(f"Failed to execute update: {e}")
|
|
@@ -228,10 +246,11 @@ class UpdateCommand(BaseCommand):
|
|
|
228
246
|
console.print(f"[yellow]{update_command}[/yellow]")
|
|
229
247
|
|
|
230
248
|
return UpdateResult(
|
|
249
|
+
status="error",
|
|
231
250
|
success=False,
|
|
232
251
|
message=f"Failed to execute update: {e}",
|
|
233
252
|
current_version=version_info.current_version,
|
|
234
253
|
latest_version=version_info.latest_version,
|
|
235
254
|
update_available=version_info.update_available,
|
|
236
255
|
installation_method=install_info.method.value,
|
|
237
|
-
)
|
|
256
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/installation.py
RENAMED
|
File without changes
|
|
File without changes
|
{deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/plugin_update_check.py
RENAMED
|
File without changes
|
{deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/startup_check.py
RENAMED
|
File without changes
|
{deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/version_check.py
RENAMED
|
File without changes
|
{deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/SOURCES.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/requires.txt
RENAMED
|
File without changes
|
{deepctl_cmd_update-0.2.6 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/top_level.txt
RENAMED
|
File without changes
|