-
-
Notifications
You must be signed in to change notification settings - Fork 197
add check to the doctor that the 'six' python package is installed on… #2612
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
lib/services/doctor-service.ts
Outdated
let sixPackagesFoundCount = parseInt(queryForSixPackage); | ||
if (sixPackagesFoundCount === 0) { | ||
hasInvalidPackages = true; | ||
this.$logger.error("Python 'six' package not found. Please install it by running 'pip install six' from the terminal."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you follow the same structure of messages as the others warnings:
this.$logger.warn("Python 'six' package not found.").
this.$logger.out("<information why do I need this package and what issues will occur in case I do not install it>. <information how to install this package>");
The concept is - warning
message (in yellow) that something is missing and additional information how will this affect me and how to fix the issue (text will be in the default terminal color).
For example I do not know what's the idea of this package and I will not install it on my machine without evidence that I need it.
lib/services/doctor-service.ts
Outdated
this.$logger.error("Python 'six' package not found. Please install it by running 'pip install six' from the terminal."); | ||
} | ||
} catch (error) { | ||
this.$logger.error("Cannot retrieve python installed packages. Please, make sure you have both 'python' and 'pip' installed."); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above - logger.warn
+ logger.out
.
Additionally it's a good practice to add the real error to the trace logs:
this.$logger.trace(`Error while validating Python packages. Error is: ${error.message}`);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please provide a description for this PR:
What problem does it solve and what'll the behavior be after this PR.
535ddb0
to
8c74f3a
Compare
run ci |
When Python is installed on Mac via Brew it's missing the "six" python package, which is installed by default when using the default Python installer for Mac. The "six" python package is required from the CLI in order to work properly.
So, we added the check for "six" python package presence in the TNS Doctor so that it detects the missing piece and gives advice how to fix your environment.