[spambayes-dev] RE: Version Data
tameyer at ihug.co.nz
Thu Dec 23 02:37:36 CET 2004
> As long as we have only one version, I think a lot of this
> could be stored once in the main "spambayes" package
> __init__.py file and eliminate all the duplication.
> distutils has a StrictVersion class which parses a version
> string similar to what we use with versions of the form
> "1.0", "1.0.1", "1.1a1", etc. It also provides a compare
> function for comparing two version numbers, which would be
> great to replace the float version number stuff we're
> currently using for update checks.
I wasn't aware of that class - I agree, it seems like a perfect choice.
> It doesn't support the
> "1.0rc2" release candidate format, but that shouldn't take
> more than a couple of minutes to add.
We could switch to just "c" (which is nice, since it's then 'a', 'b', 'c')
and we'd then match the Python distribution itself. In that case, this
addition might even be worth submitting as a distutils patch. (Although
from a quick look, it's a case of adding a single character ('c') to a
> For consistency, I think it would be good to provide the
> separate components of the version in the format of the
> sys.version_info tuple. This could be incorporated into the
> Version class along with the function to format the long form
> of the version.
That should be simple, too. It's just .version + .prerelease to get (eg)
(1,1,0,'a',1), and then a simple conversion of 'a'->'alpha', etc.
> From what I understand, we're free to put any custom metadata
> we want in the __init__.py file, so we could even include the
> download and release notes URLs there.
There's also the 'check for new version' stuff. I guess that could also
move to __init__.py - I gather that just means that importing any of the
spambayes.* modules will import that as well, right? As long as it doesn't
actually do any work on import, it doesn't seem like that would hurt.
Assuming no-one else pipes up with objections, would you like to make the
changes, or shall I?
More information about the spambayes-dev