本文整理匯總了Python中version.get_version方法的典型用法代碼示例。如果您正苦於以下問題:Python version.get_version方法的具體用法?Python version.get_version怎麽用?Python version.get_version使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類version
的用法示例。
在下文中一共展示了version.get_version方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: setup_package
# 需要導入模塊: import version [as 別名]
# 或者: from version import get_version [as 別名]
def setup_package():
setup(
name=MAIN_PACKAGE,
version=version.get_version(pep440=True),
url=URL,
description=DESCRIPTION,
author=AUTHOR,
author_email=EMAIL,
include_package_data=True,
keywords=KEYWORDS,
license=LICENSE,
long_description=readme(),
classifiers=CLASSIFIERS,
packages=find_packages('src'),
package_dir={'': 'src'},
install_requires=INSTALL_REQUIRES,
)
示例2: get_version
# 需要導入模塊: import version [as 別名]
# 或者: from version import get_version [as 別名]
def get_version():
"""Figures out package's version; also stores it in a file."""
version = read_git_version()
release_version = read_release_version(not version)
version = version or release_version
if not version:
raise ValueError('Cannot find the version number')
if version != release_version:
write_release_version(version)
return version
示例3: parse_command_line
# 需要導入模塊: import version [as 別名]
# 或者: from version import get_version [as 別名]
def parse_command_line():
parser = argparse.ArgumentParser(
description='Tool for downloading and installing WebDriver binaries. Version: {}'.format(get_version()),
)
parser.add_argument('browser', help='Browser to download the corresponding WebDriver binary. Valid values are: {0}. Optionally specify a version number of the WebDriver binary as follows: \'browser:version\' e.g. \'chrome:2.39\'. If no version number is specified, the latest available version of the WebDriver binary will be downloaded.'.format(', '.join(DOWNLOADERS.keys())), nargs='+')
parser.add_argument('--downloadpath', '-d', action='store', dest='downloadpath', metavar='F', default=None, help='Where to download the webdriver binaries')
parser.add_argument('--linkpath', '-l', action='store', dest='linkpath', metavar='F', default=None, help='Where to link the webdriver binary to. Set to "AUTO" if you need some intelligense to decide where to place the final webdriver binary. If set to "SKIP", no link/copy done.')
parser.add_argument('--os', '-o', action='store', dest='os_name', choices=OS_NAMES, metavar='OSNAME', default=None, help='Overrides os detection with given os name. Values: {0}'.format(', '.join(OS_NAMES)))
parser.add_argument('--bitness', '-b', action='store', dest='bitness', choices=BITNESS, metavar='BITS', default=None, help='Overrides bitness detection with given value. Values: {0}'.format(', '.join(BITNESS)))
parser.add_argument('--version', action='version', version='%(prog)s {}'.format(get_version()))
return parser.parse_args()