code: def get_current_version_by_config_file() -> str:
      
      debug('get_current_version_by_config_file')
      filename, variable = config.get('semantic_release',
                                      'version_variable').split(':')
      variable = variable.strip()
      debug(filename, variable)
      with open(filename, 'r') as fd:
          parts = re.search(
              r'^{0}\s*=\s*[\'"]([^\'"]*)[\'"]'.format(variable),
              fd.read(),
              re.MULTILINE
          )
          if not parts:
              raise ImproperConfigurationError
          debug(parts)
          return parts.group(1)
docs: Get current version from the version variable defined in the configuration
  
      :return: A string with the current version number
      :raises ImproperConfigurationError: if version variable cannot be parsed