Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH v2 1/6] python3: remove obsolete reformatting of _sysconfigdata*.py
@ 2026-11-11 14:17 Ross Burton
  2026-11-11 14:17 ` [PATCH v2 2/6] python3: compile .pyc at packaging time, remove from manifest Ross Burton
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Ross Burton @ 2026-11-11 14:17 UTC (permalink / raw)
  To: openembedded-core

The python3 recipe currently reformats the _sysconfigdata*.py files after
they are modified to remove build paths, as the files may be wrapped
differently based on the length of strings[1].

However, this wrapping was due to the use of pprint.pprint(), which
since Python 3.13 is no longer used to generate the sysconfigdata[2].

As such, remove the reformatting as it is no longer needed.

[1] oe-core ec8a2b310d5 ("python3: Reformat sysconfig")
[2] python 5ecedbd2669 ("gh-106789: avoid importing pprint from sysconfig (#106790)")

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../python/python3/reformat_sysconfig.py      | 21 -------------------
 .../python/python3_3.14.10.bb                 |  8 +------
 2 files changed, 1 insertion(+), 28 deletions(-)
 delete mode 100644 meta/recipes-devtools/python/python3/reformat_sysconfig.py

diff --git a/meta/recipes-devtools/python/python3/reformat_sysconfig.py b/meta/recipes-devtools/python/python3/reformat_sysconfig.py
deleted file mode 100644
index 5e2b12879d9..00000000000
--- a/meta/recipes-devtools/python/python3/reformat_sysconfig.py
+++ /dev/null
@@ -1,21 +0,0 @@
-#! /usr/bin/env python3
-#
-# SPDX-License-Identifier: MIT
-#
-# Copyright 2019 by Garmin Ltd. or its subsidiaries
-#
-# A script to reformat python sysconfig
-
-import sys
-import pprint
-l = {}
-g = {}
-with open(sys.argv[1], 'r') as f:
-    exec(f.read(), g, l)
-
-with open(sys.argv[1], 'w') as f:
-    for k in sorted(l.keys()):
-        f.write('%s = ' % k)
-        pprint.pprint(l[k], stream=f, width=1)
-        f.write('\n')
-
diff --git a/meta/recipes-devtools/python/python3_3.14.10.bb b/meta/recipes-devtools/python/python3_3.14.10.bb
index c50c4d4babc..28e67330d1a 100644
--- a/meta/recipes-devtools/python/python3_3.14.10.bb
+++ b/meta/recipes-devtools/python/python3_3.14.10.bb
@@ -12,7 +12,6 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \
            file://get_module_deps3.py \
            file://python3-manifest.json \
            file://check_build_completeness.py \
-           file://reformat_sysconfig.py \
            file://0001-Makefile.pre-use-qemu-wrapper-when-gathering-profile.patch \
            file://0001-test_locale.py-correct-the-test-output-format.patch \
            file://makerace.patch \
@@ -214,9 +213,6 @@ do_install:append:class-native() {
 }
 
 do_install:append() {
-        for c in ${D}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py; do
-            python3 ${UNPACKDIR}/reformat_sysconfig.py $c
-        done
         rm -f ${D}${libdir}/python${PYTHON_MAJMIN}/__pycache__/_sysconfigdata*.cpython*
 
         mkdir -p ${D}${libdir}/python-sysconfigdata
@@ -389,10 +385,8 @@ py_package_preprocess () {
                 ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfig_vars*.json \
                 ${PKGD}/${bindir}/python${PYTHON_MAJMIN}-config
 
-        # Reformat and recompile _sysconfigdata after modifying it so that it remains
-        # reproducible
+        # Recompile _sysconfigdata after modifying it
         for c in ${PKGD}/${libdir}/python${PYTHON_MAJMIN}/_sysconfigdata*.py; do
-            python3 ${UNPACKDIR}/reformat_sysconfig.py $c
             python3 -mcompileall $c -s ${PKGD} -p /
         done
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-11-12 11:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-11 14:17 [PATCH v2 1/6] python3: remove obsolete reformatting of _sysconfigdata*.py Ross Burton
2026-11-11 14:17 ` [PATCH v2 2/6] python3: compile .pyc at packaging time, remove from manifest Ross Burton
2026-11-11 14:17 ` [PATCH v2 3/6] python3: don't copy from UNPACKDIR to WORKDIR Ross Burton
2026-11-11 14:17 ` [PATCH v2 4/6] python3: no need to use an OrderedDict Ross Burton
2026-11-11 14:17 ` [PATCH v2 5/6] python3: add support for skipping dependencies when building the manifest Ross Burton
2026-11-11 14:17 ` [PATCH v2 6/6] python3: refresh manifest Ross Burton
2026-11-12 11:55 ` [OE-core] [PATCH v2 1/6] python3: remove obsolete reformatting of _sysconfigdata*.py Mathieu Dubois-Briand

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox