Could we extend the pseudo-format of the versions a little to also
include variants which use more than just one character and also
allow hyphens and spaces to be used for additional clarity ?

VERSION_RE = re.compile(r'''
    ^
    (?P<version>\d+\.\d+)          # minimum 'N.N'
    (?P<extraversion>(?:\.\d+)*)   # any number of extra '.N' segments
    (?:
        [- .]*
        (?P<prerel>[a-z]+)        # 'a'=alpha, 'b'=beta, 'c'=release candidate
        [- .]*
        (?P<prerelversion>\d+(?:\.\d+)*)
    )?
    (?P<postdev>
        ([- .]*post[- .]*(?P<post>\d+))?
        ([- .]*dev[- .]*(?P<dev>\d+))?
    )?
    $''', re.VERBOSE + re.I)

The pre-release marker would then be interpreted in alphabetical
order, ie. 'alpha' < 'beta' < 'rc'.

This minor change would broaden the scope of the scheme somewhat
and make it more compatible to what's being used outside the
python-dev sphere (esp. with respect to 'c' standing for release
candidate... unless you happen to read it as gamma ;-).

The added optional hypens and spaces make the versions more
readable, IMHO.

-- 
Marc-Andre Lemburg
eGenix.com

Professional Python Services directly from the Source  (#1, Nov 25 2009)
>>> Python/Zope Consulting and Support ...        http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ...             http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ...        http://python.egenix.com/
________________________________________________________________________

::: Try our new mxODBC.Connect Python Database Interface for free ! ::::


   eGenix.com Software, Skills and Services GmbH  Pastor-Loeh-Str.48
    D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg
           Registered at Amtsgericht Duesseldorf: HRB 46611
               http://www.egenix.com/company/contact/
_______________________________________________
Distutils-SIG maillist  -  Distutils-SIG@python.org
http://mail.python.org/mailman/listinfo/distutils-sig

Reply via email to