Issue #277 resolved

Distribute 0.6.26: Regressions in test suite

Arfrever Frehtes Taifersar Arahesis
created an issue

Distribute 0.6.25 passes all tests with CPython 3 (3.1, 3.2, 3.3) and fails only 1 test with Jython 2.5.

Distribute 0.6.26 fails some tests with CPython 3 (3.1, 3.2, 3.3) and fails test suite completely with Jython 2.5.

(Distribute 0.6.25 and 0.6.26 pass all tests with CPython 2 (2.5, 2.6, 2.7.)

I'm attaching output of python3.2 setup.py test and jython2.5 setup.py test.

Comments (11)

  1. Jason R. Coombs

    Reading the log for Python 3.2, I see two issues:

    ERROR: test_setup_requires_honors_fetch_params (setuptools.tests.test_easy_install.TestSetupRequires)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "build/src/setuptools/tests/test_easy_install.py", line 304, in test_setup_requires_honors_fetch_params
        self.create_sdist(install)
      File "build/src/setuptools/tests/test_easy_install.py", line 332, in create_sdist
        tempdir_context(build_sdist)
      File "build/src/setuptools/tests/test_easy_install.py", line 342, in tempdir_context
        f(temp_dir)
      File "build/src/setuptools/tests/test_easy_install.py", line 324, in build_sdist
        setup_py.size = len(setup_py_bytes.buf)
    AttributeError: '_io.StringIO' object has no attribute 'buf'
    

    I've fixed that issue in 682d6bdfeec5.

    Then, there are a whole bunch of doctest failures like:

    {{{ File "build/src/tests/api_tests.txt", line 24, in api_tests.txt Failed example: dist Expected: Bar 0.9 (http://example.com/something) Got: <NUL><NUL><NUL>...<NUL>Bar 0.9 (http://example.com/something)

    I couldn't even see the errors until I tried to paste one in to firefox and it balked after "Got:". It appears the number of nulls accumulates (the number for each test seems to be monotonically increasing).

    Any idea where these failures come from? I don't get them when I test.

  2. Jason R. Coombs

    The Jython tests are simply failing to run. Here's the traceback:

    running test
    running egg_info
    writing distribute.egg-info/PKG-INFO
    writing entry points to distribute.egg-info/entry_points.txt
    writing top-level names to distribute.egg-info/top_level.txt
    writing dependency_links to distribute.egg-info/dependency_links.txt
    reading manifest file 'distribute.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching 'Makefile' under directory 'docs'
    warning: no files found matching 'indexsidebar.html' under directory 'docs'
    writing manifest file 'distribute.egg-info/SOURCES.txt'
    running build_ext
    Traceback (most recent call last):
      File "setup.py", line 156, in <module>
        for cmd in SETUP_COMMANDS
      File "/usr/share/jython-2.5/Lib/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/share/jython-2.5/Lib/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/share/jython-2.5/Lib/distutils/dist.py", line 974, in run_commands
        self.run_command(cmd)
      File "/usr/share/jython-2.5/Lib/distutils/dist.py", line 994, in run_command
        cmd_obj.run()
      File "setup.py", line 94, in run
        _test.run(self)
      File "/tmp/distribute-0.6.26/setuptools/command/test.py", line 137, in run
        self.with_project_on_sys_path(self.run_tests)
      File "/tmp/distribute-0.6.26/setuptools/command/test.py", line 117, in with_project_on_sys_path
        func()
      File "/tmp/distribute-0.6.26/setuptools/command/test.py", line 144, in run_tests
        unittest.main(
      File "/usr/share/jython-2.5/Lib/unittest.py", line 767, in __init__
        self.parseArgs(argv)
      File "/usr/share/jython-2.5/Lib/unittest.py", line 794, in parseArgs
        self.createTests()
      File "/usr/share/jython-2.5/Lib/unittest.py", line 794, in parseArgs
        self.createTests()
      File "/usr/share/jython-2.5/Lib/unittest.py", line 799, in createTests
        self.test = self.testLoader.loadTestsFromNames(self.testNames,
      File "/usr/share/jython-2.5/Lib/unittest.py", line 565, in loadTestsFromNames
        suites = [self.loadTestsFromName(name, module) for name in names]
      File "/usr/share/jython-2.5/Lib/unittest.py", line 541, in loadTestsFromName
        parent, obj = obj, getattr(obj, part)
    AttributeError: 'module' object has no attribute 'tests'
    

    My guess is there's something new in the test suite that Jython is not happy to import, and the true error is masked. Any tips would be appreciated.

  3. Jason R. Coombs

    The problem appears to be related to the presence or absence of the get_module_constant function in setuptools.depends:

    PS C:\Users\jaraco\projects\public\distribute> jython
    Jython 2.5.3b1 (2.5:5fa0a5810b25, Feb 22 2012, 12:39:02)
    [Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.7.0_03
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import  setuptools.tests
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "setuptools\tests\__init__.py", line 16, in <module>
        from setuptools.depends import Require, find_module, get_module_constant, extract_constant
    ImportError: cannot import name get_module_constant
    >>> import setuptools.depends
    >>> setuptools.depends.get_module_constant
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: 'module' object has no attribute 'get_module_constant'
    >>> dir(setuptools.depends)
    ['LooseVersion', 'PKG_DIRECTORY', 'PY_COMPILED', 'PY_FROZEN', 'PY_SOURCE', 'Require', 'StrictVersion', '__all__', '__doc__', '__file__', '__name__', '_iter_code', 'find_module', 'generators', 'imp', 'marshal', 'sys']
    >>>
    PS C:\Users\jaraco\projects\public\distribute> python
    Python 2.7.3 (default, Apr 10 2012, 23:24:47) [MSC v.1500 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import setuptools.depends
    >>> setuptools.depends.get_module_constant
    <function get_module_constant at 0x0000000002914D68>
    
  4. Arfrever Frehtes Taifersar Arahesis reporter

    Tests now pass with CPython 2.5, 2.6, 2.7, 3.1 and 3.2.

    test_setup_requires_honors_fetch_params fails with CPython 3.3 and Jython 2.5.

    Result with CPython 3.3:

    ======================================================================
    FAIL: test_setup_requires_honors_fetch_params (setuptools.tests.test_easy_install.TestSetupRequires)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "build/src/setuptools/tests/test_easy_install.py", line 306, in test_setup_requires_honors_fetch_params
        self.assertEqual(len(p_index.requests), 2)
    AssertionError: 3 != 2
    
    ----------------------------------------------------------------------
    

    Result with Jython 2.5:

    ======================================================================
    FAIL: test_setup_requires_honors_fetch_params (setuptools.tests.test_easy_install.TestSetupRequires)
    ----------------------------------------------------------------------
    Traceback (most recent call last):
      File "/tmp/distribute_jython/setuptools/tests/test_easy_install.py", line 306, in test_setup_requires_honors_fetch_params
        self.assertEqual(len(p_index.requests), 2)
    AssertionError: 0 != 2
    
    ----------------------------------------------------------------------
    
  5. Arfrever Frehtes Taifersar Arahesis reporter

    Regression with Jython 2.5 is fixed.

    Test suite fails to run with CPython 3.3:

    $ python3.3 setup.py test
    /usr/lib64/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'test_suite'
      warnings.warn(msg)
    /usr/lib64/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'entry_points'
      warnings.warn(msg)
    /usr/lib64/python3.3/distutils/dist.py:257: UserWarning: Unknown distribution option: 'zip_safe'
      warnings.warn(msg)
    running test
    Traceback (most recent call last):
      File "setup.py", line 214, in <module>
        scripts = scripts,
      File "/usr/lib64/python3.3/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/lib64/python3.3/distutils/dist.py", line 917, in run_commands
        self.run_command(cmd)
      File "/usr/lib64/python3.3/distutils/dist.py", line 935, in run_command
        cmd_obj.ensure_finalized()
      File "/usr/lib64/python3.3/distutils/cmd.py", line 107, in ensure_finalized
        self.finalize_options()
      File "build/src/setuptools/command/test.py", line 64, in finalize_options
        self.test_suite = self.distribution.test_suite
    AttributeError: 'Distribution' object has no attribute 'test_suite'
    
  6. Log in to comment