On Fri, Jan 9, 2009 at 11:08 PM, ray terrill <[email protected]> wrote: > Is there a way to ask distutils what version of a package is currently > installed? I provided the version number when creating my setup.py, but > when this is deployed over 800+ clients, I'd like to have a way to > interrogate the system to determine which version is installed. >
Unfortunately not by code, or not in an universal way I know of.. Distutils creates an YOUR-PACKAGE-VERSION.egg-info file in your package-includes folder, that contains the information. If you use setuptools though, it might be located in YOUR-PACKAGE-VERSION.egg/EGG-INFO/PKG-INFO Imho, I think the best way to get the version of your packages would be to maintain a __version__ string in your package to be able to query it from the code. That said, it would make sense to include in Distutils an API that would let people browse by the Metadata of the *.egg-info files for installed packages. Regards Tarek > Thanks, > -Ray > > _______________________________________________ > Distutils-SIG maillist - [email protected] > http://mail.python.org/mailman/listinfo/distutils-sig > > -- Tarek Ziadé | Association AfPy | www.afpy.org Blog FR | http://programmation-python.org Blog EN | http://tarekziade.wordpress.com/ _______________________________________________ Distutils-SIG maillist - [email protected] http://mail.python.org/mailman/listinfo/distutils-sig
