Skip to content

Commit 8213065

Browse files
committed
fix(update): serialize InstallMethod enum to string and fix command name
InstallMethod.PIP is a StrEnum — storing it directly in YAML config raises 'cannot represent an object'. Use .value to store the string. Also fix 'deepctl update' → 'dg update' in format_version_message (a second occurrence missed in the earlier rename).
1 parent 68fcfd2 commit 8213065

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

packages/deepctl-cmd-update/src/deepctl_cmd_update/command.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,10 @@ def handle(
131131
detector = InstallationDetector()
132132
install_info = detector.detect()
133133

134-
# Store installation info for future use
135-
config._set_config_value("update.installation_method", install_info.method)
134+
# Store installation info for future use — serialize enum to its string value
135+
config._set_config_value(
136+
"update.installation_method", install_info.method.value
137+
)
136138
config._set_config_value("update.installation_path", install_info.path)
137139
config.save()
138140

packages/deepctl-cmd-update/src/deepctl_cmd_update/version_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,5 +270,5 @@ def format_version_message(info: VersionInfo) -> str:
270270
else:
271271
message += f" (released {days_old} days ago)"
272272

273-
message += "\nRun 'deepctl update' to upgrade"
273+
message += "\nRun 'dg update' to upgrade"
274274
return message

packages/deepctl-cmd-update/tests/unit/test_version_check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,4 +273,4 @@ def test_update_available(self):
273273
msg = format_version_message(info)
274274
assert "1.0.0" in msg
275275
assert "2.0.0" in msg
276-
assert "deepctl update" in msg
276+
assert "dg update" in msg

0 commit comments

Comments
 (0)