Return-Path: Received: from mail.windriver.com (mail.windriver.com [147.11.1.11]) by mail.openembedded.org (Postfix) with ESMTP id 17DC77DE37 for ; Mon, 23 Sep 2019 18:22:08 +0000 (UTC) Received: from ALA-HCA.corp.ad.wrs.com ([147.11.189.40]) by mail.windriver.com (8.15.2/8.15.1) with ESMTPS id x8NIM9tY001323 (version=TLSv1 cipher=AES128-SHA bits=128 verify=FAIL); Mon, 23 Sep 2019 11:22:09 -0700 (PDT) Received: from [128.224.56.209] (128.224.56.209) by ALA-HCA.corp.ad.wrs.com (147.11.189.50) with Microsoft SMTP Server (TLS) id 14.3.468.0; Mon, 23 Sep 2019 11:22:08 -0700 To: Tim Orling References: <20190923155238.31958-1-Trevor.Gamblin@windriver.com> From: Trevor Gamblin Message-ID: Date: Mon, 23 Sep 2019 14:22:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Cc: openembedded-core@lists.openembedded.org Subject: Re: [PATCH] python3-subunit: ensure runtime dependencies are present X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Sep 2019 18:22:09 -0000 Content-Type: multipart/alternative; boundary="------------C16C6507D8D0AEAB884E87A1" Content-Language: en-US --------------C16C6507D8D0AEAB884E87A1 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit On 9/23/19 2:06 PM, Tim Orling wrote: > > > On Mon, Sep 23, 2019 at 8:53 AM Trevor Gamblin > > > wrote: > > From: Trevor Gamblin > > > Without access to unittest, subunit cannot be imported in python3: > >     root@qemux86-64:~# python3 >     Python 3.7.4 (default, Sep 20 2019, 13:38:31) >     [GCC 9.2.0] on linux >     Type "help", "copyright", "credits" or "license" for more > information. >     >>> import subunit >     Traceback (most recent call last): >       File "", line 1, in >       File "/usr/lib/python3.7/site-packages/subunit/__init__.py", > line 123, in >         import unittest >     ModuleNotFoundError: No module named 'unittest' >     >>> > > Adding python3-testtools to python3-subunit's RDEPENDS fixes the > issue. This also implicitly provides the functionality found in > the python3-extras module. > > > If we literally only need unittest, then RDEPENDS on -testtools is > overkill. We only need the -unittest submodule: > http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/python/python3/python3-manifest.json#n1158 After running a quick test with python3-unittest and python3-extras as the RDEPENDS: root@qemux86-64:~# python3 Python 3.7.4 (default, Sep 20 2019, 13:38:31) [GCC 9.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import subunit Traceback (most recent call last):   File "", line 1, in   File "/usr/lib/python3.7/site-packages/subunit/__init__.py", line 130, in     from testtools import content, content_type, ExtendedToOriginalDecorator ModuleNotFoundError: No module named 'testtools' It does require testtools, but the errors being thrown were for the unittest and extras modules (both included with testtools). > > > Signed-off-by: Trevor Gamblin > > --- >  meta/recipes-devtools/python/python3-subunit_1.3.0.bb > | 2 ++ >  1 file changed, 2 insertions(+) > > diff --git a/meta/recipes-devtools/python/python3-subunit_1.3.0.bb > > b/meta/recipes-devtools/python/python3-subunit_1.3.0.bb > > index 2ece4451df..55066e2d0f 100644 > --- a/meta/recipes-devtools/python/python3-subunit_1.3.0.bb > > +++ b/meta/recipes-devtools/python/python3-subunit_1.3.0.bb > > @@ -1,2 +1,4 @@ >  inherit setuptools3 >  require python-subunit.inc > + > +RDEPENDS_${PN} = " python3-testtools" > -- > 2.21.0 > > -- > _______________________________________________ > Openembedded-core mailing list > Openembedded-core@lists.openembedded.org > > http://lists.openembedded.org/mailman/listinfo/openembedded-core > --------------C16C6507D8D0AEAB884E87A1 Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: 8bit

On 9/23/19 2:06 PM, Tim Orling wrote:



On Mon, Sep 23, 2019 at 8:53 AM Trevor Gamblin <Trevor.Gamblin@windriver.com> wrote:
From: Trevor Gamblin <trevor.gamblin@windriver.com>

Without access to unittest, subunit cannot be imported in python3:

    root@qemux86-64:~# python3
    Python 3.7.4 (default, Sep 20 2019, 13:38:31)
    [GCC 9.2.0] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import subunit
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.7/site-packages/subunit/__init__.py", line 123, in <module>
        import unittest
    ModuleNotFoundError: No module named 'unittest'
    >>>

Adding python3-testtools to python3-subunit's RDEPENDS fixes the
issue. This also implicitly provides the functionality found in
the python3-extras module.

If we literally only need unittest, then RDEPENDS on -testtools is overkill. We only need the -unittest submodule:

After running a quick test with python3-unittest and python3-extras as the RDEPENDS:

root@qemux86-64:~# python3                                                                            
Python 3.7.4 (default, Sep 20 2019, 13:38:31)            
[GCC 9.2.0] on linux                                                                                                                                                                         
Type "help", "copyright", "credits" or "license" for more information.          
>>> import subunit                              
Traceback (most recent call last):                                         
  File "<stdin>", line 1, in <module>                                                                                                                                                        
  File "/usr/lib/python3.7/site-packages/subunit/__init__.py", line 130, in <module>     
    from testtools import content, content_type, ExtendedToOriginalDecorator                                                                                                                 
ModuleNotFoundError: No module named 'testtools'


It does require testtools, but the errors being thrown were for the unittest and extras modules (both included with testtools).



Signed-off-by: Trevor Gamblin <trevor.gamblin@windriver.com>
---
 meta/recipes-devtools/python/python3-subunit_1.3.0.bb | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/meta/recipes-devtools/python/python3-subunit_1.3.0.bb b/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
index 2ece4451df..55066e2d0f 100644
--- a/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
+++ b/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
@@ -1,2 +1,4 @@
 inherit setuptools3
 require python-subunit.inc
+
+RDEPENDS_${PN} = " python3-testtools"
--
2.21.0

--
_______________________________________________
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core
--------------C16C6507D8D0AEAB884E87A1--