At 12:26 AM 6/16/2010 +0200, Denis Jasselette wrote:
I am trying to distribute a
script where I should be able to output the current version number.
I thought that I could do things in an opposite way as in C. Rather than
having the building system to create the config.h, I could import a
config.py in my setup.py and distribute it as a py_module along with the
script.
Do you have better solutions?
Yes. Use setuptools in your setup.py, and declare the version
there. Then, in your script, use:
from pkg_resources import require
my_version = require('MyProjectName')[0].version
Where 'MyProjectName' is whatever 'name=' argument you passed to
setup() in your setup.py.
_______________________________________________
Distutils-SIG maillist - [email protected]
http://mail.python.org/mailman/listinfo/distutils-sig