subversion revision number string within an application packaged with distutils?

Discussion in 'Python' started by Jim Tittsler, Dec 8, 2006.

  1. Jim Tittsler

    Jim Tittsler Guest

    Is there a standard recipe for getting the subversion revision number
    into my Python-based application each time I package it up with
    distutils? (Not just the package name, but also a string that I will
    display in my app's "About" dialog.)
    Jim Tittsler, Dec 8, 2006
    #1
    1. Advertising

  2. Re: subversion revision number string within an applicationpackaged with distutils?

    At Thursday 7/12/2006 22:49, Jim Tittsler wrote:

    >Is there a standard recipe for getting the subversion revision number
    >into my Python-based application each time I package it up with
    >distutils? (Not just the package name, but also a string that I will
    >display in my app's "About" dialog.)


    Under CVS, you use keywords like $Id$, $Author$, $Revision$ etc
    inside your code, they get expanded like this:

    __version__ = '$Revision: 1.8 $'[11:-2]

    Subversion uses a similar mechanism but I'm not sure of the spelling.


    --
    Gabriel Genellina
    Softlab SRL

    __________________________________________________
    Correo Yahoo!
    Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
    ¡Abrí tu cuenta ya! - http://correo.yahoo.com.ar
    Gabriel Genellina, Dec 8, 2006
    #2
    1. Advertising

  3. Re: subversion revision number string within an application packagedwith distutils?

    Jim Tittsler schrieb:
    > Is there a standard recipe for getting the subversion revision number
    > into my Python-based application each time I package it up with
    > distutils? (Not just the package name, but also a string that I will
    > display in my app's "About" dialog.)


    You can't really use subversion's keyword substitution for that
    (contrary to what Gabriel Genellina suggested): a $Revision$
    field will only be updated to the revision in which the file
    containing it changed. If you want the repository version at
    the time of the packaging, you can use the svnversion tool.
    On Windows, you can alternatively also use the subwcrev.exe
    tool that comes with Tortoise.

    If you don't want to invoke an external tool, you could also
    retrieve the same information with the subversion Python
    bindings.

    Regards,
    Martin
    =?ISO-8859-1?Q?=22Martin_v=2E_L=F6wis=22?=, Dec 8, 2006
    #3
  4. Re: subversion revision number string within an application packagedwith distutils?

    Jim Tittsler wrote:
    > Is there a standard recipe for getting the subversion revision number
    > into my Python-based application each time I package it up with
    > distutils? (Not just the package name, but also a string that I will
    > display in my app's "About" dialog.)


    Here's how we do it in lxml:

    https://codespeak.net/svn/lxml/trunk/versioninfo.py

    Stefan
    Stefan Behnel, Dec 14, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pietro
    Replies:
    4
    Views:
    561
    Pietro
    Apr 13, 2005
  2. Pankaj Jain
    Replies:
    1
    Views:
    323
    Daniel Fisher\(lennybacon\)
    Nov 30, 2005
  3. JJ
    Replies:
    0
    Views:
    777
  4. Replies:
    5
    Views:
    709
    John B. Matthews
    Apr 30, 2010
  5. Replies:
    0
    Views:
    351
Loading...

Share This Page