code: def parse_package_for_version(name):
      
      from utool import util_regex
      init_fpath = join(name, '__init__.py')
      version_errmsg = textwrap.dedent(
          '''
          You must include a __version__ variable
          in %s\'s __init__.py file.
          Try something like:
          __version__ = '1.0.0.dev1' ''' % (name,))
      if not exists(init_fpath):
          raise AssertionError(version_errmsg)
      val_regex = util_regex.named_field('version', '[0-9a-zA-Z.]+')
      regexstr = '__version__ *= *[\'"]' + val_regex
      def parse_version(line):
          # Helper
          line = line.replace(' ', '').replace('\t', '')
          match_dict = util_regex.regex_parse(regexstr, line)
          if match_dict is not None:
              return match_dict['version']
      # Find the version  in the text of the source
      #version = 'UNKNOWN_VERSION'
      with open(init_fpath, 'r') as file_:
          for line in file_.readlines():
              if line.startswith('__version__'):
                  version = parse_version(line)
                  if version is not None:
                      return version
      raise AssertionError(version_errmsg)
docs: Searches for a variable named __version__ in name's __init__.py file and
      returns the value.  This function parses the source text. It does not load
      the module.