mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-03 03:36:44 +00:00
setup: show-tool-versions: emit module and __version__ information even when module name != distribution (package) name, and add TwistedCore, TwistedWeb, and TwistedConch
This commit is contained in:
parent
7cec440a14
commit
0ab6211da4
@ -94,7 +94,10 @@ def print_setuptools_ver():
|
|||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def print_py_pkg_ver(pkgname):
|
def print_py_pkg_ver(pkgname, modulename=None):
|
||||||
|
if modulename is None:
|
||||||
|
modulename = pkgname
|
||||||
|
|
||||||
print
|
print
|
||||||
try:
|
try:
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
@ -110,6 +113,17 @@ def print_py_pkg_ver(pkgname):
|
|||||||
traceback.print_exc(file=sys.stderr)
|
traceback.print_exc(file=sys.stderr)
|
||||||
sys.stderr.flush()
|
sys.stderr.flush()
|
||||||
pass
|
pass
|
||||||
|
try:
|
||||||
|
__import__(modulename)
|
||||||
|
except ImportError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
modobj = sys.modules.get(modulename)
|
||||||
|
print pkgname + ' module: ' + str(modobj)
|
||||||
|
try:
|
||||||
|
print pkgname + ' __version__: ' + str(modobj.__version__)
|
||||||
|
except AttributeError:
|
||||||
|
pass
|
||||||
|
|
||||||
print_platform()
|
print_platform()
|
||||||
|
|
||||||
@ -139,3 +153,7 @@ print_py_pkg_ver('pyflakes')
|
|||||||
print_py_pkg_ver('zope.interface')
|
print_py_pkg_ver('zope.interface')
|
||||||
print_py_pkg_ver('setuptools_darcs')
|
print_py_pkg_ver('setuptools_darcs')
|
||||||
print_py_pkg_ver('darcsver')
|
print_py_pkg_ver('darcsver')
|
||||||
|
print_py_pkg_ver('Twisted', 'twisted')
|
||||||
|
print_py_pkg_ver('TwistedCore', 'twisted.python')
|
||||||
|
print_py_pkg_ver('TwistedWeb', 'twisted.web')
|
||||||
|
print_py_pkg_ver('TwistedConch', 'twisted.conch')
|
||||||
|
Loading…
Reference in New Issue
Block a user