當前位置: 首頁>>代碼示例>>Python>>正文


Python versioneer.get_version方法代碼示例

本文整理匯總了Python中versioneer.get_version方法的典型用法代碼示例。如果您正苦於以下問題:Python versioneer.get_version方法的具體用法?Python versioneer.get_version怎麽用?Python versioneer.get_version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在versioneer的用法示例。


在下文中一共展示了versioneer.get_version方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_version

# 需要導入模塊: import versioneer [as 別名]
# 或者: from versioneer import get_version [as 別名]
def get_version():
    """Get the short version string for this project."""
    return get_versions()["version"] 
開發者ID:spencerahill,項目名稱:aospy,代碼行數:5,代碼來源:versioneer.py

示例2: scan_setup_py

# 需要導入模塊: import versioneer [as 別名]
# 或者: from versioneer import get_version [as 別名]
def scan_setup_py():
    """Validate the contents of setup.py against Versioneer's expectations."""
    found = set()
    setters = False
    errors = 0
    with open("setup.py", "r") as f:
        for line in f.readlines():
            if "import versioneer" in line:
                found.add("import")
            if "versioneer.get_cmdclass()" in line:
                found.add("cmdclass")
            if "versioneer.get_version()" in line:
                found.add("get_version")
            if "versioneer.VCS" in line:
                setters = True
            if "versioneer.versionfile_source" in line:
                setters = True
    if len(found) != 3:
        print("")
        print("Your setup.py appears to be missing some important items")
        print("(but I might be wrong). Please make sure it has something")
        print("roughly like the following:")
        print("")
        print(" import versioneer")
        print(" setup( version=versioneer.get_version(),")
        print("        cmdclass=versioneer.get_cmdclass(),  ...)")
        print("")
        errors += 1
    if setters:
        print("You should remove lines like 'versioneer.VCS = ' and")
        print("'versioneer.versionfile_source = ' . This configuration")
        print("now lives in setup.cfg, and should be removed from setup.py")
        print("")
        errors += 1
    return errors 
開發者ID:spencerahill,項目名稱:aospy,代碼行數:37,代碼來源:versioneer.py

示例3: get_version

# 需要導入模塊: import versioneer [as 別名]
# 或者: from versioneer import get_version [as 別名]
def get_version(verbose=False):
    return get_versions(verbose=verbose)["version"] 
開發者ID:matthew-brett,項目名稱:delocate,代碼行數:4,代碼來源:versioneer.py

示例4: run

# 需要導入模塊: import versioneer [as 別名]
# 或者: from versioneer import get_version [as 別名]
def run(self):
        ver = get_version(verbose=True)
        print("Version is currently: %s" % ver) 
開發者ID:matthew-brett,項目名稱:delocate,代碼行數:5,代碼來源:versioneer.py

示例5: get_version

# 需要導入模塊: import versioneer [as 別名]
# 或者: from versioneer import get_version [as 別名]
def get_version():
    return get_versions()["version"] 
開發者ID:menpo,項目名稱:landmarkerio-server,代碼行數:4,代碼來源:versioneer.py

示例6: scan_setup_py

# 需要導入模塊: import versioneer [as 別名]
# 或者: from versioneer import get_version [as 別名]
def scan_setup_py():
    found = set()
    setters = False
    errors = 0
    with open("setup.py", "r") as f:
        for line in f.readlines():
            if "import versioneer" in line:
                found.add("import")
            if "versioneer.get_cmdclass()" in line:
                found.add("cmdclass")
            if "versioneer.get_version()" in line:
                found.add("get_version")
            if "versioneer.VCS" in line:
                setters = True
            if "versioneer.versionfile_source" in line:
                setters = True
    if len(found) != 3:
        print("")
        print("Your setup.py appears to be missing some important items")
        print("(but I might be wrong). Please make sure it has something")
        print("roughly like the following:")
        print("")
        print(" import versioneer")
        print(" setup( version=versioneer.get_version(),")
        print("        cmdclass=versioneer.get_cmdclass(),  ...)")
        print("")
        errors += 1
    if setters:
        print("You should remove lines like 'versioneer.VCS = ' and")
        print("'versioneer.versionfile_source = ' . This configuration")
        print("now lives in setup.cfg, and should be removed from setup.py")
        print("")
        errors += 1
    return errors 
開發者ID:menpo,項目名稱:landmarkerio-server,代碼行數:36,代碼來源:versioneer.py

示例7: get_version

# 需要導入模塊: import versioneer [as 別名]
# 或者: from versioneer import get_version [as 別名]
def get_version():
    path = os.path.join(
        os.path.dirname(os.path.abspath(__file__)), "datasette", "version.py"
    )
    g = {}
    exec(open(path).read(), g)
    return g["__version__"] 
開發者ID:simonw,項目名稱:datasette,代碼行數:9,代碼來源:setup.py


注:本文中的versioneer.get_version方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。