[Biopython-dev] Deprecating Bio.ParserSupport, Bio.Blast.NCBIStandalone

Peter Cock p.j.a.cock at googlemail.com
Wed Jan 30 11:42:21 UTC 2013


On Wed, Jan 30, 2013 at 10:20 AM, Michiel de Hoon <mjldehoon at yahoo.com> wrote:
> Hi Peter,
>
> --- On Wed, 1/30/13, Peter Cock <p.j.a.cock at googlemail.com> wrote:
>> Those relative paths won't work if trying to run the
>> doctests via the __name__ trick, thus the path magic which
>> seemed sensible to put in one place only.
>
> In which case won't they work? I tried this on SeqRecord.py,
> and as far as I can tell, the relative paths work fine also when
> running the doctests from the __name__=="__main__" block,
> both on Unix and Windows.

Yes, no path magic works IF you are in the Tests folder, e.g.

~/biopython/Tests $ emacs ../Bio/SeqRecord.py
~/biopython/Tests $ python ../Bio/SeqRecord.py

However for anything like the following convenient alternatives
to work and run the doctests, you need some path magic:

~/biopython $ emacs Bio/SeqRecord.py
~/biopython $ python Bio/SeqRecord.py

Or,

~/biopython/Bio $ emacs SeqRecord.py
~/biopython/Bio $ python SeqRecord.py

I felt having a central convenience function to make that work
was worthwhile in order to make working on doctests easier
without code duplication. I would accept that this alone does
not justify a whole module or file like Bio/_utils.py

If you feel strongly about this, we can remove the function
run_doctest from Bio/_utils.py (it does after all serve no
real purpose in the installed library code), and just require
the current directory be the test folder.

Would you like me to make that change?

Regards,

Peter



More information about the Biopython-dev mailing list