Merge "Make pbr only a build-time dependency."
This commit is contained in:
commit
1aa85960fd
@ -36,7 +36,7 @@ from swiftclient import Connection, HTTPException
|
|||||||
from swiftclient.utils import config_true_value
|
from swiftclient.utils import config_true_value
|
||||||
from swiftclient.multithreading import MultiThreadingManager
|
from swiftclient.multithreading import MultiThreadingManager
|
||||||
from swiftclient.exceptions import ClientException
|
from swiftclient.exceptions import ClientException
|
||||||
from swiftclient.version import version_info
|
from swiftclient import __version__ as client_version
|
||||||
|
|
||||||
|
|
||||||
def get_conn(options):
|
def get_conn(options):
|
||||||
@ -1262,7 +1262,7 @@ adding "-V 2" is necessary for this.'''.strip('\n'))
|
|||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
version = version_info.version_string()
|
version = client_version
|
||||||
parser = OptionParser(version='%%prog %s' % version,
|
parser = OptionParser(version='%%prog %s' % version,
|
||||||
usage='''
|
usage='''
|
||||||
usage: %%prog [--version] [--help] [--snet] [--verbose]
|
usage: %%prog [--version] [--help] [--snet] [--verbose]
|
||||||
|
@ -57,9 +57,9 @@ copyright = u'2013 OpenStack, LLC.'
|
|||||||
# |version| and |release|, also used in various other places throughout the
|
# |version| and |release|, also used in various other places throughout the
|
||||||
# built documents.
|
# built documents.
|
||||||
#
|
#
|
||||||
from swiftclient.version import version_info as swiftclient_version
|
import swiftclient.version
|
||||||
release = swiftclient_version.version_string()
|
release = swiftclient.version.version_string
|
||||||
version = swiftclient_version.version_string()
|
version = swiftclient.version.version_string
|
||||||
|
|
||||||
# The language for content autogenerated by Sphinx. Refer to documentation
|
# The language for content autogenerated by Sphinx. Refer to documentation
|
||||||
# for a list of supported languages.
|
# for a list of supported languages.
|
||||||
|
@ -1,2 +1 @@
|
|||||||
pbr>=0.5.21,<1.0
|
|
||||||
simplejson>=2.0.9
|
simplejson>=2.0.9
|
||||||
|
@ -27,6 +27,6 @@ from .client import *
|
|||||||
try:
|
try:
|
||||||
from swiftclient import version
|
from swiftclient import version
|
||||||
|
|
||||||
__version__ = version.version_info.cached_version_string()
|
__version__ = version.version_string
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
|
@ -14,6 +14,17 @@
|
|||||||
# License for the specific language governing permissions and limitations
|
# License for the specific language governing permissions and limitations
|
||||||
# under the License.
|
# under the License.
|
||||||
|
|
||||||
from pbr import version as pbr_version
|
import pkg_resources
|
||||||
|
|
||||||
version_info = pbr_version.VersionInfo('python-swiftclient')
|
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'))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user