[Biopython-dev] determining the version

Bruce Southey bsouthey at gmail.com
Thu Feb 19 14:44:54 UTC 2009


Peter wrote:
> On Wed, Oct 1, 2008 at 4:29 PM, Peter <biopython at maubp.freeserve.co.uk> wrote:
>   
>> Peter wrote:
>>     
>>> From a quick look at approach taken in the matplotlib
>>> code, we could add something like this to setup.py
>>>
>>> __version__ = "Undefined"
>>> for line in open('Bio/__init__.py'):
>>>     if (line.startswith('__version__')):
>>>         exec(line.strip())
>>>
>>> setup(
>>>    name='biopython',
>>>    version=__version__,
>>>    author='The Biopython Consortium',
>>>    ...
>>>
>>> I'm happy to deal with this if we are agreed that we
>>> should add a __version__ to Bio/__init__.py
>>> (variations on the naming are possible, but this seems
>>> to be a de-facto standard in python libraries).
>>>       
>> Any objections to making this change now?
>>
>> Peter
>>
>>     
>
> Since this thread last year, there have been no objections.  Following
> a recent question on the main mailing list about how to determine the
> version of Biopython this seems worth doing before the next release.
> Again, an objections or comments on the implementation details?
> Otherwise I'll make this change shortly.
>
> Peter
> _______________________________________________
> Biopython-dev mailing list
> Biopython-dev at lists.open-bio.org
> http://lists.open-bio.org/mailman/listinfo/biopython-dev
>   
Hi,
Yes, version information must be included!

I like numpy's approach because the version will display a svn-related 
number when using a developmental version. It is rather clever because 
the real magic occurs with distutils to found the actual svn version 
(see _get_svn_revision function in the distutils/misc_util.py file).

But I do not know if the same tricks would apply to cvs. So the one 
thing I would ask for is that the __version__ gets changed immediately 
after a release so it is clear if you are using an official release or a 
cvs version. I know that will be a little extra burden on the release 
maintainer.

Bruce



More information about the Biopython-dev mailing list