[Biopython-dev] Python 2.7 failure from test_Tutorial.py, was: Compiling Biopython on 64 bit Windows

Manlio Calvi manlio.calvi at gmail.com
Tue Apr 22 05:51:45 UTC 2014


Hi Peter,
I just run this one from the Tests folder (the tests are there and
don'tget moved in the installation)
I got this:

Running Tutorial doctests...
**********************************************************************
File "Tests/test_Tutorial.py", line 153, in
__main__.TutorialDocTestHolder.doctest_test_from_line_04424
Failed example:
    align_array.shape
Expected:
    (7, 52)
Got:
    (7L, 52L)
**********************************************************************
1 items had failures:
   1 of   7 in __main__.TutorialDocTestHolder.doctest_test_from_line_04424
***Test Failed*** 1 failures.
C:\python27\lib\site-packages\Bio\Motif\__init__.py:26:
BiopythonDeprecationWarning: The module Bio.Motif has been deprecated
and will be removed in a future release of Biopython. Instead please
use the new module Bio.motifs instead. Please be aware that though the
functionality of Bio.Motif is retained (and extended) in Bio.motifs,
usage may be different.
  BiopythonDeprecationWarning)
Traceback (most recent call last):
  File "Tests/test_Tutorial.py", line 185, in <module>
RuntimeError: 1/806 tests failed




Another Python2/3 compatibility problem...



On Mon, Apr 21, 2014 at 6:47 PM, Peter Cock <p.j.a.cock at googlemail.com> wrote:
> Hi Manlio,
>
> Moving on to Python 2.7, apart from the TogoWS issue,
> http://lists.open-bio.org/pipermail/biopython-dev/2014-April/011259.html
> your system showed one other failure:
>
> ======================================================================
> ERROR: test_doctests (test_Tutorial.TutorialTestCase)
> Run tutorial doctests.
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "test_Tutorial.py", line 167, in test_doctests
> ValueError: 1 Tutorial doctests failed: test_from_line_04424
>
> ----------------------------------------------------------------------
>
>
> You should be able to rerun the tutorial tests alone (from memory
> only if Biopython is installed) with just:
>
> c:\python27\python test_Tutorial.py
>
> This is from the following doctest in the Tutorial.tex file,
>
> %This example fails under PyPy 2.0, https://bugs.pypy.org/issue1546
> %doctest examples lib:numpy
> \begin{verbatim}
>>>> import numpy as np
>>>> from Bio import AlignIO
>>>> alignment = AlignIO.read("PF05371_seed.sth", "stockholm")
>>>> align_array = np.array([list(rec) for rec in alignment], np.character)
>>>> align_array.shape
> (7, 52)
> \end{verbatim}
>
> Could you try running that example "by hand" and seeing what
> happens? Note the doctest framework is very very fragile and
> the slightest output difference will break a test.
>
> Thanks,
>
> Peter
>
> On Fri, Apr 18, 2014 at 7:40 PM, Manlio Calvi <manlio.calvi at gmail.com> wrote:
>> And at last of this forward I'm posting the build and tests logs (more a
>> dump than a log)  for those who want peek into it.
>> As you'll see the only consistent error was the TogoWS' XHTML error.
>>
>> Cheers,
>> Manlio
>>
>>
>>
>> On Fri, Apr 18, 2014 at 8:35 PM, Manlio Calvi <manlio.calvi at gmail.com>wrote:
>>
>>>
>>>
>>> ---------- Forwarded message ----------
>>> From: Peter Cock <p.j.a.cock at googlemail.com>
>>> Date: Fri, Apr 18, 2014 at 12:01 PM
>>> Subject: Re: Compiling Biopython on 64 bit Windows, was: Volunteer
>>> buildslave machines?
>>> To: Manlio Calvi <manlio.calvi at gmail.com>
>>> Cc: Tiago Antao <tra at popgen.net>
>>>
>>>  Manlio
>>>
>>> Excellent work - well done :)
>>>
>>> We should add some of this to the "Installing from source on Windows"
>>> section of the installation notes (which we also need to update regarding
>>> newer versions of Python and which compiler works):
>>>
>>>
>>> https://github.com/biopython/biopython/blob/master/Doc/install/Installation.tex
>>>
>>> Step 6 sounds familiar, I think there is a similar batch file to set the
>>> environment variables for the 43bit MSVC compiler.
>>>
>>> Regarding step 7, Python should use separate subdirectoroes under
>>> build/ for each version of Python, so that shouldn't be a needed.
>>> However, if you do use the same folder some of our tests use
>>> hard coded temporary filenames so it is best to only test one version
>>> of Python at a time.
>>>
>>> Regarding step 8, normally on Windows I don't bother with setting the
>>> $PATH environment variable and simply call the explicit version of
>>> Python I am testing, e.g.
>>>
>>> C:\Python27\python.exe setup.py build
>>> C:\Python27\python.exe setup.py test
>>> C:\Python27\python.exe setup.py install
>>>
>>> (This is what the current buildbot instructions do where we
>>> have automated the tests).
>>>
>>> As to what's text - let's try to fix these test failures :)
>>> Can you post the test output please?
>>>
>>> TogoWS is an online service, so from time to time it does have
>>> transient failures (so does the NCBI Entrez API). The fact this
>>> broke under both Python 2.7 and 3.4 suggests this is not a
>>> Python 3 issue.
>>>
>>> I am a little surprised you didn't see this problem with Python 3.4,
>>> but Windows does unicode a little differently so that may be why?
>>> https://github.com/biopython/biopython/issues/305
>>>
>>> How did you install git & clone Biopython? Specifically, what
>>> is it doing about text files (i.e. Unix versus DOS/Windows
>>> new lines). This was something which has caused test
>>> failures in the past - perhaps some new cases have arisen.
>>>
>>> Thanks!
>>>
>>> Peter
>>>
>>>
>>
>> _______________________________________________
>> Biopython-dev mailing list
>> Biopython-dev at lists.open-bio.org
>> http://lists.open-bio.org/mailman/listinfo/biopython-dev
>>



More information about the Biopython-dev mailing list