parameters: (self, value)
return_statement: return version
docstring: Parses `version` option value.
  
          :param value:
          :rtype: str
docstring_summary: Parses `version` option value.
docstring_tokens: Parses version option value .
function: def _parse_version(self, value):
          """Parses `version` option value.
  
          :param value:
          :rtype: str
  
          """
          version = self._parse_file(value)
  
          if version != value:
              version = version.strip()
              # Be strict about versions loaded from file because it's easy to
              # accidentally include newlines and other unintended content
              try:
                  Version(version)
              except InvalidVersion:
                  tmpl = (
                      'Version loaded from {value} does not '
                      'comply with PEP 440: {version}'
                  )
                  raise DistutilsOptionError(tmpl.format(**locals()))
  
              return version
  
          version = self._parse_attr(value, self.package_dir)
  
          if callable(version):
              version = version()
  
          if not isinstance(version, str):
              if hasattr(version, '__iter__'):
                  version = '.'.join(map(str, version))
              else:
                  version = '%s' % version
  
          return version
function_tokens: def _parse_version ( self , value ) : version = self . _parse_file ( value ) if version != value : version = version . strip ( ) # Be strict about versions loaded from file because it's easy to # accidentally include newlines and other unintended content try : Version ( version ) except InvalidVersion : tmpl = ( 'Version loaded from {value} does not ' 'comply with PEP 440: {version}' ) raise DistutilsOptionError ( tmpl . format ( * * locals ( ) ) ) return version version = self . _parse_attr ( value , self . package_dir ) if callable ( version ) : version = version ( ) if not isinstance ( version , str ) : if hasattr ( version , '__iter__' ) : version = '.' . join ( map ( str , version ) ) else : version = '%s' % version return version