MCPcopy Create free account
hub / github.com/microsoft/debugpy / get_versions

Function get_versions

versioneer.py:1672–1745  ·  view source on GitHub ↗

Get the project version from whatever source is available. Returns dict with two keys: 'version' and 'full'.

(verbose=False)

Source from the content-addressed store, hash-verified

1670
1671
1672def get_versions(verbose=False):
1673 """Get the project version from whatever source is available.
1674
1675 Returns dict with two keys: 'version' and 'full'.
1676 """
1677 if "versioneer" in sys.modules:
1678 # see the discussion in cmdclass.py:get_cmdclass()
1679 del sys.modules["versioneer"]
1680
1681 root = get_root()
1682 cfg = get_config_from_root(root)
1683
1684 assert cfg.VCS is not None, "please set [versioneer]VCS= in setup.cfg"
1685 handlers = HANDLERS.get(cfg.VCS)
1686 assert handlers, "unrecognized VCS '%s'" % cfg.VCS
1687 verbose = verbose or cfg.verbose
1688 assert cfg.versionfile_source is not None, \
1689 "please set versioneer.versionfile_source"
1690 assert cfg.tag_prefix is not None, "please set versioneer.tag_prefix"
1691
1692 versionfile_abs = os.path.join(root, cfg.versionfile_source)
1693
1694 # extract version from first of: _version.py, VCS command (e.g. 'git
1695 # describe'), parentdir. This is meant to work for developers using a
1696 # source checkout, for users of a tarball created by 'setup.py sdist',
1697 # and for users of a tarball/zipball created by 'git archive' or github's
1698 # download-from-tag feature or the equivalent in other VCSes.
1699
1700 get_keywords_f = handlers.get("get_keywords")
1701 from_keywords_f = handlers.get("keywords")
1702 if get_keywords_f and from_keywords_f:
1703 try:
1704 keywords = get_keywords_f(versionfile_abs)
1705 ver = from_keywords_f(keywords, cfg.tag_prefix, verbose)
1706 if verbose:
1707 print("got version from expanded keyword %s" % ver)
1708 return ver
1709 except NotThisMethod:
1710 pass
1711
1712 try:
1713 ver = versions_from_file(versionfile_abs)
1714 if verbose:
1715 print("got version from file %s %s" % (versionfile_abs, ver))
1716 return ver
1717 except NotThisMethod:
1718 pass
1719
1720 from_vcs_f = handlers.get("pieces_from_vcs")
1721 if from_vcs_f:
1722 try:
1723 pieces = from_vcs_f(cfg.tag_prefix, root, verbose)
1724 ver = render(pieces, cfg.style)
1725 if verbose:
1726 print("got version from VCS %s" % ver)
1727 return ver
1728 except NotThisMethod:
1729 pass

Callers 7

get_versionFunction · 0.70
runMethod · 0.70
runMethod · 0.70
runMethod · 0.70
runMethod · 0.70
runMethod · 0.70
runMethod · 0.70

Calls 7

get_rootFunction · 0.85
get_config_from_rootFunction · 0.85
versions_from_fileFunction · 0.85
renderFunction · 0.70
versions_from_parentdirFunction · 0.70
getMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…