Skip to contentSkip to conversation

python3-subunit: ensure runtime dependencies are present

PATCH In review Trevor Gamblin 2 participants 4 messages Sep 23, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python3-subunit: ensure runtime dependencies are present

From: Trevor Gamblin <[email protected]>

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.
Quoted 1 line
Quoted 1 line
Quoted 1 line

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.

---
 meta/recipes-devtools/python/python3-subunit_1.3.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/python/python3-subunit_1.3.0.bb +2 -0
index 2ece4451df..55066e2d0f 100644
@@ -1,2 +1,4 @@
 inherit setuptools3
 require python-subunit.inc
+
+RDEPENDS_${PN} = " python3-testtools"
Signature · 1 line
2.21.0
#1 lore raw
Quoted 12 lines · Trevor Gamblin

From: Trevor Gamblin <[email protected]>

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.
Quoted 1 line
Quoted 1 line
Quoted 1 line

import subunit

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.7/site-packages/subunit/__init__.py", line
Quoted 9 lines

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:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/meta/recipes-devtools/python/python3/python3-manifest.json#n1158

Quoted 24 lines
---
 meta/recipes-devtools/python/python3-subunit_1.3.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/python/python3-subunit_1.3.0.bb +2 -1
index 2ece4451df..55066e2d0f 100644
@@ -1,2 +1,4 @@
 inherit setuptools3
 require python-subunit.inc
+
+RDEPENDS_${PN} = " python3-testtools"
--

2.21.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
Quoted 23 lines · Tim Orling

On Mon, Sep 23, 2019 at 8:53 AM Trevor Gamblin <[email protected] <mailto:[email protected]>> wrote:

From: Trevor Gamblin <[email protected] <mailto:[email protected]>>

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'
    >>>

Quoted 7 lines

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.
Quoted 1 line
Quoted 1 line
Quoted 1 line

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).

Quoted 33 lines

    Signed-off-by: Trevor Gamblin <[email protected]
    <mailto:[email protected]>>
    ---
     meta/recipes-devtools/python/python3-subunit_1.3.0.bb
    <http://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
    <http://python3-subunit_1.3.0.bb>
    b/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
    <http://python3-subunit_1.3.0.bb>
    index 2ece4451df..55066e2d0f 100644
    --- a/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
    <http://python3-subunit_1.3.0.bb>
    +++ b/meta/recipes-devtools/python/python3-subunit_1.3.0.bb
    <http://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
    [email protected]
    <mailto:[email protected]>
    http://lists.openembedded.org/mailman/listinfo/openembedded-core
#3 lore raw
Quoted 57 lines · Trevor Gamblin

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

Quoted 12 lines · Trevor Gamblin

From: Trevor Gamblin <[email protected]>

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.
Quoted 1 line
Quoted 1 line
Quoted 1 line

import subunit

    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python3.7/site-packages/subunit/__init__.py", line
Quoted 9 lines

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:

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.

Quoted 1 line
Quoted 1 line
Quoted 1 line

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

Quoted 7 lines

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).

Thank you for the update.
+1

Quoted 27 lines
Quoted 26 lines
---
 meta/recipes-devtools/python/python3-subunit_1.3.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/python/python3-subunit_1.3.0.bb +2 -1
index 2ece4451df..55066e2d0f 100644
@@ -1,2 +1,4 @@
 inherit setuptools3
 require python-subunit.inc
+
+RDEPENDS_${PN} = " python3-testtools"
--

2.21.0

--
_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core