Re: Help needed for issue in test suite for Python3 (Was: Bug#937698: python-dendropy: Python2 removal in sid/bullseye)

2019-10-08 Thread Simon McVittie
tl;dr: The issue in the test suite is that there is no test suite.

On Tue, 08 Oct 2019 at 09:28:45 +0200, Andreas Tille wrote:
>   File "/usr/lib/python3/dist-packages/setuptools/command/", line 229, 
> in run
> self.run_tests()

setuptools is trying to find the tests declared in

install_requires = ['setuptools'],
include_package_data = True,
test_suite = "tests",<-- here
zip_safe = True,

According to ,
setting test_suite like this means: you can import the 'tests' module and
the result is a package or module containing unittest.TestCase subclasses.

However, the tests/ directory (as of python-dendropy_4.4.0-1) does not
contain any Python code at all, only some test data in tests/data/,
so this assertion doesn't seem to be true.

If you look at the buildd logs you'll see that dh_auto_test fails in
Python 2 as well, but the failure is ignored:
> LC_ALL=en_US.utf-8 dh_auto_test || true
> perl: warning: Setting locale failed.
> perl: warning: Please check that your locale settings:
>   LANGUAGE = (unset),
>   LC_ALL = "en_US.utf-8",
>   LANG = (unset)
> are supported and installed on your system.
> perl: warning: Falling back to the standard locale ("C").
> I: pybuild base:217: python2.7 test 
> running build_ext
> Traceback (most recent call last):
>   File "", line 192, in 
>   File "/usr/lib/python2.7/dist-packages/setuptools/", line 129, 
> in setup
> return distutils.core.setup(**attrs)
>   File "/usr/lib/python2.7/distutils/", line 151, in setup
> dist.run_commands()
>   File "/usr/lib/python2.7/distutils/", line 953, in run_commands
> self.run_command(cmd)
>   File "/usr/lib/python2.7/distutils/", line 972, in run_command
>   File "/usr/lib/python2.7/dist-packages/setuptools/command/", line 
> 226, in run
> self.run_tests()
>   File "/usr/lib/python2.7/dist-packages/setuptools/command/", line 
> 248, in run_tests
> exit=False,
>   File "/usr/lib/python2.7/unittest/", line 94, in __init__
> self.parseArgs(argv)
>   File "/usr/lib/python2.7/unittest/", line 149, in parseArgs
> self.createTests()
>   File "/usr/lib/python2.7/unittest/", line 158, in createTests
> self.module)
>   File "/usr/lib/python2.7/unittest/", line 130, in 
> loadTestsFromNames
> suites = [self.loadTestsFromName(name, module) for name in names]
>   File "/usr/lib/python2.7/unittest/", line 91, in loadTestsFromName
> module = __import__('.'.join(parts_copy))
> ImportError: No module named tests
> E: pybuild pybuild:336: test: plugin distutils failed with: exit code=1: 
> python2.7 test
> dh_auto_test: pybuild --test -i python{version} -p 2.7 returned exit code 13
> # need to add true since for Python 3.4 5 tests are failing due some
> # strange encoding problem.  upstream is unable to verify this and
> # there is no better idea for the moment

The failure mode is different in Python 3 because in Python 2, a directory
that does not contain cannot be imported as a package (hence
"No module named tests"), but in Python 3, it can. From the backtrace
you gave, presumably the resulting module object has
tests.__file__ == None, which breaks assumptions made by setuptools.

I would suggest removing the test_suite parameter for now, and asking
your upstream to include the test suite in future source code releases.


Re: Help needed for issue in test suite for Python3 (Was: Bug#937698: python-dendropy: Python2 removal in sid/bullseye)

2019-10-08 Thread Michael Kesper
Hi Andreas,

On 08.10.19 09:28, Andreas Tille wrote:
> Control: tags -1 help
> Hi,
> I have prepared a fix for this package in Git[1].  Unfortunately I'm
> stumbling upon a test suite error which was discussed with upstream
> previously.  It happens only for Python3 and was ignored before but
> this strategy seems to be inappropriate now after droping Python2.

Have a look at the upstream Git repo.
Some tests may be fixed there, e.g.

Best wishes

Description: OpenPGP digital signature