

def get_versions(verbose=False):
    if ('versioneer' in sys.modules):
        del sys.modules['versioneer']
    root = get_root()
    cfg = get_config_from_root(root)
    assert (cfg.VCS is not None), 'please set [versioneer]VCS= in setup.cfg'
    handlers = HANDLERS.get(cfg.VCS)
    assert handlers, ("unrecognized VCS '%s'" % cfg.VCS)
    verbose = (verbose or cfg.verbose)
    assert (cfg.versionfile_source is not None), 'please set versioneer.versionfile_source'
    assert (cfg.tag_prefix is not None), 'please set versioneer.tag_prefix'
    versionfile_abs = os.path.join(root, cfg.versionfile_source)
    get_keywords_f = handlers.get('get_keywords')
    from_keywords_f = handlers.get('keywords')
    if (get_keywords_f and from_keywords_f):
        try:
            keywords = get_keywords_f(versionfile_abs)
            ver = from_keywords_f(keywords, cfg.tag_prefix, verbose)
            if verbose:
                print(('got version from expanded keyword %s' % ver))
            return ver
        except NotThisMethod:
            pass
    try:
        ver = versions_from_file(versionfile_abs)
        if verbose:
            print(('got version from file %s %s' % (versionfile_abs, ver)))
        return ver
    except NotThisMethod:
        pass
    from_vcs_f = handlers.get('pieces_from_vcs')
    if from_vcs_f:
        try:
            pieces = from_vcs_f(cfg.tag_prefix, root, verbose)
            ver = render(pieces, cfg.style)
            if verbose:
                print(('got version from VCS %s' % ver))
            return ver
        except NotThisMethod:
            pass
    try:
        if cfg.parentdir_prefix:
            ver = versions_from_parentdir(cfg.parentdir_prefix, root, verbose)
            if verbose:
                print(('got version from parentdir %s' % ver))
            return ver
    except NotThisMethod:
        pass
    if verbose:
        print('unable to compute version')
    return {
        'version': '0+unknown',
        'full-revisionid': None,
        'dirty': None,
        'error': 'unable to compute version',
    }

dataset/ETHPy150Open Anaconda-Platform/chalmers/versioneer.py get_versions/original