summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2021-09-19 17:40:59 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2021-09-19 17:40:59 +0300
commit9fe7f989a992d29796ede77a9b7d73bc25be804f (patch)
tree536203e3c6b2f62eb0b5e3881adcaf96bc14659f
parentapp-emulation/wine-vanilla: remove unused patch(es) (diff)
downloadgentoo-9fe7f989a992d29796ede77a9b7d73bc25be804f.tar.gz
gentoo-9fe7f989a992d29796ede77a9b7d73bc25be804f.tar.bz2
gentoo-9fe7f989a992d29796ede77a9b7d73bc25be804f.zip
dev-python/genshi: enable py3.10
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
-rw-r--r--dev-python/genshi/files/genshi-0.7.5-fix-py3.10.patch233
-rw-r--r--dev-python/genshi/genshi-0.7.5.ebuild6
2 files changed, 238 insertions, 1 deletions
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
new file mode 100644
index 00000000000..fea4e6434b2
--- /dev/null
+++ b/dev-python/genshi/files/genshi-0.7.5-fix-py3.10.patch
@@ -0,0 +1,233 @@
+From: Felix Schwarz <felix.schwarz@oss.schwarz.eu>
+https://github.com/edgewall/genshi/pull/49
+
+--- a/genshi/util.py
++++ b/genshi/util.py
+@@ -119,7 +119,6 @@ def _insert_item(self, item):
+
+ def _manage_size(self):
+ while len(self._dict) > self.capacity:
+- olditem = self._dict[self.tail.key]
+ del self._dict[self.tail.key]
+ if self.tail != self.head:
+ self.tail = self.tail.prv
+
+--- a/genshi/core.py
++++ b/genshi/core.py
+@@ -20,7 +20,8 @@
+
+ import six
+
+-from genshi.util import plaintext, stripentities, striptags, stringrepr
++from genshi.compat import stringrepr
++from genshi.util import stripentities, striptags
+
+ __all__ = ['Stream', 'Markup', 'escape', 'unescape', 'Attrs', 'Namespace',
+ 'QName']
+--- a/genshi/filters/tests/i18n.py
++++ b/genshi/filters/tests/i18n.py
+@@ -12,7 +12,6 @@
+ # history and logs, available at http://genshi.edgewall.org/log/.
+
+ from datetime import datetime
+-import doctest
+ from gettext import NullTranslations
+ import unittest
+
+--- a/genshi/filters/tests/test_html.py
++++ b/genshi/filters/tests/test_html.py
+@@ -11,7 +11,6 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://genshi.edgewall.org/log/.
+
+-import doctest
+ import unittest
+
+ import six
+--- a/genshi/filters/tests/transform.py
++++ b/genshi/filters/tests/transform.py
+@@ -12,7 +12,6 @@
+ # history and logs, available at http://genshi.edgewall.org/log/.
+
+ import doctest
+-from pprint import pprint
+ import unittest
+
+ import six
+--- a/genshi/input.py
++++ b/genshi/input.py
+@@ -22,8 +22,6 @@
+ import six
+ from six.moves import html_entities as entities, html_parser as html
+
+-import six
+-
+ from genshi.core import Attrs, QName, Stream, stripentities
+ from genshi.core import START, END, XML_DECL, DOCTYPE, TEXT, START_NS, \
+ END_NS, START_CDATA, END_CDATA, PI, COMMENT
+--- a/genshi/output.py
++++ b/genshi/output.py
+@@ -20,7 +20,7 @@
+
+ import six
+
+-from genshi.core import escape, Attrs, Markup, Namespace, QName, StreamEventKind
++from genshi.core import escape, Attrs, Markup, QName, StreamEventKind
+ from genshi.core import START, END, TEXT, XML_DECL, DOCTYPE, START_NS, END_NS, \
+ START_CDATA, END_CDATA, PI, COMMENT, XML_NAMESPACE
+
+--- a/genshi/template/base.py
++++ b/genshi/template/base.py
+@@ -15,7 +15,6 @@
+
+ from collections import deque
+ import os
+-import sys
+
+ import six
+
+--- a/genshi/template/directives.py
++++ b/genshi/template/directives.py
+@@ -19,8 +19,7 @@
+ from genshi.path import Path
+ from genshi.template.base import TemplateRuntimeError, TemplateSyntaxError, \
+ EXPR, _apply_directives, _eval_expr
+-from genshi.template.eval import Expression, ExpressionASTTransformer, \
+- _ast, _parse
++from genshi.template.eval import Expression, _ast, _parse
+
+ __all__ = ['AttrsDirective', 'ChooseDirective', 'ContentDirective',
+ 'DefDirective', 'ForDirective', 'IfDirective', 'MatchDirective',
+--- a/genshi/template/interpolation.py
++++ b/genshi/template/interpolation.py
+@@ -16,7 +16,6 @@
+ """
+
+ from itertools import chain
+-import os
+ import re
+ from tokenize import PseudoToken
+
+--- a/genshi/template/markup.py
++++ b/genshi/template/markup.py
+@@ -15,7 +15,7 @@
+
+ from itertools import chain
+
+-from genshi.core import Attrs, Markup, Namespace, Stream, StreamEventKind
++from genshi.core import Attrs, Markup, Namespace, Stream
+ from genshi.core import START, END, START_NS, END_NS, TEXT, PI, COMMENT
+ from genshi.input import XMLParser
+ from genshi.template.base import BadDirectiveError, Template, \
+--- a/genshi/template/text.py
++++ b/genshi/template/text.py
+@@ -35,7 +35,6 @@
+ TemplateSyntaxError, EXEC, INCLUDE, SUB
+ from genshi.template.eval import Suite
+ from genshi.template.directives import *
+-from genshi.template.directives import Directive
+ from genshi.template.interpolation import interpolate
+
+ __all__ = ['NewTextTemplate', 'OldTextTemplate', 'TextTemplate']
+--- a/genshi/tests/core.py
++++ b/genshi/tests/core.py
+@@ -11,13 +11,12 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://genshi.edgewall.org/log/.
+
+-import doctest
+ import pickle
+ import unittest
+
+ from genshi import core
+ from genshi.core import Markup, Attrs, Namespace, QName, escape, unescape
+-from genshi.input import XML, ParseError
++from genshi.input import XML
+ from genshi.compat import StringIO, BytesIO, IS_PYTHON2
+ from genshi.tests.test_utils import doctest_suite
+
+--- a/genshi/tests/input.py
++++ b/genshi/tests/input.py
+@@ -11,8 +11,6 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://genshi.edgewall.org/log/.
+
+-import doctest
+-import sys
+ import unittest
+
+ from genshi.core import Attrs, Stream
+--- a/genshi/tests/output.py
++++ b/genshi/tests/output.py
+@@ -11,9 +11,7 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://genshi.edgewall.org/log/.
+
+-import doctest
+ import unittest
+-import sys
+
+ from genshi.core import Attrs, Markup, QName, Stream
+ from genshi.input import HTML, XML
+--- a/genshi/tests/path.py
++++ b/genshi/tests/path.py
+@@ -11,7 +11,6 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://genshi.edgewall.org/log/.
+
+-import doctest
+ import unittest
+
+ from genshi.core import Attrs, QName
+--- a/genshi/tests/util.py
++++ b/genshi/tests/util.py
+@@ -11,7 +11,6 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://genshi.edgewall.org/log/.
+
+-import doctest
+ import unittest
+
+ from genshi import util
+--- a/genshi/util.py
++++ b/genshi/util.py
+@@ -19,8 +19,6 @@
+
+ import six
+
+-from .compat import stringrepr
+-
+ __docformat__ = 'restructuredtext en'
+
+
+--- a/setup.py
++++ b/setup.py
+@@ -12,11 +12,8 @@
+ # individuals. For the exact contribution history, see the revision
+ # history and logs, available at http://genshi.edgewall.org/log/.
+
+-from distutils.cmd import Command
+ from distutils.command.build_ext import build_ext
+ from distutils.errors import CCompilerError, DistutilsPlatformError
+-import doctest
+-from glob import glob
+ import os
+ try:
+ from setuptools import setup, Extension
+
+--- a/genshi/compat.py
++++ b/genshi/compat.py
+@@ -99,6 +99,13 @@ def get_code_params(code):
+
+
+ def build_code_chunk(code, filename, name, lineno):
++ if hasattr(code, 'replace'):
++ # Python 3.8+
++ return code.replace(
++ co_filename=filename,
++ co_name=name,
++ co_firstlineno=lineno,
++ )
+ params = [0, code.co_nlocals, code.co_kwonlyargcount,
+ code.co_stacksize, code.co_flags | 0x0040,
+ code.co_code, code.co_consts, code.co_names,
diff --git a/dev-python/genshi/genshi-0.7.5.ebuild b/dev-python/genshi/genshi-0.7.5.ebuild
index 63016f30c15..113fce0e118 100644
--- a/dev-python/genshi/genshi-0.7.5.ebuild
+++ b/dev-python/genshi/genshi-0.7.5.ebuild
@@ -3,7 +3,7 @@
EAPI=7
-PYTHON_COMPAT=( python3_{7..9} pypy3 )
+PYTHON_COMPAT=( python3_{8..10} pypy3 )
inherit distutils-r1
DESCRIPTION="Python toolkit for stream-based generation of output for the web"
@@ -22,6 +22,10 @@ BDEPEND="
distutils_enable_tests setup.py
+PATCHES=(
+ "${FILESDIR}/${P}-fix-py3.10.patch"
+)
+
python_install_all() {
if use doc; then
dodoc doc/*.txt