Gentoo Archives: gentoo-commits

From: Arthur Zamarin <arthurzam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/genshi/files/, dev-python/genshi/
Date: Sun, 19 Sep 2021 14:41:50
Message-Id: 1632062459.9fe7f989a992d29796ede77a9b7d73bc25be804f.arthurzam@gentoo
1 commit: 9fe7f989a992d29796ede77a9b7d73bc25be804f
2 Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 19 14:40:59 2021 +0000
4 Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 19 14:40:59 2021 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fe7f989
7
8 dev-python/genshi: enable py3.10
9
10 Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>
11
12 .../genshi/files/genshi-0.7.5-fix-py3.10.patch | 233 +++++++++++++++++++++
13 dev-python/genshi/genshi-0.7.5.ebuild | 6 +-
14 2 files changed, 238 insertions(+), 1 deletion(-)
15
16 diff --git a/dev-python/genshi/files/genshi-0.7.5-fix-py3.10.patch b/dev-python/genshi/files/genshi-0.7.5-fix-py3.10.patch
17 new file mode 100644
18 index 00000000000..fea4e6434b2
19 --- /dev/null
20 +++ b/dev-python/genshi/files/genshi-0.7.5-fix-py3.10.patch
21 @@ -0,0 +1,233 @@
22 +From: Felix Schwarz <felix.schwarz@×××××××××××.eu>
23 +https://github.com/edgewall/genshi/pull/49
24 +
25 +--- a/genshi/util.py
26 ++++ b/genshi/util.py
27 +@@ -119,7 +119,6 @@ def _insert_item(self, item):
28 +
29 + def _manage_size(self):
30 + while len(self._dict) > self.capacity:
31 +- olditem = self._dict[self.tail.key]
32 + del self._dict[self.tail.key]
33 + if self.tail != self.head:
34 + self.tail = self.tail.prv
35 +
36 +--- a/genshi/core.py
37 ++++ b/genshi/core.py
38 +@@ -20,7 +20,8 @@
39 +
40 + import six
41 +
42 +-from genshi.util import plaintext, stripentities, striptags, stringrepr
43 ++from genshi.compat import stringrepr
44 ++from genshi.util import stripentities, striptags
45 +
46 + __all__ = ['Stream', 'Markup', 'escape', 'unescape', 'Attrs', 'Namespace',
47 + 'QName']
48 +--- a/genshi/filters/tests/i18n.py
49 ++++ b/genshi/filters/tests/i18n.py
50 +@@ -12,7 +12,6 @@
51 + # history and logs, available at http://genshi.edgewall.org/log/.
52 +
53 + from datetime import datetime
54 +-import doctest
55 + from gettext import NullTranslations
56 + import unittest
57 +
58 +--- a/genshi/filters/tests/test_html.py
59 ++++ b/genshi/filters/tests/test_html.py
60 +@@ -11,7 +11,6 @@
61 + # individuals. For the exact contribution history, see the revision
62 + # history and logs, available at http://genshi.edgewall.org/log/.
63 +
64 +-import doctest
65 + import unittest
66 +
67 + import six
68 +--- a/genshi/filters/tests/transform.py
69 ++++ b/genshi/filters/tests/transform.py
70 +@@ -12,7 +12,6 @@
71 + # history and logs, available at http://genshi.edgewall.org/log/.
72 +
73 + import doctest
74 +-from pprint import pprint
75 + import unittest
76 +
77 + import six
78 +--- a/genshi/input.py
79 ++++ b/genshi/input.py
80 +@@ -22,8 +22,6 @@
81 + import six
82 + from six.moves import html_entities as entities, html_parser as html
83 +
84 +-import six
85 +-
86 + from genshi.core import Attrs, QName, Stream, stripentities
87 + from genshi.core import START, END, XML_DECL, DOCTYPE, TEXT, START_NS, \
88 + END_NS, START_CDATA, END_CDATA, PI, COMMENT
89 +--- a/genshi/output.py
90 ++++ b/genshi/output.py
91 +@@ -20,7 +20,7 @@
92 +
93 + import six
94 +
95 +-from genshi.core import escape, Attrs, Markup, Namespace, QName, StreamEventKind
96 ++from genshi.core import escape, Attrs, Markup, QName, StreamEventKind
97 + from genshi.core import START, END, TEXT, XML_DECL, DOCTYPE, START_NS, END_NS, \
98 + START_CDATA, END_CDATA, PI, COMMENT, XML_NAMESPACE
99 +
100 +--- a/genshi/template/base.py
101 ++++ b/genshi/template/base.py
102 +@@ -15,7 +15,6 @@
103 +
104 + from collections import deque
105 + import os
106 +-import sys
107 +
108 + import six
109 +
110 +--- a/genshi/template/directives.py
111 ++++ b/genshi/template/directives.py
112 +@@ -19,8 +19,7 @@
113 + from genshi.path import Path
114 + from genshi.template.base import TemplateRuntimeError, TemplateSyntaxError, \
115 + EXPR, _apply_directives, _eval_expr
116 +-from genshi.template.eval import Expression, ExpressionASTTransformer, \
117 +- _ast, _parse
118 ++from genshi.template.eval import Expression, _ast, _parse
119 +
120 + __all__ = ['AttrsDirective', 'ChooseDirective', 'ContentDirective',
121 + 'DefDirective', 'ForDirective', 'IfDirective', 'MatchDirective',
122 +--- a/genshi/template/interpolation.py
123 ++++ b/genshi/template/interpolation.py
124 +@@ -16,7 +16,6 @@
125 + """
126 +
127 + from itertools import chain
128 +-import os
129 + import re
130 + from tokenize import PseudoToken
131 +
132 +--- a/genshi/template/markup.py
133 ++++ b/genshi/template/markup.py
134 +@@ -15,7 +15,7 @@
135 +
136 + from itertools import chain
137 +
138 +-from genshi.core import Attrs, Markup, Namespace, Stream, StreamEventKind
139 ++from genshi.core import Attrs, Markup, Namespace, Stream
140 + from genshi.core import START, END, START_NS, END_NS, TEXT, PI, COMMENT
141 + from genshi.input import XMLParser
142 + from genshi.template.base import BadDirectiveError, Template, \
143 +--- a/genshi/template/text.py
144 ++++ b/genshi/template/text.py
145 +@@ -35,7 +35,6 @@
146 + TemplateSyntaxError, EXEC, INCLUDE, SUB
147 + from genshi.template.eval import Suite
148 + from genshi.template.directives import *
149 +-from genshi.template.directives import Directive
150 + from genshi.template.interpolation import interpolate
151 +
152 + __all__ = ['NewTextTemplate', 'OldTextTemplate', 'TextTemplate']
153 +--- a/genshi/tests/core.py
154 ++++ b/genshi/tests/core.py
155 +@@ -11,13 +11,12 @@
156 + # individuals. For the exact contribution history, see the revision
157 + # history and logs, available at http://genshi.edgewall.org/log/.
158 +
159 +-import doctest
160 + import pickle
161 + import unittest
162 +
163 + from genshi import core
164 + from genshi.core import Markup, Attrs, Namespace, QName, escape, unescape
165 +-from genshi.input import XML, ParseError
166 ++from genshi.input import XML
167 + from genshi.compat import StringIO, BytesIO, IS_PYTHON2
168 + from genshi.tests.test_utils import doctest_suite
169 +
170 +--- a/genshi/tests/input.py
171 ++++ b/genshi/tests/input.py
172 +@@ -11,8 +11,6 @@
173 + # individuals. For the exact contribution history, see the revision
174 + # history and logs, available at http://genshi.edgewall.org/log/.
175 +
176 +-import doctest
177 +-import sys
178 + import unittest
179 +
180 + from genshi.core import Attrs, Stream
181 +--- a/genshi/tests/output.py
182 ++++ b/genshi/tests/output.py
183 +@@ -11,9 +11,7 @@
184 + # individuals. For the exact contribution history, see the revision
185 + # history and logs, available at http://genshi.edgewall.org/log/.
186 +
187 +-import doctest
188 + import unittest
189 +-import sys
190 +
191 + from genshi.core import Attrs, Markup, QName, Stream
192 + from genshi.input import HTML, XML
193 +--- a/genshi/tests/path.py
194 ++++ b/genshi/tests/path.py
195 +@@ -11,7 +11,6 @@
196 + # individuals. For the exact contribution history, see the revision
197 + # history and logs, available at http://genshi.edgewall.org/log/.
198 +
199 +-import doctest
200 + import unittest
201 +
202 + from genshi.core import Attrs, QName
203 +--- a/genshi/tests/util.py
204 ++++ b/genshi/tests/util.py
205 +@@ -11,7 +11,6 @@
206 + # individuals. For the exact contribution history, see the revision
207 + # history and logs, available at http://genshi.edgewall.org/log/.
208 +
209 +-import doctest
210 + import unittest
211 +
212 + from genshi import util
213 +--- a/genshi/util.py
214 ++++ b/genshi/util.py
215 +@@ -19,8 +19,6 @@
216 +
217 + import six
218 +
219 +-from .compat import stringrepr
220 +-
221 + __docformat__ = 'restructuredtext en'
222 +
223 +
224 +--- a/setup.py
225 ++++ b/setup.py
226 +@@ -12,11 +12,8 @@
227 + # individuals. For the exact contribution history, see the revision
228 + # history and logs, available at http://genshi.edgewall.org/log/.
229 +
230 +-from distutils.cmd import Command
231 + from distutils.command.build_ext import build_ext
232 + from distutils.errors import CCompilerError, DistutilsPlatformError
233 +-import doctest
234 +-from glob import glob
235 + import os
236 + try:
237 + from setuptools import setup, Extension
238 +
239 +--- a/genshi/compat.py
240 ++++ b/genshi/compat.py
241 +@@ -99,6 +99,13 @@ def get_code_params(code):
242 +
243 +
244 + def build_code_chunk(code, filename, name, lineno):
245 ++ if hasattr(code, 'replace'):
246 ++ # Python 3.8+
247 ++ return code.replace(
248 ++ co_filename=filename,
249 ++ co_name=name,
250 ++ co_firstlineno=lineno,
251 ++ )
252 + params = [0, code.co_nlocals, code.co_kwonlyargcount,
253 + code.co_stacksize, code.co_flags | 0x0040,
254 + code.co_code, code.co_consts, code.co_names,
255
256 diff --git a/dev-python/genshi/genshi-0.7.5.ebuild b/dev-python/genshi/genshi-0.7.5.ebuild
257 index 63016f30c15..113fce0e118 100644
258 --- a/dev-python/genshi/genshi-0.7.5.ebuild
259 +++ b/dev-python/genshi/genshi-0.7.5.ebuild
260 @@ -3,7 +3,7 @@
261
262 EAPI=7
263
264 -PYTHON_COMPAT=( python3_{7..9} pypy3 )
265 +PYTHON_COMPAT=( python3_{8..10} pypy3 )
266 inherit distutils-r1
267
268 DESCRIPTION="Python toolkit for stream-based generation of output for the web"
269 @@ -22,6 +22,10 @@ BDEPEND="
270
271 distutils_enable_tests setup.py
272
273 +PATCHES=(
274 + "${FILESDIR}/${P}-fix-py3.10.patch"
275 +)
276 +
277 python_install_all() {
278 if use doc; then
279 dodoc doc/*.txt