当前位置: 首页>>代码示例>>Python>>正文


Python version.VersionInfo方法代码示例

本文整理汇总了Python中pbr.version.VersionInfo方法的典型用法代码示例。如果您正苦于以下问题:Python version.VersionInfo方法的具体用法?Python version.VersionInfo怎么用?Python version.VersionInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pbr.version的用法示例。


在下文中一共展示了version.VersionInfo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_setup_file

# 需要导入模块: from pbr import version [as 别名]
# 或者: from pbr.version import VersionInfo [as 别名]
def create_setup_file():
    lib_version = VersionInfo("spotify_tensorflow").version_string()
    contents_for_setup_file = """
    import setuptools
    
    if __name__ == "__main__":
        setuptools.setup(
            name="spotify_tensorflow_dataflow",
            packages=setuptools.find_packages(),
            install_requires=[
                "spotify-tensorflow=={version}"
        ])
    """.format(version=lib_version)  # noqa: W293
    setup_file_path = os.path.join(tempfile.mkdtemp(), "setup.py")
    with open(setup_file_path, "w") as f:
        f.writelines(textwrap.dedent(contents_for_setup_file))
    return setup_file_path 
开发者ID:spotify,项目名称:spotify-tensorflow,代码行数:19,代码来源:utils.py

示例2: run

# 需要导入模块: from pbr import version [as 别名]
# 或者: from pbr.version import VersionInfo [as 别名]
def run(self):
        log.info("[pbr] Extracting rpm version")
        name = self.distribution.get_name()
        print(version.VersionInfo(name).semantic_version().rpm_string()) 
开发者ID:abhisuri97,项目名称:auto-alt-text-lambda-api,代码行数:6,代码来源:packaging.py

示例3: print_version

# 需要导入模块: from pbr import version [as 别名]
# 或者: from pbr.version import VersionInfo [as 别名]
def print_version():
    """Print version number and exit."""
    from pbr.version import VersionInfo
    version = VersionInfo('faucet').semantic_version().release_string()
    message = 'Faucet %s' % version
    print(message) 
开发者ID:faucetsdn,项目名称:faucet,代码行数:8,代码来源:__main__.py

示例4: __init__

# 需要导入模块: from pbr import version [as 别名]
# 或者: from pbr.version import VersionInfo [as 别名]
def __init__(self, reg=None):
        if reg is not None:
            self._reg = reg
        self.version = VersionInfo('faucet').semantic_version().release_string()
        self.faucet_version = PromGauge( # pylint: disable=unexpected-keyword-arg
            'faucet_pbr_version',
            'Faucet PBR version',
            ['version'],
            registry=self._reg)
        self.faucet_version.labels(version=self.version).set(1)  # pylint: disable=no-member
        self.server = None
        self.thread = None 
开发者ID:faucetsdn,项目名称:faucet,代码行数:14,代码来源:prom_client.py

示例5: inject_common_paths

# 需要导入模块: from pbr import version [as 别名]
# 或者: from pbr.version import VersionInfo [as 别名]
def inject_common_paths():
    """Discover the path to the common/ directory provided by infrared core."""
    def override_conf_path(common_path, envvar, specific_dir):
        conf_path = os.environ.get(envvar, '')
        additional_conf_path = os.path.join(common_path, specific_dir)
        if conf_path:
            full_conf_path = ':'.join([additional_conf_path, conf_path])
        else:
            full_conf_path = additional_conf_path
        os.environ[envvar] = full_conf_path

    version_info = version.VersionInfo('infrared')

    common_path = pkg.resource_filename(version_info.package,
                                        'common')
    override_conf_path(common_path, 'ANSIBLE_ROLES_PATH', 'roles')
    override_conf_path(common_path, 'ANSIBLE_FILTER_PLUGINS', 'filter_plugins')
    override_conf_path(common_path, 'ANSIBLE_CALLBACK_PLUGINS',
                       'callback_plugins')
    override_conf_path(common_path, 'ANSIBLE_LIBRARY', 'library')


# This needs to be called here because as soon as an ansible class is loaded
# the code in constants.py is triggered. That code reads the configuration
# settings from all sources (ansible.cfg, environment variables, etc).
# If the first include to ansible modules is moved deeper in the InfraRed
# code (or on demand), then this call can be moved as well in that place. 
开发者ID:redhat-openstack,项目名称:infrared,代码行数:29,代码来源:main.py


注:本文中的pbr.version.VersionInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。