On 04:02 am, p...@telecommunity.com wrote:
At 08:52 AM 4/10/2011 +1000, Ben Finney wrote:
This is an often-overlooked case, I think. The unspoken assumption is
often that ``setup.py`` is a suitable place for the overall version
string, but this is not the case when that string must be read by
non-Python programs.

If you haven't used the distutils a lot, you might not realize that you can do this:

$ python setup.py --version
0.6c12

(The --name option also works, and they can be used together -- the answers will be on two separate lines.)

This only works as long as setup.py is around - which it typically no longer is after installation is complete.

And though it's common and acceptable enough to launch a child process in a shell script in order to get some piece of information, it isn't as pleasant in a Python program. Can you get this version information out of setup.py without running a child process and without monkey-patching sys.argv and sys.stdout?

Jean-Paul
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to