Skip to contentSkip to conversation

python3: support setting RPROVIDES in the manifest

PATCH Superseded Ross Burton 1 participant 4 messages Nov 18

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/4 python3: support setting RPROVIDES in the manifest

Allow modules to have a 'rprovides' key, that sets RPROVIDES for the generated package.

---
 .../python/python3/create_manifest3.py        | 23 ++++++++++++-------
 .../python/python3_3.14.10.bb                 |  9 ++++++++
 2 files changed, 24 insertions(+), 8 deletions(-)
meta/recipes-devtools/python/python3/create_manifest3.py +15 -8
index 9ce04fdd2aa..8ba51a2a0c3 100644
@@ -229,9 +229,20 @@ for pypkg in old_manifest:
 # will RDEPEND on it
 
 for pypkg in old_manifest:
+    # Handle special cases, we assume that when they were manually added
+    # to the manifest we knew what we were doing.
+    special_packages = ['misc', 'modules', 'dev', 'tests']
+    if pypkg in special_packages or 'staticdev' in pypkg:
+        print_indent('Passing %s package directly' % pypkg, 2)
+        new_manifest[pypkg] = old_manifest[pypkg]
+        if 'rprovides' not in new_manifest[pypkg]:
+            new_manifest[pypkg]['rprovides'] = []
+        continue
+
     # Use an empty dict as data structure to hold data for each package and fill it up
     new_manifest[pypkg] = {}
     new_manifest[pypkg]['summary'] = old_manifest[pypkg]['summary']
+    new_manifest[pypkg]['rprovides'] = old_manifest[pypkg].get('rprovides', [])
     new_manifest[pypkg]['rdepends'] = []
     if "skip_depends" in old_manifest[pypkg]:
         new_manifest[pypkg]['skip_depends'] = old_manifest[pypkg]['skip_depends']
@@ -248,14 +259,6 @@ for pypkg in old_manifest:
     print('Handling package %s' % pypkg)
     print('--------------------------')
 
-    # Handle special cases, we assume that when they were manually added 
-    # to the manifest we knew what we were doing.
-    special_packages = ['misc', 'modules', 'dev', 'tests']
-    if pypkg in special_packages or 'staticdev' in pypkg:
-        print_indent('Passing %s package directly' % pypkg, 2)
-        new_manifest[pypkg] = old_manifest[pypkg]
-        continue
-
     for filedep in old_manifest[pypkg]['files']:
         # We already handled core on the first pass, we can ignore it now
         if pypkg == 'core':
@@ -440,6 +443,10 @@ for pypkg in new_manifest:
     new_manifest[pypkg]['files'].sort()
     new_manifest[pypkg]['cached'].sort()
     new_manifest[pypkg]['rdepends'].sort()
+    new_manifest[pypkg]['rprovides'].sort()
+    # Remove empty sections
+    if not new_manifest[pypkg]['rprovides']:
+        new_manifest[pypkg].pop('rprovides')
 
 # Create the manifest from the data structure that was built
 with open('python3-manifest.json.new','w') as outfile:
