Skip to contentSkip to conversation

python3: fix run-time availability of python3-build

PATCH Superseded Bartosz Golaszewski 1 participant 6 messages Apr 13, 2023

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover python3: fix run-time availability of python3-build

From: Bartosz Golaszewski <[email protected]>

python3-build cannot be used in self-hosted images due to missing run-time dependencies in several packages. This series adds required RDEPENDS to python3-packaging and python3-pyproject-hooks, extends the manifest to include standard tomllib and ensurepip package and finally fixes run-time dependencies of python3-build itself.

Bartosz Golaszewski (5):
python3-pyproject-hooks: add missing run-time dependencies
python3-packaging: add missing run-time dependencies
python3-manifest: add tomllib
python3-manifest: add ensurepip
python3-build: add missing run-time dependencies

 .../python/python3-build_0.10.0.bb            | 11 ++++-
 .../python/python3-packaging_23.0.bb          |  1 +
 .../python/python3-pyproject-hooks_1.0.0.bb   |  2 +
 .../python/python3/python3-manifest.json      | 40 +++++++++++++++++++
 4 files changed, 53 insertions(+), 1 deletion(-)
Signature · 1 line
2.37.2
#1 lore raw

PATCH 1/5 python3-pyproject-hooks: add missing run-time dependencies

From: Bartosz Golaszewski <[email protected]>

JSON module is required at run-time by pyproject-hooks.

---
 meta/recipes-devtools/python/python3-pyproject-hooks_1.0.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/python/python3-pyproject-hooks_1.0.0.bb +2 -0
index 9aca5918ec..e3893d51cb 100644
@@ -14,6 +14,8 @@ BBCLASSEXTEND = "native nativesdk"
 # Bootstrap the native build
 DEPENDS:remove:class-native = "python3-build-native"
 
+RDEPENDS:${PN} += "python3-json"
+
 do_compile:class-native () {
     python_flit_core_do_manual_build
 }
Signature · 1 line
2.37.2
#2 lore raw

PATCH 2/5 python3-packaging: add missing run-time dependencies

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

python3-profile is required by python3-packaging at run-time.

---
 meta/recipes-devtools/python/python3-packaging_23.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/python/python3-packaging_23.0.bb +1 -0
index 7b69c880c1..c3d748911c 100644
@@ -11,6 +11,7 @@ BBCLASSEXTEND = "native nativesdk"
 
 # Bootstrap the native build
 DEPENDS:remove:class-native = "python3-build-native"
+RDEPENDS:${PN} += "python3-profile"
 
 do_compile:class-native () {
     python_flit_core_do_manual_build
Signature · 1 line
2.37.2
#3 lore raw

PATCH 3/5 python3-manifest: add tomllib

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the TOML parsing module from the standard library to the manifest.

---
 .../python/python3/python3-manifest.json        | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
meta/recipes-devtools/python/python3/python3-manifest.json +17 -0
index 498402af42..9e91270a50 100644
@@ -829,6 +829,7 @@
             "stringold",
             "syslog",
             "terminal",
+            "tomllib",
             "threading",
             "tkinter",
             "unittest",
@@ -1179,6 +1180,22 @@
         ],
         "cached": []
     },
+    "tomllib": {
+        "summary": "Provides an interface for parsing TOML",
+        "rdepends": [
+            "core",
+            "datetime",
+            "stringold"
+        ],
+        "files": [
+            "${libdir}/python${PYTHON_MAJMIN}/tomllib/"
+        ],
+        "cached": [
+            "${libdir}/python${PYTHON_MAJMIN}/tomllib/_re.*.pyc",
+            "${libdir}/python${PYTHON_MAJMIN}/tomllib/_types.*.pyc",
+            "${libdir}/python${PYTHON_MAJMIN}/tomllib/_parser.*.pyc"
+        ]
+    },
     "unittest": {
         "summary": "Python unit testing framework",
         "rdepends": [
Signature · 1 line
2.37.2
#4 lore raw

PATCH 4/5 python3-manifest: add ensurepip

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

Add the pip bootstrapping module from the standard library to the manifest. This module is a run-time requirement of python3-build.

---
 .../python/python3/python3-manifest.json      | 23 +++++++++++++++++++
 1 file changed, 23 insertions(+)
meta/recipes-devtools/python/python3/python3-manifest.json +23 -0
index 9e91270a50..f278b18775 100644
@@ -610,6 +610,28 @@
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/imaplib.*.pyc"
         ]
     },
+    "ensurepip": {
+        "summary": "Support for bootstrapping the pip installer",
+        "rdepends": [
+            "asyncio",
+            "compile",
+            "core",
+            "ctypes",
+            "image",
+            "io",
+            "mmap",
+            "plistlib",
+            "pprint",
+            "unixadmin",
+            "xmlrpc"
+        ],
+        "files": [
+            "${libdir}/python${PYTHON_MAJMIN}/ensurepip/"
+        ],
+        "cached": [
+            "${libdir}/python${PYTHON_MAJMIN}/ensurepip/_uninstall.*.pyc"
+        ]
+    },
     "fcntl": {
         "summary": "Python's fcntl interface",
         "rdepends": [
@@ -800,6 +822,7 @@
             "distutils",
             "doctest",
             "email",
+            "ensurepip",
             "fcntl",
             "html",
             "idle",
Signature · 1 line
2.37.2
#5 lore raw

PATCH 5/5 python3-build: add missing run-time dependencies

In reply to Bartosz Golaszewski

From: Bartosz Golaszewski <[email protected]>

python3-build has several run-time dependencies that are missing from the recipe. This makes it impossible to use the module in self-hosted images. Add missing RDEPENDS.

---
 meta/recipes-devtools/python/python3-build_0.10.0.bb | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
meta/recipes-devtools/python/python3-build_0.10.0.bb +10 -1
index 770a32023d..b446fa391d 100644
@@ -18,6 +18,15 @@ do_compile:prepend:class-native() {
     export PYTHONPATH="${S}/src"
 }
 
-RDEPENDS:${PN} += "python3-packaging python3-pyproject-hooks"
+RDEPENDS:${PN} += " \
+    python3-compression \
+    python3-difflib \
+    python3-ensurepip \
+    python3-logging \
+    python3-packaging \
+    python3-pyproject-hooks \
+    python3-tomllib \
+    python3-venv \
+"
 
 BBCLASSEXTEND = "native nativesdk"
Signature · 1 line
2.37.2