openembedded-core.lists.openembedded.org archive mirror
 help / color / mirror / Atom feed
* [meta-python][PATCH] meta-python: gyp: fix for compatibility with Python 3.10
@ 2021-10-18 20:28 Kurt Kiefer
  0 siblings, 0 replies; only message in thread
From: Kurt Kiefer @ 2021-10-18 20:28 UTC (permalink / raw)
  To: openembedded-core; +Cc: Kurt Kiefer

From: Kurt Kiefer <kurt.kiefer@arthrex.com>

The collections abstract base classes module is finally moved to
collections.abc starting in Python 3.10.

Fixes the following problem encountered making use of gyp:

|   File "[...]/usr/lib/python3.10/site-packages/gyp/common.py", line 497, in <module>
|     class OrderedSet(collections.MutableSet):
| AttributeError: module 'collections' has no attribute 'MutableSet'

Signed-off-by: Kurt Kiefer <kurt.kiefer@arthrex.com>
---
 ...01-Fix-for-Python-3.10-compatibility.patch | 25 +++++++++++++++++++
 meta-python/recipes-devtools/gyp/gyp_git.bb   |  4 ++-
 2 files changed, 28 insertions(+), 1 deletion(-)
 create mode 100644 meta-python/recipes-devtools/gyp/gyp/0001-Fix-for-Python-3.10-compatibility.patch

diff --git a/meta-python/recipes-devtools/gyp/gyp/0001-Fix-for-Python-3.10-compatibility.patch b/meta-python/recipes-devtools/gyp/gyp/0001-Fix-for-Python-3.10-compatibility.patch
new file mode 100644
index 000000000..2b88023fe
--- /dev/null
+++ b/meta-python/recipes-devtools/gyp/gyp/0001-Fix-for-Python-3.10-compatibility.patch
@@ -0,0 +1,25 @@
+From bfe579283e5fcab60172818bfe4e6e1d40c2bed0 Mon Sep 17 00:00:00 2001
+From: Kurt Kiefer <kurt.kiefer@arthrex.com>
+Date: Mon, 18 Oct 2021 11:21:14 -0700
+Subject: [PATCH] Fix for Python 3.10 compatibility
+
+The collections.abc module replaces collections for Python 3.10
+
+Signed-off-by: Kurt Kiefer <kurt.kiefer@arthrex.com>
+---
+ pylib/gyp/common.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/pylib/gyp/common.py b/pylib/gyp/common.py
+index b268d229..4f9cb0ec 100644
+--- a/pylib/gyp/common.py
++++ b/pylib/gyp/common.py
+@@ -494,7 +494,7 @@ def uniquer(seq, idfun=None):
+ 
+ 
+ # Based on http://code.activestate.com/recipes/576694/.
+-class OrderedSet(collections.MutableSet):
++class OrderedSet(collections.abc.MutableSet):
+   def __init__(self, iterable=None):
+     self.end = end = []
+     end += [None, end, end]         # sentinel node for doubly linked list
diff --git a/meta-python/recipes-devtools/gyp/gyp_git.bb b/meta-python/recipes-devtools/gyp/gyp_git.bb
index d668d1ca1..73329cec7 100644
--- a/meta-python/recipes-devtools/gyp/gyp_git.bb
+++ b/meta-python/recipes-devtools/gyp/gyp_git.bb
@@ -4,7 +4,9 @@ LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=ab828cb8ce4c62ee82945a11247b6bbd"
 SECTION = "devel"
 
-SRC_URI = "git://chromium.googlesource.com/external/gyp;protocol=https"
+SRC_URI = "git://chromium.googlesource.com/external/gyp;protocol=https \
+           file://0001-Fix-for-Python-3.10-compatibility.patch \
+           "
 SRCREV = "caa60026e223fc501e8b337fd5086ece4028b1c6"
 
 S = "${WORKDIR}/git"
-- 
2.29.2



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-18 20:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 20:28 [meta-python][PATCH] meta-python: gyp: fix for compatibility with Python 3.10 Kurt Kiefer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).