Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #11873 > unrolled thread

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

Started byAndreas Tille <andreas@an3as.eu>
First post2019-10-08 09:40 +0200
Last post2019-10-08 10:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.debian.maint.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Bug#937698: Help needed for issue in test suite for Python3 (Was: Bug#937698: python-dendropy: Python2 removal in sid/bullseye) Andreas Tille <andreas@an3as.eu> - 2019-10-08 09:40 +0200
    Re: Help needed for issue in test suite for Python3 (Was: Bug#937698:  python-dendropy: Python2 removal in sid/bullseye) Michael Kesper <mkesper@schokokeks.org> - 2019-10-08 09:50 +0200
    Bug#937698: Help needed for issue in test suite for Python3 (Was: Bug#937698: python-dendropy: Python2 removal in sid/bullseye) Simon McVittie <smcv@debian.org> - 2019-10-08 10:10 +0200

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

FromAndreas Tille <andreas@an3as.eu>
Date2019-10-08 09:40 +0200
SubjectBug#937698: Help needed for issue in test suite for Python3 (Was: Bug#937698: python-dendropy: Python2 removal in sid/bullseye)
Message-ID<yOS6u-6k1-3@gated-at.bofh.it>
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.
You can simply reproduce the issue even in the unpackaged source:

$ python3 setup.py test
-setup.py: DendroPy version 4.4.0
-setup.py: using setuptools ('/usr/lib/python3/dist-packages/setuptools/__init__.py')
-setup.py: searching for packages
-setup.py: packages identified:
           - dendropy                
           - dendropy.legacy         
           - dendropy.utility        
           - dendropy.mathlib        
           - dendropy.dataio         
           - dendropy.interop        
           - dendropy.datamodel      
           - dendropy.model          
           - dendropy.calculate      
           - dendropy.simulate       
           - dendropy.utility.libexec
-setup.py: scripts identified:
           - applications/sumtrees/sumtrees.py  
           - applications/sumlabels/sumlabels.py
-setup.py: setuptools command extensions are available
running test
running egg_info
writing src/DendroPy.egg-info/PKG-INFO
writing dependency_links to src/DendroPy.egg-info/dependency_links.txt
writing entry points to src/DendroPy.egg-info/entry_points.txt
writing requirements to src/DendroPy.egg-info/requires.txt
writing top-level names to src/DendroPy.egg-info/top_level.txt
reading manifest template 'MANIFEST.in'
warning: no files found matching 'doc/Makefile'
warning: no files found matching '*' under directory 'doc/source'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '.gitignore' found anywhere in distribution
warning: no previously-included files matching '.gitattributes' found anywhere in distribution
warning: no previously-included files matching '.idea' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
writing manifest file 'src/DendroPy.egg-info/SOURCES.txt'
running build_ext
Traceback (most recent call last):
  File "setup.py", line 192, in <module>
    **EXTRA_KWARGS
  File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/usr/lib/python3/dist-packages/setuptools/command/test.py", line 229, in run
    self.run_tests()
  File "/usr/lib/python3/dist-packages/setuptools/command/test.py", line 251, in run_tests
    exit=False,
  File "/usr/lib/python3.7/unittest/main.py", line 100, in __init__
    self.parseArgs(argv)
  File "/usr/lib/python3.7/unittest/main.py", line 147, in parseArgs
    self.createTests()
  File "/usr/lib/python3.7/unittest/main.py", line 159, in createTests
    self.module)
  File "/usr/lib/python3.7/unittest/loader.py", line 220, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python3.7/unittest/loader.py", line 220, in <listcomp>
    suites = [self.loadTestsFromName(name, module) for name in names]
  File "/usr/lib/python3.7/unittest/loader.py", line 191, in loadTestsFromName
    return self.loadTestsFromModule(obj)
  File "/usr/lib/python3/dist-packages/setuptools/command/test.py", line 47, in loadTestsFromModule
    for file in resource_listdir(module.__name__, ''):
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1162, in resource_listdir
    return get_provider(package_or_requirement).resource_listdir(
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 364, in get_provider
    return _find_adapter(_provider_factories, loader)(module)
  File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 1392, in __init__
    self.module_path = os.path.dirname(getattr(module, '__file__', ''))
  File "/usr/lib/python3.7/posixpath.py", line 156, in dirname
    p = os.fspath(p)
TypeError: expected str, bytes or os.PathLike object, not NoneType


Any hint would be welcome.

Kind regards

      Andreas.


[1] https://salsa.debian.org/med-team/python-dendropy

-- 
http://fam-tille.de

[toc] | [next] | [standalone]


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

FromMichael Kesper <mkesper@schokokeks.org>
Date2019-10-08 09:50 +0200
SubjectRe: Help needed for issue in test suite for Python3 (Was: Bug#937698: python-dendropy: Python2 removal in sid/bullseye)
Message-ID<yOSpP-6rz-1@gated-at.bofh.it>
In reply to#11873

[Multipart message — attachments visible in raw view] — view raw

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.
https://github.com/jeetsukumaran/DendroPy/commit/732860830dd3540e43a9465f30df2448c3063d15#diff-76312737381b7c7b05611640b5c3992f

Best wishes
Michael

[toc] | [prev] | [next] | [standalone]


#11875

FromSimon McVittie <smcv@debian.org>
Date2019-10-08 10:10 +0200
Message-ID<yOSJb-6O9-5@gated-at.bofh.it>
In reply to#11873
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 <https://setuptools.readthedocs.io/en/latest/setuptools.html>,
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 <module>
>     **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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.maint.python


csiph-web