tahoe-lafs/src/allmydata/__init__.py
Zooko O'Whielacronx fc271a0ee9 setup: don't catch ImportError when importing _auto_deps in allmydata/__init__.py
Nowadays pkg_resources is a runtime requirement, and if there is something screwed up in the installation, we want an explicit ImportError exception as early as possible.
2008-04-30 13:22:04 -07:00

57 lines
1.6 KiB
Python

"""
Decentralized storage grid.
maintainer web site: U{http://allmydata.com/}
community web site: U{http://allmydata.org/}
"""
__version__ = "unknown"
try:
from _version import __version__
except ImportError:
# We're running in a tree that hasn't run "./setup.py darcsver", and didn't
# come with a _version.py, so we don't know what our version is. This should
# not happen very often.
pass
hush_pyflakes = __version__
del hush_pyflakes
import _auto_deps
_auto_deps.require_auto_deps()
def get_package_versions():
import OpenSSL, allmydata, foolscap, nevow, pycryptopp, simplejson, twisted, zfec
setuptools_version = "unavailable"
try:
import setuptools
setuptools_version = setuptools.__version__
except ImportError:
pass
return {
'pyopenssl': OpenSSL.__version__,
'allmydata': allmydata.__version__,
'foolscap': foolscap.__version__,
'nevow': nevow.__version__,
'pycryptopp': pycryptopp.__version__,
'setuptools': setuptools_version,
'simplejson': simplejson.__version__,
'twisted': twisted.__version__,
'zfec': zfec.__version__,
}
def get_package_versions_string():
versions = get_package_versions()
res = []
for p in ["allmydata", "foolscap", "pycryptopp", "zfec", "twisted", "nevow"]:
if versions.has_key(p):
res.append(str(p) + ": " + str(versions[p]))
del versions[p]
else:
res.append(str(p) + ": UNKNOWN")
for p, v in versions.iteritems():
res.append(str(p) + ": " + str(v))
return ', '.join(res)