It seems we have some invalid doctests in the C code (which might reveal a bug or two, but are mostly likely harmless oversights). There is some key difference in your build setup and our continuous integration which is not looking at the C code's docstests:
https://github.com/biopython/biopython/issues/2350 Peter Peter On Tue, Nov 19, 2019 at 10:25 PM Andreas Tille <andr...@fam-tille.de> wrote: > > On Tue, Nov 19, 2019 at 10:03:25AM +0000, Peter Cock wrote: > > > > Do you have a list of things still depending on Biopython & Python 2.7 > > handy? We're discussing when exactly to drop Python 2.7 support - > > with a final compatible release in December 2019 or January 2020 > > looking most likely. > > Speaking about droping Python2 and just running tests with Python3 > I was running into other errors: > > ====================================================================== > FAIL: kmedoids (Bio.Cluster._cluster) > Doctest: Bio.Cluster._cluster.kmedoids > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/usr/lib/python3.8/doctest.py", line 2196, in runTest > raise self.failureException(self.format_failure(new.getvalue())) > AssertionError: Failed doctest test for Bio.Cluster._cluster.kmedoids > File > "/build/python-biopython-1.75+dfsg/.pybuild/cpython3_3.8/build/Bio/Cluster/_cluster.cpython-38-x86_64-linux-gnu.so", > line unknown line number, in kmedoids > > ---------------------------------------------------------------------- > File > "/build/python-biopython-1.75+dfsg/.pybuild/cpython3_3.8/build/Bio/Cluster/_cluster.cpython-38-x86_64-linux-gnu.so", > line ?, in Bio.Cluster._cluster.kmedoids > Failed example: > distance = array([[0.0, 1.1, 2.3], > [1.1, 0.0, 4.5], > [2.3, 4.5, 0.0]]) > Exception raised: > Traceback (most recent call last): > File "/usr/lib/python3.8/doctest.py", line 1328, in __run > exec(compile(example.source, filename, "single", > File "<doctest Bio.Cluster._cluster.kmedoids[0]>", line 1, in <module> > distance = array([[0.0, 1.1, 2.3], > NameError: name 'array' is not defined > ---------------------------------------------------------------------- > File > "/build/python-biopython-1.75+dfsg/.pybuild/cpython3_3.8/build/Bio/Cluster/_cluster.cpython-38-x86_64-linux-gnu.so", > line ?, in Bio.Cluster._cluster.kmedoids > Failed example: > distance = array([1.1, 2.3, 4.5]) > Exception raised: > Traceback (most recent call last): > File "/usr/lib/python3.8/doctest.py", line 1328, in __run > exec(compile(example.source, filename, "single", > File "<doctest Bio.Cluster._cluster.kmedoids[1]>", line 1, in <module> > distance = array([1.1, 2.3, 4.5]) > NameError: name 'array' is not defined > ---------------------------------------------------------------------- > File > "/build/python-biopython-1.75+dfsg/.pybuild/cpython3_3.8/build/Bio/Cluster/_cluster.cpython-38-x86_64-linux-gnu.so", > line ?, in Bio.Cluster._cluster.kmedoids > Failed example: > distance = [array([]), > array([1.1]), > array([2.3, 4.5])] > Exception raised: > Traceback (most recent call last): > File "/usr/lib/python3.8/doctest.py", line 1328, in __run > exec(compile(example.source, filename, "single", > File "<doctest Bio.Cluster._cluster.kmedoids[2]>", line 1, in <module> > distance = [array([]), > NameError: name 'array' is not defined > > > ====================================================================== > FAIL: pca (Bio.Cluster._cluster) > Doctest: Bio.Cluster._cluster.pca > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/usr/lib/python3.8/doctest.py", line 2196, in runTest > raise self.failureException(self.format_failure(new.getvalue())) > AssertionError: Failed doctest test for Bio.Cluster._cluster.pca > File > "/build/python-biopython-1.75+dfsg/.pybuild/cpython3_3.8/build/Bio/Cluster/_cluster.cpython-38-x86_64-linux-gnu.so", > line unknown line number, in pca > > ---------------------------------------------------------------------- > File > "/build/python-biopython-1.75+dfsg/.pybuild/cpython3_3.8/build/Bio/Cluster/_cluster.cpython-38-x86_64-linux-gnu.so", > line ?, in Bio.Cluster._cluster.pca > Failed example: > columnmean + dot(coordinates, pc) > Exception raised: > Traceback (most recent call last): > File "/usr/lib/python3.8/doctest.py", line 1328, in __run > exec(compile(example.source, filename, "single", > File "<doctest Bio.Cluster._cluster.pca[0]>", line 1, in <module> > columnmean + dot(coordinates, pc) > NameError: name 'columnmean' is not defined > > > ====================================================================== > FAIL: treecluster (Bio.Cluster._cluster) > Doctest: Bio.Cluster._cluster.treecluster > ---------------------------------------------------------------------- > Traceback (most recent call last): > File "/usr/lib/python3.8/doctest.py", line 2196, in runTest > raise self.failureException(self.format_failure(new.getvalue())) > AssertionError: Failed doctest test for Bio.Cluster._cluster.treecluster > File > "/build/python-biopython-1.75+dfsg/.pybuild/cpython3_3.8/build/Bio/Cluster/_cluster.cpython-38-x86_64-linux-gnu.so", > line unknown line number, in treecluster > > ---------------------------------------------------------------------- > File > "/build/python-biopython-1.75+dfsg/.pybuild/cpython3_3.8/build/Bio/Cluster/_cluster.cpython-38-x86_64-linux-gnu.so", > line ?, in Bio.Cluster._cluster.treecluster > Failed example: > distance = array([[0.0, 1.1, 2.3], > [1.1, 0.0, 4.5], > [2.3, 4.5, 0.0]]) > Exception raised: > Traceback (most recent call last): > File "/usr/lib/python3.8/doctest.py", line 1328, in __run > exec(compile(example.source, filename, "single", > File "<doctest Bio.Cluster._cluster.treecluster[0]>", line 1, in > <module> > distance = array([[0.0, 1.1, 2.3], > NameError: name 'array' is not defined > ---------------------------------------------------------------------- > File > "/build/python-biopython-1.75+dfsg/.pybuild/cpython3_3.8/build/Bio/Cluster/_cluster.cpython-38-x86_64-linux-gnu.so", > line ?, in Bio.Cluster._cluster.treecluster > Failed example: > distance = array([1.1, 2.3, 4.5]) > Exception raised: > Traceback (most recent call last): > File "/usr/lib/python3.8/doctest.py", line 1328, in __run > exec(compile(example.source, filename, "single", > File "<doctest Bio.Cluster._cluster.treecluster[1]>", line 1, in > <module> > distance = array([1.1, 2.3, 4.5]) > NameError: name 'array' is not defined > ---------------------------------------------------------------------- > File > "/build/python-biopython-1.75+dfsg/.pybuild/cpython3_3.8/build/Bio/Cluster/_cluster.cpython-38-x86_64-linux-gnu.so", > line ?, in Bio.Cluster._cluster.treecluster > Failed example: > distance = [array([]), > array([1.1]), > array([2.3, 4.5])] > Exception raised: > Traceback (most recent call last): > File "/usr/lib/python3.8/doctest.py", line 1328, in __run > exec(compile(example.source, filename, "single", > File "<doctest Bio.Cluster._cluster.treecluster[2]>", line 1, in > <module> > distance = [array([]), > NameError: name 'array' is not defined > > > ---------------------------------------------------------------------- > Ran 521 tests in 210.480 seconds > > FAILED (failures = 1) > > > Kind regards > > Andreas. > > -- > http://fam-tille.de