public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/genshi/files/, dev-python/genshi/
Date: Sun, 19 Sep 2021 14:41:46 +0000 (UTC)	[thread overview]
Message-ID: <1632062459.9fe7f989a992d29796ede77a9b7d73bc25be804f.arthurzam@gentoo> (raw)

commit:     9fe7f989a992d29796ede77a9b7d73bc25be804f
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 19 14:40:59 2021 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sun Sep 19 14:40:59 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9fe7f989

dev-python/genshi: enable py3.10

Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 .../genshi/files/genshi-0.7.5-fix-py3.10.patch     | 233 +++++++++++++++++++++
 dev-python/genshi/genshi-0.7.5.ebuild              |   6 +-
 2 files changed, 238 insertions(+), 1 deletion(-)

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


                 reply	other threads:[~2021-09-19 14:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1632062459.9fe7f989a992d29796ede77a9b7d73bc25be804f.arthurzam@gentoo \
    --to=arthurzam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox