Update Command
The update command is designed to help you manage the version of Graph-sitter installed on your system. Whether you want to update to the latest version or switch to a specific version, this command offers a streamlined way to do so. Additionally, you can list all supported versions available on PyPI.
gs update [OPTIONS]Usage
gs update [OPTIONS]Options
-
--list, -l: List all supported versions of Codegen. When used, the command fetches the available releases from PyPI, filters them to display a range of versions (typically including the current version and a few preceding minor versions), and highlights the current version in the output. -
--version, -v: Update to a specific version of Codegen (e.g.,2.1.0). This option enables you to target a particular version rather than updating to the latest available release.
Examples
Update Graph-sitter to the latest version:
gs updateList all supported versions of Codegen:
gs update --listUpdate Graph-sitter to a specific version:
gs update --version 2.1.0Execution Flow
When you run the update command, the following steps occur:
-
Retrieve Current Version: The command retrieves the current version of Graph-sitter by accessing package metadata.
-
Option Handling:
-
Listing Versions: If you use the
--listflag, the command fetches all available releases from PyPI, filters them based on a defined range (typically covering future versions and a couple of previous minor versions), and prints the list with the current version highlighted. -
Specific Version Update: If the
--versionoption is provided, the command installs the specified version by invokingpip installwith the exact version (e.g.,pip install graph-sitter==2.1.0). -
Default Update: If no options are provided, the command updates Graph-sitter to the latest version using
pip install --upgrade.
-
-
Error Handling: The command checks for mutually exclusive options. If both
--listand--versionare specified simultaneously, an error is raised.
Ensure you use either --list or --version when running the update command, not both.