code: def _get_pkg_meta(self):
          
          logger = logging.getLogger('pyrocore.scripts.base.version_info')
          pkg_info = None
          warnings = []
  
          for info_ext, info_name in (('.dist-info', 'METADATA'), ('.egg-info', 'PKG-INFO')):
              try:
                  # Development setup
                  pkg_path = os.path.join(
                      __file__.split(__name__.replace('.', os.sep))[0],  # containing path
                      __name__.split(".")[0]  # package name
                  )
                  if os.path.exists(pkg_path + info_ext):
                      pkg_path += info_ext
                  else:
                      globbed_paths = glob.glob(pkg_path + "-*-py%d.%d" % sys.version_info[:2] + info_ext)
                      if len(globbed_paths) == 1:
                          pkg_path = globbed_paths[0]
                      elif globbed_paths:
                          warnings.append("Found {} release-specific candidate versions in *{}"
                                          .format(len(globbed_paths), info_ext))
                          pkg_path = None
                      else:
                          globbed_paths = glob.glob(pkg_path + "-*" + info_ext)
                          if len(globbed_paths) == 1:
                              pkg_path = globbed_paths[0]
                          else:
                              warnings.append("Found {} candidate versions in *{}"
                                              .format(len(globbed_paths), info_ext))
                              pkg_path = None
                  if pkg_path:
                      with open(os.path.join(pkg_path, info_name)) as handle:
                          pkg_info = handle.read()
                      break
              except IOError:
                  continue
  
          if not pkg_info:
              logger.warn("Software version cannot be determined! ({})".format(', '.join(warnings)))
  
          return pkg_info or "Version: 0.0.0\n"
docs: Try to find package metadata.