Gentoo Archives: gentoo-commits

From: Louis Sautier <sbraz@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/dicttoxml/, dev-python/dicttoxml/files/
Date: Mon, 23 Aug 2021 22:46:09
Message-Id: 1629758672.27c3aaec24b9f604673bf84e6cafb7d50d0de8fa.sbraz@gentoo
1 commit: 27c3aaec24b9f604673bf84e6cafb7d50d0de8fa
2 Author: Louis Sautier <sbraz <AT> gentoo <DOT> org>
3 AuthorDate: Mon Aug 23 22:29:51 2021 +0000
4 Commit: Louis Sautier <sbraz <AT> gentoo <DOT> org>
5 CommitDate: Mon Aug 23 22:44:32 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=27c3aaec
7
8 dev-python/dicttoxml: enable py3.10
9
10 Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>
11
12 dev-python/dicttoxml/dicttoxml-1.7.4-r2.ebuild | 22 ++++++++
13 .../dicttoxml/files/dicttoxml-1.7.4-py3.10.patch | 58 ++++++++++++++++++++++
14 2 files changed, 80 insertions(+)
15
16 diff --git a/dev-python/dicttoxml/dicttoxml-1.7.4-r2.ebuild b/dev-python/dicttoxml/dicttoxml-1.7.4-r2.ebuild
17 new file mode 100644
18 index 00000000000..a6882bd1903
19 --- /dev/null
20 +++ b/dev-python/dicttoxml/dicttoxml-1.7.4-r2.ebuild
21 @@ -0,0 +1,22 @@
22 +# Copyright 1999-2021 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=8
26 +
27 +PYTHON_COMPAT=( pypy3 python3_{8..10} )
28 +DISTUTILS_USE_SETUPTOOLS=no
29 +
30 +inherit distutils-r1
31 +
32 +DESCRIPTION="Converts a Python dictionary or other data type to a valid XML string"
33 +HOMEPAGE="https://github.com/quandyfactory/dicttoxml https://pypi.org/project/dicttoxml/"
34 +SRC_URI="mirror://pypi/${P:0:1}/${PN}/${P}.tar.gz"
35 +
36 +LICENSE="GPL-2"
37 +SLOT="0"
38 +KEYWORDS="~amd64 ~arm ~arm64 ~x86"
39 +
40 +PATCHES=(
41 + # https://github.com/quandyfactory/dicttoxml/pull/73/files
42 + "${FILESDIR}/${P}-py3.10.patch"
43 +)
44
45 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
46 new file mode 100644
47 index 00000000000..5b3fe172949
48 --- /dev/null
49 +++ b/dev-python/dicttoxml/files/dicttoxml-1.7.4-py3.10.patch
50 @@ -0,0 +1,58 @@
51 +From 2b7b4522b7255fbc8f1e04304d2e440d333909d5 Mon Sep 17 00:00:00 2001
52 +From: Kier von Konigslow <kvonkonigslow@×××××.com>
53 +Date: Sat, 28 Dec 2019 14:08:46 -0500
54 +Subject: [PATCH] Fix deprecation with collections abc
55 +
56 +---
57 + dicttoxml.py | 10 +++++-----
58 + 1 file changed, 5 insertions(+), 5 deletions(-)
59 +
60 +diff --git a/dicttoxml.py b/dicttoxml.py
61 +index ae1384a..5d2dd54 100755
62 +--- a/dicttoxml.py
63 ++++ b/dicttoxml.py
64 +@@ -15,7 +15,7 @@
65 + version = __version__
66 +
67 + from random import randint
68 +-import collections
69 ++import collections.abc
70 + import numbers
71 + import logging
72 + from xml.dom.minidom import parseString
73 +@@ -96,7 +96,7 @@ def get_xml_type(val):
74 + return 'null'
75 + if isinstance(val, dict):
76 + return 'dict'
77 +- if isinstance(val, collections.Iterable):
78 ++ if isinstance(val, collections.abc.Iterable):
79 + return 'list'
80 + return type(val).__name__
81 +
82 +@@ -188,7 +188,7 @@ def convert(obj, ids, attr_type, item_func, cdata, parent='root'):
83 + if isinstance(obj, dict):
84 + return convert_dict(obj, ids, parent, attr_type, item_func, cdata)
85 +
86 +- if isinstance(obj, collections.Iterable):
87 ++ if isinstance(obj, collections.abc.Iterable):
88 + return convert_list(obj, ids, parent, attr_type, item_func, cdata)
89 +
90 + raise TypeError('Unsupported data type: %s (%s)' % (obj, type(obj).__name__))
91 +@@ -232,7 +232,7 @@ def convert_dict(obj, ids, parent, attr_type, item_func, cdata):
92 + )
93 + )
94 +
95 +- elif isinstance(val, collections.Iterable):
96 ++ elif isinstance(val, collections.abc.Iterable):
97 + if attr_type:
98 + attr['type'] = get_xml_type(val)
99 + addline('<%s%s>%s</%s>' % (
100 +@@ -295,7 +295,7 @@ def convert_list(items, ids, parent, attr_type, item_func, cdata):
101 + )
102 + )
103 +
104 +- elif isinstance(item, collections.Iterable):
105 ++ elif isinstance(item, collections.abc.Iterable):
106 + if not attr_type:
107 + addline('<%s %s>%s</%s>' % (
108 + item_name, make_attrstring(attr),