'Check if req_to_install should be skipped.
This will check if the req is installed, and whether we should upgrade
or reinstall it, taking into account all the relevant user options.
After calling this req_to_install will only have satisfied_by set to
None if the req_to_install is to be upgraded/reinstalled etc. Any
other value will be a dist recording the current thing installed that
satisfies the requirement.
Note that for vcs urls and the like we can\'t assess skipping in this
routine - we simply identify that we need to pull the thing down,
then later on it is pulled down and introspected to assess upgrade/
reinstalls etc.
:return: A text reason for why it was skipped, or None.'

def _check_skip_installed(self, req_to_install, finder):

    req_to_install.check_if_exists()
    if req_to_install.satisfied_by:
        skip_reason = 'satisfied    (use    --upgrade    to    upgrade)'
        if self.upgrade:
            best_installed = False
            if (not (self.force_reinstall or req_to_install.link)):
                try:
                    finder.find_requirement(req_to_install, self.upgrade)
                except BestVersionAlreadyInstalled:
                    skip_reason = 'up-to-date'
                    best_installed = True
                except DistributionNotFound:
                    pass
            if (not best_installed):
                if (not (self.use_user_site and (not dist_in_usersite(req_to_install.satisfied_by)))):
                    req_to_install.conflicts_with = req_to_install.satisfied_by
                req_to_install.satisfied_by = None
        return skip_reason
    else:
        return None
