desihub / desiutil

General DESI utilities, shell scripts, desiInstall, etc.
BSD 3-Clause "New" or "Revised" License
3 stars 9 forks source link

Ignore messages on STDERR unless there is a non-zero return code #176

Closed weaverba137 closed 3 years ago

weaverba137 commented 3 years ago

This PR fixes #174 by changing the logic of how messages printed on STDERR are handled by desiInstall. The new logic can be summarized by this snippet:

                    if len(err) > 0:
                        #
                        # Pass STDERR messages to the user, but do not
                        # raise an error unless the return code was non-zero.
                        #
                        if proc.returncode == 0:
                            message = ("Pip emitted messages on STDERR; these can probably be ignored:\n" +
                                       err)
                            self.log.warning(message)
                        else:
                            message = ("Potentially serious error detected during pip installation:\n" +
                                       err)
                            self.log.critical(message)
                            raise DesiInstallException(message)

@sbailey, I know you're out of the office. Maybe @tskisner can take a quick look? I think this will be pretty non-controversial though.

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.03%) to 66.629% when pulling 55c00faaf24659d3d4b85e7e88267e2771ee3759 on warn-on-stderr into ee25edc29a7922e18f6417342b02b3576cce9216 on master.

weaverba137 commented 3 years ago

@sbailey, do we need to get this into a tag right away or is it non-urgent?

sbailey commented 3 years ago

non-urgent, we can tag later at our leisure. Thanks.