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
setup.py: Recommend installation command for pkgs #6575
Conversation
This is still a work in progress, I haven't tested it to my satisfaction - but would love some feedback on the method used as I've never contributed to matplotlib before. |
pkg_name = self.pkg_names.get(manager, None) | ||
if pkg_name: | ||
try: | ||
_ = check_output(["which", manager], |
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.
There is a shutil.which
, but unfortunately, it's 3.3+. It's probably not worth it to conditionally call it, but can you add a comment about switching to it when we drop 2.7?
Bump - reminder for review of this PR |
def install_help_msg(self): | ||
""" | ||
The help message to show if the package is not installed. The help | ||
message shown depends on whether some class variables are present. |
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 add a note to this docstring explaining how to add the feature to sub-classes?
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.
done
If a package is not found, provide a better error message that also explains how to install the package or gives the user a link explaining what to do to install the package. The supported methods are: - Provide a link for windows - Provide a command using a package manager for the OS (For example: apt-get for Ubuntu/Debian, dnf and yum for Fedora/CentOS/RHEL, brew and port for OSX)
👍 I'll merge this as soon as CI passes again (just to be paranoid). |
@tacaswell Do you recommend we use |
It will only be seen if things go wrong anyway 😈 . Given the amount of sound and fury in the upstream bug, I am inclined to let this shake it self out a bit more before jumping on a solution. On the other hand, better to deal with it now than later (when we have forgotten). |
Maybe we could merge the PR but keep the issue open or create a new tracking issue to keep track of it ? |
If a package is not found, provide a better error message
that also explains how to install the package or gives the
user a link explaining what to do to install the package.
The supported methods are:
(For example: apt-get for Ubuntu/Debian, dnf and yum for
Fedora/CentOS/RHEL, brew and port for OSX)
Fixes #6546