def get_setup_version(reponame):
import json<EOL>basepath = os.path.split(__file__)[<NUM_LIT:0>]<EOL>version_file_path = os.path.join(basepath, reponame, '<STR_LIT>')<EOL>try:<EOL><INDENT>from param import version<EOL><DEDENT>except:<EOL><INDENT>version = embed_version(basepath)<EOL><DEDENT>if version is not None:<EOL><INDENT>return version.Version.setup_version(basepath, reponame, archive_commit="<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>print("<STR_LIT>")<EOL>return json.load(open(version_file_path, '<STR_LIT:r>'))['<STR_LIT>']<EOL><DEDENT>
Helper to get the current version from either git describe or the
.version file (if available).