Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 532720 - =dev-python/testtools-1.2.0: build error—ImportError: No module named 'unittest2'
Summary: =dev-python/testtools-1.2.0: build error—ImportError: No module named 'unitte...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: bazaar+obsolete
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-16 16:20 UTC by Alex Brandt (RETIRED)
Modified: 2014-12-19 19:45 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Brandt (RETIRED) gentoo-dev 2014-12-16 16:20:51 UTC
During build of =dev-python/testtools-1.2.0 setup complains about a lack of unittest2 in the python3.3 environment.  Looks like this is just missing unittest2 as a dependency at least for that python implementation.

Reproducible: Always

Steps to Reproduce:
1. unittest2 is not installed
2. emerge =dev-python/testtools-1.2.0 with python2_7 and python3_3
3. build fails
Actual Results:  
Build failure:

 * python3_3: running distutils-r1_run_phase distutils-r1_python_compile
/usr/bin/python3.3 setup.py build

Error:
  * In program cave perform install --hooks --managed-output --output-exclusivity with-others =dev-python/testtools-1.2.0:0::gentoo --destination installed --replacing =dev-python/testtools-1.1.0:0::installed --x-of-y 2 of 2:
  * When installing 'dev-python/testtools-1.2.0:0::gentoo' replacing { 'dev-python/testtools-1.1.0:0::installed' }:
  * When running an ebuild command on 'dev-python/testtools-1.2.0:0::gentoo':
  * Install failed for 'dev-python/testtools-1.2.0:0::gentoo' (paludis::ActionFailedError)

Traceback (most recent call last):
  File "setup.py", line 10, in <module>
    import testtools
  File "/var/tmp/paludis/dev-python-testtools-1.2.0/work/testtools-1.2.0/testtools/__init__.py", line 109, in <module>
    from testtools.distutilscmd import (
  File "/var/tmp/paludis/dev-python-testtools-1.2.0/work/testtools-1.2.0/testtools/distutilscmd.py", line 10, in <module>
    from testtools.run import TestProgram, TestToolsTestRunner
  File "/var/tmp/paludis/dev-python-testtools-1.2.0/work/testtools-1.2.0/testtools/run.py", line 14, in <module>
    import unittest2 as unittest
ImportError: No module named 'unittest2'


Expected Results:  
Successful build.

Looks like it's just missing the dependency on unittest2.
Comment 1 Klemen Mihevc 2014-12-16 19:49:47 UTC
Same issue... puting  dev-python/unittest2 in to depend fixes issue...
Comment 2 Ian Delaney (RETIRED) gentoo-dev 2014-12-16 23:05:47 UTC
  16 Dec 2014; Ian Delaney <idella4@gentoo.org> testtools-1.1.0.ebuild,
  testtools-1.2.0.ebuild:
  add new dep, rm unneeded prepare phase. closes bug #532720
Comment 3 Reuben Farrelly 2014-12-18 08:39:25 UTC
I don't think this fix currently in portage is quite right.  I am still seeing this same build failure caused by the lack of unittest2 installation.

I am compiling with the following USE flags:

[ebuild   R    ] dev-python/testtools-1.2.0  USE="-doc {-test}" PYTHON_TARGETS="python2_7 -pypy -python3_3 -python3_4" 0 KiB

ie I'm not setting -test, but by the looks of the ebuild the dependency is only pulled in if this test flag is set.  I think the dependency should really be met regardless of the status of -test ?
Comment 4 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-12-18 16:13:17 UTC
Reopening as it still fails with python:3.4 and doesn't get pulled in by the python3_4 USE flag.
Comment 5 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2014-12-18 16:14:11 UTC
I mean, unittest2 doesn't get pulled in by python3_4 USE flag.
Comment 6 Alex Brandt (RETIRED) gentoo-dev 2014-12-18 16:25:18 UTC
Looks like this should NOT be conditional on testing.  It's a build time requirement regardless of testing.
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-18 19:32:05 UTC
(In reply to Ian Delaney from comment #2)

Why wasn't this properly assigned?
Comment 8 Mike Gilbert gentoo-dev 2014-12-19 19:45:50 UTC
(In reply to Alex Brandt from comment #6)
> Looks like this should NOT be conditional on testing.  It's a build time
> requirement regardless of testing.

Actually, it looks like a *runtime* requirement as well.

      install_requires=[
        'extras',
        # 'mimeparse' has not been uploaded by the maintainer with Python3 compat
        # but someone kindly uploaded a fixed version as 'python-mimeparse'.
        'python-mimeparse',
        'unittest2',
        ],

+  19 Dec 2014; Mike Gilbert <floppym@gentoo.org> testtools-1.2.0.ebuild:
+  Unconditionally depend on unittest2 at run/build time, bug 532720.