deepctl-cmd-update 0.2.5__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.5 → deepctl_cmd_update-0.2.7}/PKG-INFO +1 -1
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/pyproject.toml +1 -1
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/command.py +25 -6
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/plugin_update_check.py +18 -13
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/startup_check.py +10 -4
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/PKG-INFO +1 -1
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/README.md +0 -0
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/setup.cfg +0 -0
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/__init__.py +0 -0
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/installation.py +0 -0
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/models.py +0 -0
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/version_check.py +0 -0
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/SOURCES.txt +0 -0
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/dependency_links.txt +0 -0
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/entry_points.txt +0 -0
- {deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/requires.txt +0 -0
- {deepctl_cmd_update-0.2.5 → 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
|
+
)
|
{deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/plugin_update_check.py
RENAMED
|
@@ -256,18 +256,23 @@ def print_pending_plugin_notifications() -> None:
|
|
|
256
256
|
if not updates:
|
|
257
257
|
return
|
|
258
258
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
f"\033[33mPlugin update available: {u['name']} {u['current']} → {u['latest']}"
|
|
263
|
-
f" — run 'deepctl plugin update {u['name']}' to upgrade\033[0m\n"
|
|
264
|
-
)
|
|
265
|
-
else:
|
|
266
|
-
sys.stderr.write("\033[33mPlugin updates available:\033[0m\n")
|
|
267
|
-
for u in updates:
|
|
259
|
+
try:
|
|
260
|
+
if len(updates) == 1:
|
|
261
|
+
u = updates[0]
|
|
268
262
|
sys.stderr.write(
|
|
269
|
-
f"\033[
|
|
263
|
+
f"\033[33mPlugin update available: {u['name']} {u['current']} → {u['latest']}"
|
|
264
|
+
f" — run 'deepctl plugin update {u['name']}' to upgrade\033[0m\n"
|
|
270
265
|
)
|
|
271
|
-
|
|
272
|
-
"\033[
|
|
273
|
-
|
|
266
|
+
else:
|
|
267
|
+
sys.stderr.write("\033[33mPlugin updates available:\033[0m\n")
|
|
268
|
+
for u in updates:
|
|
269
|
+
sys.stderr.write(
|
|
270
|
+
f"\033[33m {u['name']} {u['current']} → {u['latest']}\033[0m\n"
|
|
271
|
+
)
|
|
272
|
+
sys.stderr.write(
|
|
273
|
+
"\033[33mRun 'deepctl plugin update <name>' to upgrade\033[0m\n"
|
|
274
|
+
)
|
|
275
|
+
except (BrokenPipeError, OSError, ValueError):
|
|
276
|
+
# The output stream closed (e.g. an MCP host disconnected stdio
|
|
277
|
+
# after `dg mcp` finished). These notifications are purely advisory.
|
|
278
|
+
pass
|
{deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/startup_check.py
RENAMED
|
@@ -197,7 +197,13 @@ def print_pending_notification() -> None:
|
|
|
197
197
|
latest = _result.get("latest")
|
|
198
198
|
current = _result.get("current")
|
|
199
199
|
if latest and current:
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
200
|
+
try:
|
|
201
|
+
sys.stderr.write(
|
|
202
|
+
f"\n\033[33m Update available: {current} → {latest}"
|
|
203
|
+
f" — run \033[1mdg update\033[0m\033[33m to upgrade\033[0m\n\n"
|
|
204
|
+
)
|
|
205
|
+
except (BrokenPipeError, OSError, ValueError):
|
|
206
|
+
# The output stream closed (e.g. an MCP host disconnected stdio
|
|
207
|
+
# after `dg mcp` finished). Nothing useful to do — the notification
|
|
208
|
+
# is purely advisory.
|
|
209
|
+
pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/installation.py
RENAMED
|
File without changes
|
|
File without changes
|
{deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update/version_check.py
RENAMED
|
File without changes
|
{deepctl_cmd_update-0.2.5 → 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.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/requires.txt
RENAMED
|
File without changes
|
{deepctl_cmd_update-0.2.5 → deepctl_cmd_update-0.2.7}/src/deepctl_cmd_update.egg-info/top_level.txt
RENAMED
|
File without changes
|