Open wasi-master opened 1 year ago
If a package isn't installed the version command errors out instead of notifying the user
Use the version command with the --show-installed-version flag on a package that you have not yet installed
--show-installed-version
It should show an error message to the user
To fix, in the line https://github.com/wasi-master/pypi-command-line/blob/6e0bf75e9bc6d1f5e2fc78d321a2f5b9ecbf679e/pypi_cli/__main__.py#L1417 remove pass and set version_info to None then add a check for if the version_info is none or it has a value and if it is none then show an error message, simple https://github.com/wasi-master/pypi-command-line/blob/6e0bf75e9bc6d1f5e2fc78d321a2f5b9ecbf679e/pypi_cli/__main__.py#L1419-L1420
or version_info could be set to "Could not find version" and then show it always
Describe the bug
If a package isn't installed the version command errors out instead of notifying the user
To Reproduce
Use the version command with the
--show-installed-version
flag on a package that you have not yet installedExpected behavior
It should show an error message to the user
Additional context
To fix, in the line https://github.com/wasi-master/pypi-command-line/blob/6e0bf75e9bc6d1f5e2fc78d321a2f5b9ecbf679e/pypi_cli/__main__.py#L1417 remove pass and set version_info to None then add a check for if the version_info is none or it has a value and if it is none then show an error message, simple https://github.com/wasi-master/pypi-command-line/blob/6e0bf75e9bc6d1f5e2fc78d321a2f5b9ecbf679e/pypi_cli/__main__.py#L1419-L1420
or version_info could be set to "Could not find version" and then show it always