From ec2e0303b352f4af6a02a23774e4e3a24b58599a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Wed, 9 Oct 2013 12:38:40 +0100 Subject: [PATCH] remove runtime requirement on pbr --- swift/__init__.py | 18 ++---------------- 1 files changed, 2 insertions(+), 16 deletions(-) diff --git a/swift/__init__.py b/swift/__init__.py index 3a543b5..f3e324c 100644 --- a/swift/__init__.py +++ b/swift/__init__.py @@ -41,22 +41,8 @@ paste.__path__.insert(0, paste.__path__.pop(-1)) import os import gettext -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__ = __canonical_version__ = pkg_resources.get_provider( - pkg_resources.Requirement.parse('swift')).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_info = pbr.version.VersionInfo('swift') - __version__ = _version_info.release_string() - __canonical_version__ = _version_info.version_string() +__version__ = "%RPMVERSION%-%RPMRELEASE%" +__canonical_version__ = "%RPMVERSION%" _localedir = os.environ.get('SWIFT_LOCALEDIR') _t = gettext.translation('swift', localedir=_localedir, fallback=True)