[Baypiggies] version in python package distributions, argh

Ryan Matthew Balfanz rbalfanz at gmail.com
Mon Jan 23 07:25:43 CET 2012


I have to look at another project setup.py file everytime I make one, to
remember how to do it. I've found the one for django-celery to be pretty
good: https://github.com/ask/django-celery/blob/master/setup.py.

Hope it helps.

Cheers,
Ryan

On Sun, Jan 22, 2012 at 8:50 PM, Ian Zimmerman <itz at buug.org> wrote:

>
> How do people manage the version number in the setup.py file of your
> distributions?  I have distributions that contain exectuable scripts.  I
> like those scripts to have a -V or --version command line option like
> other well behaved programs.  Unless I do something clever, this leads
> to duplication of the version info in at least 2 places, with
> predictable um, results.
>
> So, I did try something clever:
>
> from distutils.core import setup
> import subprocess
>
> sp = subprocess.Popen(['./hgit', '--version'], stdout=subprocess.PIPE)
> vline = sp.stdout.read()
> sp.wait()
> prog, version = vline.strip().split()
>
> setup (name = 'hgit',
>       version = version,
>
> ...
>
> only to discover that during installation from a source package the
> script file is not necessarily executable, which will crash any
> invocation of setup.py.
>
> What other ways are there to solve this annoying situation?
>
> --
> Ian Zimmerman
> gpg public key: 1024D/C6FF61AD
> fingerprint: 66DC D68F 5C1B 4D71 2EE5  BD03 8A00 786C C6FF 61AD
> Rule 420: All persons more than eight miles high to leave the court.
> _______________________________________________
> Baypiggies mailing list
> Baypiggies at python.org
> To change your subscription options or unsubscribe:
> http://mail.python.org/mailman/listinfo/baypiggies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20120122/92f8c449/attachment.html>


More information about the Baypiggies mailing list