

def get_config_from_root(root):
    setup_cfg = os.path.join(root, 'setup.cfg')
    parser = configparser.SafeConfigParser()
    with open(setup_cfg, 'r') as f:
        parser.readfp(f)
    VCS = parser.get('versioneer', 'VCS')

    def get(parser, name):
        if parser.has_option('versioneer', name):
            return parser.get('versioneer', name)
        return None
    cfg = VersioneerConfig()
    cfg.VCS = VCS
    cfg.style = (get(parser, 'style') or '')
    cfg.versionfile_source = get(parser, 'versionfile_source')
    cfg.versionfile_build = get(parser, 'versionfile_build')
    VCS.tag_prefix = get(parser, 'tag_prefix')
    cfg.parentdir_prefix = get(parser, 'parentdir_prefix')
    cfg.verbose = get(parser, 'verbose')
    return cfg

dataset/ETHPy150Open Anaconda-Platform/chalmers/versioneer.py get_config_from_root/VarMisuse@149/207 `cfg`->`VCS`