meta/recipes-devtools/python/python3_3.14.10.bb +9 -0
index be4c50f6863..1f9d597eb69 100644
@@ -441,6 +441,10 @@ python(){
         pypackage = pn + '-' + key + '-native'
         if pypackage not in rprovides:
               rprovides.append(pypackage)
+        for subkey in python_manifest[key].get('rprovides', ()):
+            pypackage = pn + '-' + subkey + '-native'
+            if pypackage not in rprovides:
+                rprovides.append(pypackage)
 
     d.setVar('RPROVIDES:class-native', ' '.join(rprovides))
 
@@ -474,6 +478,11 @@ python(){
                 value=value.split('-', 1)[1]
             d.appendVar('RDEPENDS:' + pypackage, ' ' + pn + '-' + value)
 
+        for value in python_manifest[key].get('rprovides', ()):
+            if '${PN}' in value:
+                value=value.split('-', 1)[1]
+            d.appendVar('RPROVIDES:' + pypackage, ' ' + pn + '-' + value)
+
         for value in python_manifest[key].get('rrecommends', ()):
             if '${PN}' in value:
                 value=value.split('-', 1)[1]
Signature · 1 line
2.43.0
#1 lore raw

PATCH 2/4 python3: set RPROVIDES for fcntl and pkgutil instead of empty packages

The -fcntl and -pkgutil packages were previously separate but merged into -core as they became mandatory dependencies.

The -fcntl package had a file in the manifest, but this was already packaged into -core so the package was actually empty.

Instead of generating empty packages, we can now just RPROVIDE the old name.

[1] pkgutil in oe-core e6ab9f16b92 ("python3: update to 3.8.1"),

    fcntl in oe-core 0b49c9aa312 ("python3: update 3.12.6 -> 3.13.0")
---
 .../python/python3/python3-manifest.json      | 23 ++++---------------
 .../python/python3_3.14.10.bb                 |  2 --
 2 files changed, 5 insertions(+), 20 deletions(-)
meta/recipes-devtools/python/python3/python3-manifest.json +5 -18
index 0c91745e675..902f7c31475 100644
@@ -186,6 +186,11 @@
     },
     "core": {
         "summary": "Python interpreter and core modules",
+        "rprovides": [
+            "compression",
+            "fcntl",
+            "pkgutil"
+        ],
         "rdepends": [],
         "skip_depends": {
             "core": [
@@ -632,14 +637,6 @@
         ],
         "cached": []
     },
-    "fcntl": {
-        "summary": "Python's fcntl interface",
-        "rdepends": [
-            "core"
-        ],
-        "files": [],
-        "cached": []
-    },
     "gdbm": {
         "summary": "Python GNU database support",
         "rdepends": [
@@ -808,7 +805,6 @@
             "doctest",
             "email",
             "ensurepip",
-            "fcntl",
             "html",
             "idle",
             "image",
@@ -824,7 +820,6 @@
             "netserver",
             "numbers",
             "pickle",
-            "pkgutil",
             "plistlib",
             "pprint",
             "profile",
@@ -961,14 +956,6 @@
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/shelve.*.pyc"
         ]
     },
-    "pkgutil": {
-        "summary": "Python package extension utility support",
-        "rdepends": [
-            "core"
-        ],
-        "files": [],
-        "cached": []
-    },
     "plistlib": {
         "summary": "Generate and parse Mac OS X .plist files",
         "rdepends": [
meta/recipes-devtools/python/python3_3.14.10.bb +0 -2
index 1f9d597eb69..b3e8123d4d6 100644
@@ -493,9 +493,7 @@ python(){
     # Prepending so to avoid python-misc getting everything
     packages = newpackages + packages
     d.setVar('PACKAGES', ' '.join(packages))
-    d.setVar('ALLOW_EMPTY:${PN}-fcntl', '1')
     d.setVar('ALLOW_EMPTY:${PN}-modules', '1')
-    d.setVar('ALLOW_EMPTY:${PN}-pkgutil', '1')
 
     if "pgo" in d.getVar("PACKAGECONFIG").split() and not bb.utils.contains('MACHINE_FEATURES', 'qemu-usermode', True, False, d):
         bb.fatal("pgo cannot be enabled as there is no qemu-usermode support for this architecture/machine")
Signature · 1 line
2.43.0
#2 lore raw

PATCH 3/4 python3: merge -stringold to -core

In reply to Ross Burton

The "stringold" module isn't actually "old", it's the original string module with utility methods and templating code.

It's not deprecated and is small, so merge it into -core, add a RPROVIDES to preserve existing dependencies, and refresh the manifest.

---
 .../python/python3/python3-manifest.json      | 39 +++++--------------
 1 file changed, 10 insertions(+), 29 deletions(-)
meta/recipes-devtools/python/python3/python3-manifest.json +10 -29
index 902f7c31475..f0192365f4a 100644
@@ -111,8 +111,7 @@
             "io",
             "logging",
             "netclient",
-            "numbers",
-            "stringold"
+            "numbers"
         ],
         "files": [
             "${libdir}/python${PYTHON_MAJMIN}/asyncio",
@@ -189,7 +188,8 @@
         "rprovides": [
             "compression",
             "fcntl",
-            "pkgutil"
+            "pkgutil",
+            "stringold"
         ],
         "rdepends": [],
         "skip_depends": {
@@ -325,6 +325,7 @@
             "${libdir}/python${PYTHON_MAJMIN}/sre_constants.py",
             "${libdir}/python${PYTHON_MAJMIN}/sre_parse.py",
             "${libdir}/python${PYTHON_MAJMIN}/stat.py",
+            "${libdir}/python${PYTHON_MAJMIN}/string",
             "${libdir}/python${PYTHON_MAJMIN}/stringprep.py",
             "${libdir}/python${PYTHON_MAJMIN}/struct.py",
             "${libdir}/python${PYTHON_MAJMIN}/subprocess.py",
@@ -537,8 +538,7 @@
             "netclient",
             "numbers",
             "pprint",
-            "shell",
-            "stringold"
+            "shell"
         ],
         "files": [
             "${libdir}/python${PYTHON_MAJMIN}/bdb.py",
@@ -598,7 +598,6 @@
             "numbers",
             "pprint",
             "shell",
-            "stringold",
             "unittest"
         ],
         "files": [
@@ -616,8 +615,7 @@
             "io",
             "math",
             "mime",
-            "netclient",
-            "stringold"
+            "netclient"
         ],
         "files": [
             "${libdir}/python${PYTHON_MAJMIN}/email",
@@ -722,7 +720,6 @@
             "io",
             "netserver",
             "pickle",
-            "stringold",
             "threading"
         ],
         "files": [
@@ -739,8 +736,7 @@
             "io",
             "math",
             "mime",
-            "netclient",
-            "stringold"
+            "netclient"
         ],
         "files": [
             "${libdir}/python${PYTHON_MAJMIN}/mailbox.py"
@@ -874,8 +870,7 @@
             "email",
             "io",
             "math",
-            "mime",
-            "stringold"
+            "mime"
         ],
         "files": [
             "${libdir}/python${PYTHON_MAJMIN}/base64.py",
@@ -1064,17 +1059,6 @@
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/statistics.*.pyc"
         ]
     },
-    "stringold": {
-        "summary": "Common string operations",
-        "rdepends": [
-            "core"
-        ],
-        "files": [
-            "${libdir}/python${PYTHON_MAJMIN}/string",
-            "${libdir}/python${PYTHON_MAJMIN}/string/__pycache__"
-        ],
-        "cached": []
-    },
     "syslog": {
         "summary": "Python syslog interface",
         "rdepends": [
@@ -1145,8 +1129,7 @@
             "logging",
             "netclient",
             "numbers",
-            "pprint",
-            "stringold"
+            "pprint"
         ],
         "files": [
             "${libdir}/python${PYTHON_MAJMIN}/unittest",
@@ -1174,8 +1157,7 @@
             "compression",
             "core",
             "logging",
-            "shell",
-            "stringold"
+            "shell"
         ],
         "files": [
             "${bindir}/pyvenv*",
@@ -1209,7 +1191,6 @@
             "netserver",
             "numbers",
             "pydoc",
-            "stringold",
             "xml"
         ],
         "files": [
Signature · 1 line
2.43.0
#3 lore raw

PATCH 4/4 python3: move base64 into -core

In reply to Ross Burton

There are a lot of dependencies on the netclient package (1.2MB) simply for the base64 module (22K). Move this into core and refresh the manifest.

---
 .../python/python3/python3-manifest.json        | 17 +++++------------
 1 file changed, 5 insertions(+), 12 deletions(-)
meta/recipes-devtools/python/python3/python3-manifest.json +5 -12
index f0192365f4a..c4ec0838341 100644
@@ -110,7 +110,6 @@
             "debugger",
             "io",
             "logging",
-            "netclient",
             "numbers"
         ],
         "files": [
@@ -231,6 +230,7 @@
             "${libdir}/python${PYTHON_MAJMIN}/annotationlib.py",
             "${libdir}/python${PYTHON_MAJMIN}/argparse.py",
             "${libdir}/python${PYTHON_MAJMIN}/ast.py",
+            "${libdir}/python${PYTHON_MAJMIN}/base64.py",
             "${libdir}/python${PYTHON_MAJMIN}/bisect.py",
             "${libdir}/python${PYTHON_MAJMIN}/code.py",
             "${libdir}/python${PYTHON_MAJMIN}/codecs.py",
@@ -363,6 +363,7 @@
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/annotationlib.*.pyc",
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/argparse.*.pyc",
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/ast.*.pyc",
+            "${libdir}/python${PYTHON_MAJMIN}/__pycache__/base64.*.pyc",
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/bisect.*.pyc",
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/code.*.pyc",
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/codecs.*.pyc",
@@ -535,7 +536,6 @@
             "json",
             "logging",
             "math",
-            "netclient",
             "numbers",
             "pprint",
             "shell"
@@ -594,7 +594,6 @@
             "json",
             "logging",
             "math",
-            "netclient",
             "numbers",
             "pprint",
             "shell",
@@ -614,8 +613,7 @@
             "datetime",
             "io",
             "math",
-            "mime",
-            "netclient"
+            "mime"
         ],
         "files": [
             "${libdir}/python${PYTHON_MAJMIN}/email",
@@ -683,8 +681,7 @@
         "rdepends": [
             "compression",
             "core",
-            "math",
-            "netclient"
+            "math"
         ],
         "files": [
             "${libdir}/python${PYTHON_MAJMIN}/_pyio.py",
@@ -735,8 +732,7 @@
             "email",
             "io",
             "math",
-            "mime",
-            "netclient"
+            "mime"
         ],
         "files": [
             "${libdir}/python${PYTHON_MAJMIN}/mailbox.py"
@@ -873,7 +869,6 @@
             "mime"
         ],
         "files": [
-            "${libdir}/python${PYTHON_MAJMIN}/base64.py",
             "${libdir}/python${PYTHON_MAJMIN}/ftplib.py",
             "${libdir}/python${PYTHON_MAJMIN}/hmac.py",
             "${libdir}/python${PYTHON_MAJMIN}/http",
@@ -888,7 +883,6 @@
             "${libdir}/python${PYTHON_MAJMIN}/uuid.py"
         ],
         "cached": [
-            "${libdir}/python${PYTHON_MAJMIN}/__pycache__/base64.*.pyc",
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/ftplib.*.pyc",
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/hmac.*.pyc",
             "${libdir}/python${PYTHON_MAJMIN}/__pycache__/mimetypes.*.pyc",
@@ -1127,7 +1121,6 @@
             "difflib",
             "io",
             "logging",
-            "netclient",
             "numbers",
             "pprint"
         ],
Signature · 1 line
2.43.0