parameters: (dist)
return_statement: return (None, False, comments)
docstring: Compute and return values (req, editable, comments) for use in
      FrozenRequirement.from_dist().
docstring_summary: Compute and return values (req, editable, comments) for use in
      FrozenRequirement.from_dist().
docstring_tokens: Compute and return values ( req editable comments ) for use in FrozenRequirement . from_dist () .
function: def get_requirement_info(dist):
      # type: (Distribution) -> RequirementInfo
      """
      Compute and return values (req, editable, comments) for use in
      FrozenRequirement.from_dist().
      """
      if not dist_is_editable(dist):
          return (None, False, [])
  
      location = os.path.normcase(os.path.abspath(dist.location))
  
      from pip._internal.vcs import RemoteNotFoundError, vcs
      vcs_backend = vcs.get_backend_for_dir(location)
  
      if vcs_backend is None:
          req = dist.as_requirement()
          logger.debug(
              'No VCS found for editable requirement "%s" in: %r', req,
              location,
          )
          comments = [
              f'# Editable install with no version control ({req})'
          ]
          return (location, True, comments)
  
      try:
          req = vcs_backend.get_src_requirement(location, dist.project_name)
      except RemoteNotFoundError:
          req = dist.as_requirement()
          comments = [
              '# Editable {} install with no remote ({})'.format(
                  type(vcs_backend).__name__, req,
              )
          ]
          return (location, True, comments)
  
      except BadCommand:
          logger.warning(
              'cannot determine version of editable source in %s '
              '(%s command not found in path)',
              location,
              vcs_backend.name,
          )
          return (None, True, [])
  
      except InstallationError as exc:
          logger.warning(
              "Error when trying to get requirement for VCS system %s, "
              "falling back to uneditable format", exc
          )
      else:
          return (req, True, [])
  
      logger.warning(
          'Could not determine repository location of %s', location
      )
      comments = ['## !! Could not determine repository location']
  
      return (None, False, comments)
function_tokens: def get_requirement_info ( dist ) : # type: (Distribution) -> RequirementInfo if not dist_is_editable ( dist ) : return ( None , False , [ ] ) location = os . path . normcase ( os . path . abspath ( dist . location ) ) from pip . _internal . vcs import RemoteNotFoundError , vcs vcs_backend = vcs . get_backend_for_dir ( location ) if vcs_backend is None : req = dist . as_requirement ( ) logger . debug ( 'No VCS found for editable requirement "%s" in: %r' , req , location , ) comments = [ f'# Editable install with no version control ({req})' ] return ( location , True , comments ) try : req = vcs_backend . get_src_requirement ( location , dist . project_name ) except RemoteNotFoundError : req = dist . as_requirement ( ) comments = [ '# Editable {} install with no remote ({})' . format ( type ( vcs_backend ) . __name__ , req , ) ] return ( location , True , comments ) except BadCommand : logger . warning ( 'cannot determine version of editable source in %s ' '(%s command not found in path)' , location , vcs_backend . name , ) return ( None , True , [ ] ) except InstallationError as exc : logger . warning ( "Error when trying to get requirement for VCS system %s, " "falling back to uneditable format" , exc ) else : return ( req , True , [ ] ) logger . warning ( 'Could not determine repository location of %s' , location ) comments = [ '## !! Could not determine repository location' ] return ( None , False , comments )