public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/dicttoxml/, dev-python/dicttoxml/files/
@ 2021-08-23 22:46 Louis Sautier
  0 siblings, 0 replies; only message in thread
From: Louis Sautier @ 2021-08-23 22:46 UTC (permalink / raw
  To: gentoo-commits

commit:     27c3aaec24b9f604673bf84e6cafb7d50d0de8fa
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Mon Aug 23 22:29:51 2021 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Mon Aug 23 22:44:32 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27c3aaec

dev-python/dicttoxml: enable py3.10

Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 dev-python/dicttoxml/dicttoxml-1.7.4-r2.ebuild     | 22 ++++++++
 .../dicttoxml/files/dicttoxml-1.7.4-py3.10.patch   | 58 ++++++++++++++++++++++
 2 files changed, 80 insertions(+)

diff --git a/dev-python/dicttoxml/dicttoxml-1.7.4-r2.ebuild b/dev-python/dicttoxml/dicttoxml-1.7.4-r2.ebuild
new file mode 100644
index 00000000000..a6882bd1903
--- /dev/null
+++ b/dev-python/dicttoxml/dicttoxml-1.7.4-r2.ebuild
@@ -0,0 +1,22 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( pypy3 python3_{8..10} )
+DISTUTILS_USE_SETUPTOOLS=no
+
+inherit distutils-r1
+
+DESCRIPTION="Converts a Python dictionary or other data type to a valid XML string"
+HOMEPAGE="https://github.com/quandyfactory/dicttoxml https://pypi.org/project/dicttoxml/"
+SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+
+PATCHES=(
+	# https://github.com/quandyfactory/dicttoxml/pull/73/files
+	"${FILESDIR}/${P}-py3.10.patch"
+)

diff --git a/dev-python/dicttoxml/files/dicttoxml-1.7.4-py3.10.patch b/dev-python/dicttoxml/files/dicttoxml-1.7.4-py3.10.patch
new file mode 100644
index 00000000000..5b3fe172949
--- /dev/null
+++ b/dev-python/dicttoxml/files/dicttoxml-1.7.4-py3.10.patch
@@ -0,0 +1,58 @@
+From 2b7b4522b7255fbc8f1e04304d2e440d333909d5 Mon Sep 17 00:00:00 2001
+From: Kier von Konigslow <kvonkonigslow@gmail.com>
+Date: Sat, 28 Dec 2019 14:08:46 -0500
+Subject: [PATCH] Fix deprecation with collections abc
+
+---
+ dicttoxml.py | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/dicttoxml.py b/dicttoxml.py
+index ae1384a..5d2dd54 100755
+--- a/dicttoxml.py
++++ b/dicttoxml.py
+@@ -15,7 +15,7 @@
+ version = __version__
+ 
+ from random import randint
+-import collections
++import collections.abc
+ import numbers
+ import logging
+ from xml.dom.minidom import parseString
+@@ -96,7 +96,7 @@ def get_xml_type(val):
+         return 'null'
+     if isinstance(val, dict):
+         return 'dict'
+-    if isinstance(val, collections.Iterable):
++    if isinstance(val, collections.abc.Iterable):
+         return 'list'
+     return type(val).__name__
+ 
+@@ -188,7 +188,7 @@ def convert(obj, ids, attr_type, item_func, cdata, parent='root'):
+     if isinstance(obj, dict):
+         return convert_dict(obj, ids, parent, attr_type, item_func, cdata)
+         
+-    if isinstance(obj, collections.Iterable):
++    if isinstance(obj, collections.abc.Iterable):
+         return convert_list(obj, ids, parent, attr_type, item_func, cdata)
+         
+     raise TypeError('Unsupported data type: %s (%s)' % (obj, type(obj).__name__))
+@@ -232,7 +232,7 @@ def convert_dict(obj, ids, parent, attr_type, item_func, cdata):
+                 )
+             )
+ 
+-        elif isinstance(val, collections.Iterable):
++        elif isinstance(val, collections.abc.Iterable):
+             if attr_type:
+                 attr['type'] = get_xml_type(val)
+             addline('<%s%s>%s</%s>' % (
+@@ -295,7 +295,7 @@ def convert_list(items, ids, parent, attr_type, item_func, cdata):
+                     )
+                 )
+ 
+-        elif isinstance(item, collections.Iterable):
++        elif isinstance(item, collections.abc.Iterable):
+             if not attr_type:
+                 addline('<%s %s>%s</%s>' % (
+                     item_name, make_attrstring(attr), 


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

only message in thread, other threads:[~2021-08-23 22:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-23 22:46 [gentoo-commits] repo/gentoo:master commit in: dev-python/dicttoxml/, dev-python/dicttoxml/files/ Louis Sautier

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