-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Currently, when users upgrade, they need to run minitrino lib-install
after upgrading the package via Pip. This should be simplified rather than requiring the user to run two commands.
Logic
To account for an uninstalled library, the _get_minitrino_lib_dir()
function should be updated to automatically install the library. In this case, there is no need for a user prompt.
If the user inputs "no", then throw the user error.
Furthermore, whenever a Minitrino command is executed that requires the library (any command that calls the check_lib()
function), run a version check to compare the library version to the CLI version.
The check_lib()
function can be extended to compare the CLI and library version. If there is a version mismatch between the CLI and the library, prompt the user to upgrade or downgrade the library to match the CLI version:
[w] The current CLI version is ${cli_version} which does not match the installed library version ${lib_version}. Install library version ${cli_version}? [Y/N]
If the user says no, log an additional warning:
[w] It is highly recommended to use matching CLI and library versions. Mismatched versions are likely to cause errors. To install the library manually, run `minitrino lib-install`.
Calling lib-install
Command from Other Commands
The library installation logic needs to be callable from any command that calls the check_lib()
function. Click supports this out of the box.
For example, the current command shows that the CLI version > library version. If the user agrees to install, the current command invokes (ctx.invoke(lib_install, version=CLI_VERSION)
) the lib-install
command.
Sub-issues
Metadata
Metadata
Assignees
Labels
Projects
Status