[Biopython-dev] PEP8 lower case module names?

Peter Cock p.j.a.cock at googlemail.com
Fri Oct 26 12:50:23 UTC 2012


On Fri, Oct 26, 2012 at 1:43 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> Arg - occidentally tabbed to the send button while trying to indent
> sample code...

Has something changed on GoogleMail's keyboard handling?
Either that or I'm having a bad typing day... my apologies for
the two extra emails.

To continue:

Perhaps a blog post & email to the announcement mailing list
soliciting feedback on this proposal is the best way forward,
perhaps with a web-survey form? e.g.

(1) Keep the namespace as 'Bio'

(2) Keep the namespace as 'Bio' on Python 2,
but adopt all lowercase module names on Python 3.

(3) Move to a new all lowercase namespace like 'biopy'
(anything except 'bio'), allowing the current 'Bio' namespace
to continue to be available as well during a transition period.

And the most disruptive option:

(4) Switch to an all lowercase namespace 'bio', which
cannot in general co-exist with the old 'Bio' namespace
(perhaps bumping the version number to 2.0.0?). This
would break legacy scripts, which would need to be
updated, e.g.:

from Bio.SeqRecord import SeqRecord
from Bio import SeqIO

could be replaced by:

try:
    #Biopython 1.x uses Bio.*
    from Bio.SeqRecord import SeqRecord
    from Bio import SeqIO
except ImportError:
    #Try the new lowercase module names,
    from bio.seqrecord import SeqRecord
    from bio import seqio as SeqIO

Users on Windows and most Mac users might find updating
Biopython complicated during this transition due to the
change in case of the folder names. For anyone installing
from source this might require manual removal of the old
folders (I ran into this kind of issue while trying the lower
case naming under Python 3).

Potentially under Linux (and any Mac using a case sensitive
file system) an old Biopython install using Bio/ and the newer
Biopython using bio/ could co-exist... we would have to look
at that.

Regards,

Peter



More information about the Biopython-dev mailing list