Skip to contentSkip to conversation

python3-setuptools: _distutils/sysconfig fix

PATCH New Tim Orling 1 participant 2 messages Oct 20, 2021

lore
Share & tools
lore

Tim Orling

author
#0 lore raw

PATCH 1/2 python3-setuptools: _distutils/sysconfig fix

Add patch to append STAGING_LIBDIR python-sysconfigdata to sys.path so that packages which set SETUPTOOLS_USE_DISUTILS='local' cross-compile properly with python3-setuptools-native.

Fixes:
ModuleNotFoundError: No module named '_sysconfigdata'

References:
https://setuptools.pypa.io/en/latest/deprecated/distutils-legacy.html#porting-from-distutils

---
 ...nfig-append-STAGING_LIBDIR-python-sy.patch | 34 +++++++++++++++++++
 .../python/python3-setuptools_58.2.0.bb       |  5 ++-
 2 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/python/python3-setuptools/0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch
meta/recipes-devtools/python/python3-setuptools/0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch new file +34 -0
new file mode 100644
index 0000000000..565cf8ae8d
@@ -0,0 +1,34 @@
+From 44349672cbff8945693c8d2821c82e9f04bfc8b5 Mon Sep 17 00:00:00 2001
+From: Tim Orling <[email protected]>
+Date: Wed, 20 Oct 2021 17:38:10 +0000
+Subject: [PATCH] _distutils/sysconfig: append
+ STAGING_LIBDIR/python-sysconfigdata to sys.path
+
+When python modules set SETUPTOOLS_USE_DISTULS='local', this uses the
+vendored _distutils in setuptools rather than distutils in the Standard
+Library. This is needed so that target configuration can be used with
+python3-setuptools-native.
+
+Based on python3/0001-distutils-sysconfig-append-STAGING_LIBDIR-python-sys.patch
+from Alex Kanavin <[email protected]>
+
+Upstream-Status: Inappropriate [oe-specific]
+
+Signed-off-by: Tim Orling <[email protected]>
+---
+ setuptools/_distutils/sysconfig.py | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/setuptools/_distutils/sysconfig.py b/setuptools/_distutils/sysconfig.py
+index 8832b3e..bbc7c08 100644
+--- a/setuptools/_distutils/sysconfig.py
++++ b/setuptools/_distutils/sysconfig.py
+@@ -461,6 +461,8 @@ def _init_posix():
+         platform=sys.platform,
+         multiarch=getattr(sys.implementation, '_multiarch', ''),
+     ))
++    if 'STAGING_LIBDIR' in os.environ:
++        sys.path.append(os.environ['STAGING_LIBDIR']+'/python-sysconfigdata')
+     try:
+         _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
+     except ImportError:
meta/recipes-devtools/python/python3-setuptools_58.2.0.bb +4 -1
index 0a05ac6079..b37c44854c 100644
@@ -8,7 +8,10 @@ inherit pypi setuptools3
 
 SRC_URI:append:class-native = " file://0001-conditionally-do-not-fetch-code-by-easy_install.patch"
 
-SRC_URI += "file://0001-change-shebang-to-python3.patch"
+SRC_URI += "\
+    file://0001-change-shebang-to-python3.patch \
+    file://0001-_distutils-sysconfig-append-STAGING_LIBDIR-python-sy.patch \
+"
 
 SRC_URI[sha256sum] = "2c55bdb85d5bb460bd2e3b12052b677879cffcf46c0c688f2e5bf51d36001145"
 
Signature · 1 line
2.30.2
author
#1 lore raw

PATCH 2/2 python3-pyyaml: upgrade 5.4.1 -> 6.0

Now uses "vendored" distutils from setuptools by default rather than from Python stdlib.

Changes
=======

* https://github.com/yaml/pyyaml/pull/327
-- Change README format to Markdown
* https://github.com/yaml/pyyaml/pull/483
-- Add a test for YAML 1.1 types
* https://github.com/yaml/pyyaml/pull/497
-- fix float resolver to ignore . and ._
* https://github.com/yaml/pyyaml/pull/550
-- drop Python 2.7
* https://github.com/yaml/pyyaml/pull/553
-- Fix spelling of “hexadecimal”
* https://github.com/yaml/pyyaml/pull/556
-- fix representation of Enum subclasses
* https://github.com/yaml/pyyaml/pull/557
-- fix libyaml extension compiler warnings
* https://github.com/yaml/pyyaml/pull/560
-- fix ResourceWarning on leaked file descriptors
* https://github.com/yaml/pyyaml/pull/561
-- always require Loader arg to yaml.load()
* https://github.com/yaml/pyyaml/pull/564
-- remove remaining direct distutils usage

---
 .../python/{python3-pyyaml_5.4.1.bb => python3-pyyaml_6.0.bb}   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
 rename meta/recipes-devtools/python/{python3-pyyaml_5.4.1.bb => python3-pyyaml_6.0.bb} (81%)
meta/recipes-devtools/python/python3-pyyaml_6.0.bb renamed from meta/recipes-devtools/python/python3-pyyaml_5.4.1.bb +1 -1
similarity index 81%
rename from meta/recipes-devtools/python/python3-pyyaml_5.4.1.bb
rename to meta/recipes-devtools/python/python3-pyyaml_6.0.bb
index b11baa6331..2df0e649f0 100644
@@ -9,7 +9,7 @@ PYPI_PACKAGE = "PyYAML"
 
 inherit pypi setuptools3
 
-SRC_URI[sha256sum] = "607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"
+SRC_URI[sha256sum] = "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"
 
 RDEPENDS:${PN} += "\
     ${PYTHON_PN}-datetime \
Signature · 1 line
2.30.2