MCPcopy Index your code
hub / github.com/langchain-ai/deepagents / upgrade_command

Function upgrade_command

libs/code/deepagents_code/update_check.py:1050–1081  ·  view source on GitHub ↗

Return the shell command to upgrade `deepagents-code`. Falls back to the documented uv command for display-only guidance. Args: method: Install method override. Auto-detected if `None`. include_prereleases: Whether to include alpha/beta/rc releases. When

(
    method: InstallMethod | None = None,
    *,
    include_prereleases: bool | None = None,
    version: str | None = None,
)

Source from the content-addressed store, hash-verified

1048
1049
1050def upgrade_command(
1051 method: InstallMethod | None = None,
1052 *,
1053 include_prereleases: bool | None = None,
1054 version: str | None = None,
1055) -> str:
1056 """Return the shell command to upgrade `deepagents-code`.
1057
1058 Falls back to the documented uv command for display-only guidance.
1059
1060 Args:
1061 method: Install method override.
1062
1063 Auto-detected if `None`.
1064 include_prereleases: Whether to include alpha/beta/rc releases. When
1065 `None`, follows the installed version's channel. When `True`,
1066 returns the uv pre-release command regardless of `method`, since
1067 only uv can be steered onto the pre-release channel.
1068 version: Optional exact `deepagents-code` version pin for uv guidance.
1069 """
1070 include_prereleases = _resolve_include_prereleases(include_prereleases)
1071 if version is not None:
1072 requirement = _dcode_extras_requirement((), version=version)
1073 cmd = f"uv tool install -U {requirement}"
1074 if include_prereleases:
1075 cmd += " --prerelease allow"
1076 return cmd
1077 if include_prereleases:
1078 return _UV_PRERELEASE_UPGRADE_COMMAND
1079 if method is None:
1080 method = detect_install_method()
1081 return _UPGRADE_COMMANDS.get(method, FALLBACK_UPGRADE_COMMAND)
1082
1083
1084def prerelease_upgrade_supported(

Calls 4

detect_install_methodFunction · 0.85
getMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…