parameters: (self, req)
return_statement: return dist
docstring: Takes a InstallRequirement and returns a single AbstractDist \
          representing a prepared variant of the same.
docstring_summary: Takes a InstallRequirement and returns a single AbstractDist \
          representing a prepared variant of the same.
docstring_tokens: Takes a InstallRequirement and returns a single AbstractDist \ representing a prepared variant of the same .
function: def _get_dist_for(self, req):
          # type: (InstallRequirement) -> Distribution
          """Takes a InstallRequirement and returns a single AbstractDist \
          representing a prepared variant of the same.
          """
          if req.editable:
              return self.preparer.prepare_editable_requirement(req)
  
          # satisfied_by is only evaluated by calling _check_skip_installed,
          # so it must be None here.
          assert req.satisfied_by is None
          skip_reason = self._check_skip_installed(req)
  
          if req.satisfied_by:
              return self.preparer.prepare_installed_requirement(
                  req, skip_reason
              )
  
          # We eagerly populate the link, since that's our "legacy" behavior.
          self._populate_link(req)
          dist = self.preparer.prepare_linked_requirement(req)
  
          # NOTE
          # The following portion is for determining if a certain package is
          # going to be re-installed/upgraded or not and reporting to the user.
          # This should probably get cleaned up in a future refactor.
  
          # req.req is only avail after unpack for URL
          # pkgs repeat check_if_exists to uninstall-on-upgrade
          # (#14)
          if not self.ignore_installed:
              req.check_if_exists(self.use_user_site)
  
          if req.satisfied_by:
              should_modify = (
                  self.upgrade_strategy != "to-satisfy-only" or
                  self.force_reinstall or
                  self.ignore_installed or
                  req.link.scheme == 'file'
              )
              if should_modify:
                  self._set_req_to_reinstall(req)
              else:
                  logger.info(
                      'Requirement already satisfied (use --upgrade to upgrade):'
                      ' %s', req,
                  )
          return dist
function_tokens: def _get_dist_for ( self , req ) : # type: (InstallRequirement) -> Distribution if req . editable : return self . preparer . prepare_editable_requirement ( req ) # satisfied_by is only evaluated by calling _check_skip_installed, # so it must be None here. assert req . satisfied_by is None skip_reason = self . _check_skip_installed ( req ) if req . satisfied_by : return self . preparer . prepare_installed_requirement ( req , skip_reason ) # We eagerly populate the link, since that's our "legacy" behavior. self . _populate_link ( req ) dist = self . preparer . prepare_linked_requirement ( req ) # NOTE # The following portion is for determining if a certain package is # going to be re-installed/upgraded or not and reporting to the user. # This should probably get cleaned up in a future refactor. # req.req is only avail after unpack for URL # pkgs repeat check_if_exists to uninstall-on-upgrade # (#14) if not self . ignore_installed : req . check_if_exists ( self . use_user_site ) if req . satisfied_by : should_modify = ( self . upgrade_strategy != "to-satisfy-only" or self . force_reinstall or self . ignore_installed or req . link . scheme == 'file' ) if should_modify : self . _set_req_to_reinstall ( req ) else : logger . info ( 'Requirement already satisfied (use --upgrade to upgrade):' ' %s' , req , ) return dist