Skip to contentSkip to conversation

tests/docker: Add sqlite3 module to openSUSE Leap container

PATCH In review Fabiano Rosas 5 participants 6 messages Jan 17, 2024 – Jan 19, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 tests/docker: Add sqlite3 module to openSUSE Leap container

Avocado needs sqlite3:

Failed to load plugin from module "avocado.plugins.journal":
ImportError("Module 'sqlite3' is not installed.
Use: sudo zypper install python311 to install it")

From 'zypper info python311':
"This package supplies rich command line features provided by readline, and sqlite3 support for the interpreter core, thus forming a so called "extended" runtime."

Include the appropriate package in the lcitool mappings which will guarantee the dockerfile gets properly updated when lcitool is run. Also include the updated dockerfile.

---
 tests/docker/dockerfiles/opensuse-leap.docker | 1 +
 tests/lcitool/mappings.yml                    | 4 ++++
 tests/lcitool/projects/qemu.yml               | 1 +
 3 files changed, 6 insertions(+)
tests/docker/dockerfiles/opensuse-leap.docker +1 -0
index dc0e36ce48..cf753383a4 100644
@@ -90,6 +90,7 @@ RUN zypper update -y && \
            pcre-devel-static \
            pipewire-devel \
            pkgconfig \
+           python311 \
            python311-base \
            python311-pip \
            python311-setuptools \
tests/lcitool/mappings.yml +4 -0
index 0b908882f1..407c03301b 100644
@@ -59,6 +59,10 @@ mappings:
     CentOSStream8:
     OpenSUSELeap15:
 
+  python3-sqlite3:
+    CentOSStream8: python38
+    OpenSUSELeap15: python311
+
   python3-tomli:
     # test using tomllib
     apk:
tests/lcitool/projects/qemu.yml +1 -0
index 82092c9f17..149b15de57 100644
@@ -97,6 +97,7 @@ packages:
  - python3-pip
  - python3-sphinx
  - python3-sphinx-rtd-theme
+ - python3-sqlite3
  - python3-tomli
  - python3-venv
  - rpm2cpio
Signature · 1 line
2.35.3
Reviewed-by on v2 1/1
#1 lore raw
Quoted 6 lines · Fabiano Rosas

Avocado needs sqlite3:

Failed to load plugin from module "avocado.plugins.journal":
ImportError("Module 'sqlite3' is not installed.
Use: sudo zypper install python311 to install it")

Quoted 9 lines

From 'zypper info python311':
"This package supplies rich command line features provided by readline, and sqlite3 support for the interpreter core, thus forming a so called "extended" runtime."

Include the appropriate package in the lcitool mappings which will guarantee the dockerfile gets properly updated when lcitool is run. Also include the updated dockerfile.

Quoted 6 lines
---
  tests/docker/dockerfiles/opensuse-leap.docker | 1 +
  tests/lcitool/mappings.yml                    | 4 ++++
  tests/lcitool/projects/qemu.yml               | 1 +
  3 files changed, 6 insertions(+)
#2 lore raw
In reply to Fabiano Rosas
Quoted 5 lines · Fabiano Rosas

Avocado needs sqlite3:

Failed to load plugin from module "avocado.plugins.journal":
ImportError("Module 'sqlite3' is not installed.
Use: sudo zypper install python311 to install it")

Queued to testing/next, thanks.

Quoted 56 lines

From 'zypper info python311':
"This package supplies rich command line features provided by readline, and sqlite3 support for the interpreter core, thus forming a so called "extended" runtime."

Include the appropriate package in the lcitool mappings which will guarantee the dockerfile gets properly updated when lcitool is run. Also include the updated dockerfile.

---
 tests/docker/dockerfiles/opensuse-leap.docker | 1 +
 tests/lcitool/mappings.yml                    | 4 ++++
 tests/lcitool/projects/qemu.yml               | 1 +
 3 files changed, 6 insertions(+)
tests/docker/dockerfiles/opensuse-leap.docker +1 -0
index dc0e36ce48..cf753383a4 100644
@@ -90,6 +90,7 @@ RUN zypper update -y && \
            pcre-devel-static \
            pipewire-devel \
            pkgconfig \
+           python311 \
            python311-base \
            python311-pip \
            python311-setuptools \
tests/lcitool/mappings.yml +4 -0
index 0b908882f1..407c03301b 100644
@@ -59,6 +59,10 @@ mappings:
     CentOSStream8:
     OpenSUSELeap15:
 
+  python3-sqlite3:
+    CentOSStream8: python38
+    OpenSUSELeap15: python311
+
   python3-tomli:
     # test using tomllib
     apk:
tests/lcitool/projects/qemu.yml +1 -0
index 82092c9f17..149b15de57 100644
@@ -97,6 +97,7 @@ packages:
  - python3-pip
  - python3-sphinx
  - python3-sphinx-rtd-theme
+ - python3-sqlite3
  - python3-tomli
  - python3-venv
  - rpm2cpio
Signature · 2 lines
Alex Bennée
Virtualisation Tech Lead @ Linaro
#3 lore raw
In reply to Fabiano Rosas
Quoted 30 lines

             python311-setuptools \
tests/lcitool/mappings.yml +4 -0
index 0b908882f1..407c03301b 100644
@@ -59,6 +59,10 @@ mappings:
      CentOSStream8:
      OpenSUSELeap15:
 
+  python3-sqlite3:
+    CentOSStream8: python38
+    OpenSUSELeap15: python311
+
    python3-tomli:
      # test using tomllib
      apk:
tests/lcitool/projects/qemu.yml +1 -0
index 82092c9f17..149b15de57 100644
@@ -97,6 +97,7 @@ packages:
   - python3-pip
   - python3-sphinx
   - python3-sphinx-rtd-theme
+ - python3-sqlite3
   - python3-tomli
   - python3-venv
   - rpm2cpio
#4 lore raw
In reply to Fabiano Rosas

Sorry for the previous dummy post, - hit the wrong button :)

17.01.2024 19:42, Fabiano Rosas :

tests/docker/dockerfiles/opensuse-leap.docker RUN zypper update -y && \ · line 95

Quoted 11 lines

Avocado needs sqlite3:

tests/docker/dockerfiles/opensuse-leap.docker +1 -0
@@ -90,6 +90,7 @@ RUN zypper update -y && \
             pcre-devel-static \
             pipewire-devel \
             pkgconfig \
+           python311 \
             python311-base \
             python311-pip \

Isn't python311 already pulls in python311-base?

/mjt

#5 lore raw
Quoted 14 lines · Michael Tokarev

17.01.2024 19:42, Fabiano Rosas :

tests/docker/dockerfiles/opensuse-leap.docker RUN zypper update -y && \ · line 95

Quoted 11 lines

Avocado needs sqlite3:

tests/docker/dockerfiles/opensuse-leap.docker +1 -0
@@ -90,6 +90,7 @@ RUN zypper update -y && \
             pcre-devel-static \
             pipewire-devel \
             pkgconfig \
+           python311 \
             python311-base \
             python311-pip \

Isn't python311 already pulls in python311-base?

Yes, but lcitool doesn't know that :)

The information that is provided to the tool is:

* the python3 interpreter is in the python311-base package;
* the venv module is also in the python311-base package;
* the sqlite3 module is in the python311 package;

(via tests/lcitool/mappings.yml), as well as:

* QEMU needs the python3 interpreter plus the venv and sqlite3

    packages to build;

(via tests/lcitool/projects/qemu.yml).

Based on that, it concludes that the python311-base and python311 package need to be installed.

Notice how the former shows up only once in the Dockerfile, despite being mentioned twice in the list of dependencies for the project, because some basic deduplication is applied.

Of course the extra line doesn't matter at all in practice:

  # zypper install python311
  The following 4 NEW packages are going to be installed:
    libexpat1 libpython3_11-1_0 python311 python311-base

4 new packages to install.
Overall download size: 12.8 MiB. Already cached: 0 B. After the operation, additional 50.4 MiB will be used.

  # zypper install python311 python311-base
  The following 4 NEW packages are going to be installed:
    libexpat1 libpython3_11-1_0 python311 python311-base

4 new packages to install.
Overall download size: 12.8 MiB. Already cached: 0 B. After the operation, additional 50.4 MiB will be used.

This is the main reason why we never really bothered trying to avoid it.

Hope this helps!

Signature · 1 line
Andrea Bolognani / Red Hat / Virtualization