30 Jan
2010
30 Jan
'10
4:08 p.m.
On Jan 29, 2010, at 11:03 PM, Tarek Ziadé wrote:
Yes, that's how Jinja does already for example, using Setuptools's pkg_resources :
__version__ = __import__('pkg_resources').get_distribution('Jinja2').version
And that's different yet again from what PJE suggests. This is screaming for a blessed API to be pushed into the stdlib. (BTW, why use __import__() there?)
see http://dev.pocoo.org/projects/jinja/browser/jinja2/__init__.py
Notice that this pkg_resources browsing feature would be in Distutils once PEP 376 is accepted, so until then, I could probably backport in Distribute the setup.cfg feature.
That would be cool. -Barry