Opened 10 years ago
Last modified 10 years ago
#11632 closed defect
get_pkginfo() doesn't work for MySQLdb and trac.core — at Initial Version
Reported by: | Jun Omae | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.2 |
Component: | general | Version: | |
Severity: | normal | Keywords: | setuptools |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
trac.util.get_pkginfo()
function retrieves PKG-INFO
for the specified module. The function usually is used to provide System Information and Installed Plugins.
However, if the module is non-toplevel module or isn't matched with package name, it doesn't work as expected.
>>> from trac.util import get_pkginfo >>> import trac, trac.core, MySQLdb, psycopg2 >>> for mod in (trac, trac.core, MySQLdb, psycopg2): ... mod.__name__, get_pkginfo(mod).get('version', '???') ... ('trac', '1.0.1') ('trac.core', '???') ('MySQLdb', '???') ('psycopg2', '2.0.14')
trac.core
and MySQLdb
are specified in tags/trac-1.0.1/trac/env.py@:643#L625 and tags/trac-1.0.1/trac/db/mysql_backend.py@:94#L90.
We could check that file path is included in SOURCE.txt
of the metadata to fix it.