How to use the pbr.version.VersionInfo function in pbr

To help you get started, we’ve selected a few pbr examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github openstack / python-ironicclient / ironicclient / __init__.py View on Github external
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import pbr.version

from ironicclient import client
from ironicclient import exc as exceptions


__version__ = pbr.version.VersionInfo('python-ironicclient').version_string()

__all__ = (
    'client',
    'exc',
    'exceptions',
)
github openstack / networking-bgpvpn / networking_bgpvpn / __init__.py View on Github external
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.

import pbr.version


__version__ = pbr.version.VersionInfo(
    'networking_bgpvpn').version_string()
github openstack / vitrage-dashboard / vitrage_dashboard / alarms / version.py View on Github external
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import pbr.version

version_info = pbr.version.VersionInfo('vitrage_alarms_ui')
github openstack / designate / designate / version.py View on Github external
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
import pbr.version


version_info = pbr.version.VersionInfo('designate')
version_string = version_info.version_string
github openstack / shade / shade / __init__.py View on Github external
import logging
import warnings

import keystoneauth1.exceptions
import os_client_config
import pbr.version
import requestsexceptions

# The star import is for backwards compat reasons
from shade.exc import *  # noqa
from shade import exc
from shade.openstackcloud import OpenStackCloud
from shade.operatorcloud import OperatorCloud
from shade import _log

__version__ = pbr.version.VersionInfo('shade').version_string()

if requestsexceptions.SubjectAltNameWarning:
    warnings.filterwarnings(
        'ignore', category=requestsexceptions.SubjectAltNameWarning)


def _get_openstack_config(app_name=None, app_version=None):
    # Protect against older versions of os-client-config that don't expose this
    try:
        return os_client_config.OpenStackConfig(
            app_name=app_name, app_version=app_version)
    except Exception:
        return os_client_config.OpenStackConfig()


def simple_logging(debug=False, http_debug=False):
github ryfeus / lambda-packs / Lxml_requests / source / mock / mock.py View on Github external
from functools import partial
import inspect
import pprint
import sys
try:
    import builtins
except ImportError:
    import __builtin__ as builtins
from types import ModuleType

import six
from six import wraps
from pbr.version import VersionInfo

_v = VersionInfo('mock').semantic_version()
__version__ = _v.release_string()
version_info = _v.version_tuple()

import mock

try:
    inspectsignature = inspect.signature
except AttributeError:
    import funcsigs
    inspectsignature = funcsigs.signature


# TODO: use six.
try:
    unicode
except NameError:
github openstack / openstack-ansible-pip_install / doc / source / conf.py View on Github external
project = 'OpenStack-Ansible'
role_name = 'pip_install'
target_name = 'openstack-ansible-' + role_name
title = 'OpenStack-Ansible Documentation: ' + role_name + 'role'

# The link to the browsable source code (for the left hand menu)
oslosphinx_cgit_link = (
    'https://git.openstack.org/cgit/openstack/{}'.format(target_name)
)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version_info = pbr.version.VersionInfo(target_name)
# The full version, including alpha/beta/rc tags.
release = version_info.version_string_with_vcs()
# The short X.Y version.
version = version_info.canonical_version_string()

# openstackdocstheme options
repository_name = 'openstack/' + target_name
bug_project = project.lower()
bug_tag = ''

# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
github sphinx-contrib / apidoc / sphinxcontrib / apidoc / __init__.py View on Github external
"""
    sphinxcontrib.apidoc
    ~~~~~~~~~~~~~~~~~~~~

    A Sphinx extension for running 'sphinx-apidoc' on each build.

    :copyright: Copyright 2018 by Stephen Finucane 
    :license: BSD, see LICENSE for details.
"""

import pbr.version

from sphinxcontrib.apidoc import ext

__version__ = pbr.version.VersionInfo('sphinxcontrib-apidoc').version_string()

if False:
    # For type annotation
    from typing import Any, Dict  # noqa
    from sphinx.application import Sphinx  # noqa


def setup(app):
    # type: (Sphinx) -> Dict[unicode, Any]
    app.setup_extension('sphinx.ext.autodoc')  # We need autodoc to function

    app.connect('builder-inited', ext.builder_inited)
    app.add_config_value('apidoc_module_dir', None, 'env', [str])
    app.add_config_value('apidoc_output_dir', 'api', 'env', [str])
    app.add_config_value('apidoc_excluded_paths', [], 'env', [[str]])
    app.add_config_value('apidoc_separate_modules', False, 'env', [bool])
github ansible / awx / awx / lib / site-packages / swiftclient / version.py View on Github external
#    under the License.

import pkg_resources

try:
    # First, try to get our version out of PKG-INFO. If we're installed,
    # this'll let us find our version without pulling in pbr. After all, if
    # we're installed on a system, we're not in a Git-managed source tree, so
    # pbr doesn't really buy us anything.
    version_string = pkg_resources.get_provider(
        pkg_resources.Requirement.parse('python-swiftclient')).version
except pkg_resources.DistributionNotFound:
    # No PKG-INFO? We're probably running from a checkout, then. Let pbr do
    # its thing to figure out a version number.
    import pbr.version
    version_string = str(pbr.version.VersionInfo('python-swiftclient'))
github openstack / vitrage-dashboard / vitrage_dashboard / templates / version.py View on Github external
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
#    not use this file except in compliance with the License. You may obtain
#    a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
#    License for the specific language governing permissions and limitations
#    under the License.

import pbr.version

version_info = pbr.version.VersionInfo('vitrage_templates_ui')