Path: csiph.com!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!144.76.237.92.MISMATCH!3.eu.feeder.erje.net!feeder.erje.net!news.albasani.net!tahina.priv.at!bofh.it!news.nic.it!robomod From: Simon McVittie Newsgroups: linux.debian.bugs.dist,linux.debian.maint.python Subject: Bug#937698: Help needed for issue in test suite for Python3 (Was: Bug#937698: python-dendropy: Python2 removal in sid/bullseye) Date: Tue, 08 Oct 2019 10:10:01 +0200 Message-ID: References: X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Tue Oct 8 08:09:13 2019 Old-Return-Path: X-Spam-Flag: NO X-Spam-Score: -4.2 Reply-To: Simon McVittie , 937698@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: Debian Med Packaging Team X-Debian-Pr-Message: followup 937698 X-Debian-Pr-Package: src:python-dendropy X-Debian-Pr-Keywords: help bullseye sid X-Debian-Pr-Source: python-dendropy X-Spam-Bayes: score:0.0000 Tokens: new, 16; hammy, 150; neutral, 233; spammy, 0. spammytokens: hammytokens:0.000-+--python3, 0.000-+--sk:buildd., 0.000-+--python27, 0.000-+--python2.7, 0.000-+--UD:buildd.debian.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Debian-Message: from BTS X-Mailing-List: archive/latest/1562763 List-ID: List-URL: Approved: robomod@news.nic.it Lines: 80 Organization: linux.* mail to news gateway Sender: robomod@news.nic.it X-Original-Cc: 937698@bugs.debian.org, debian-python@lists.debian.org X-Original-Date: Tue, 8 Oct 2019 09:04:26 +0100 X-Original-Message-ID: <20191008080426.GA24621@espresso.pseudorandom.co.uk> X-Original-References: <20191008072845.2epcjuqifelbi2wg@an3as.eu> <20191008072845.2epcjuqifelbi2wg@an3as.eu> Xref: csiph.com linux.debian.bugs.dist:978360 linux.debian.maint.python:11875 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/test.py", line 229, in run > self.run_tests() setuptools is trying to find the tests declared in setup.py: EXTRA_KWARGS = dict( 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: https://buildd.debian.org/status/fetch.php?pkg=python-dendropy&arch=all&ver=4.4.0-1&stamp=1527005052&raw=0 > 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 setup.py test ... > running build_ext > Traceback (most recent call last): > File "setup.py", line 192, in > **EXTRA_KWARGS > File "/usr/lib/python2.7/dist-packages/setuptools/__init__.py", line 129, in setup > return distutils.core.setup(**attrs) > File "/usr/lib/python2.7/distutils/core.py", line 151, in setup > dist.run_commands() > File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands > self.run_command(cmd) > File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command > cmd_obj.run() > File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 226, in run > self.run_tests() > File "/usr/lib/python2.7/dist-packages/setuptools/command/test.py", line 248, in run_tests > exit=False, > File "/usr/lib/python2.7/unittest/main.py", line 94, in __init__ > self.parseArgs(argv) > File "/usr/lib/python2.7/unittest/main.py", line 149, in parseArgs > self.createTests() > File "/usr/lib/python2.7/unittest/main.py", line 158, in createTests > self.module) > File "/usr/lib/python2.7/unittest/loader.py", line 130, in loadTestsFromNames > suites = [self.loadTestsFromName(name, module) for name in names] > File "/usr/lib/python2.7/unittest/loader.py", 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 setup.py 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 __init__.py 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. smcv