diff options
author | Michał Górny <mgorny@gentoo.org> | 2021-06-05 14:49:14 +0200 |
---|---|---|
committer | Michał Górny <mgorny@gentoo.org> | 2021-06-05 14:55:59 +0200 |
commit | 72a54e37f2f05fa5802fc80c905c3e428af7e3ff (patch) | |
tree | 46e217cd570da4a3f0742827849acebdacf2e91c /dev-python/babelfish | |
parent | dev-python/aws-sam-translator: Enable py3.10 (diff) | |
download | gentoo-72a54e37f2f05fa5802fc80c905c3e428af7e3ff.tar.gz gentoo-72a54e37f2f05fa5802fc80c905c3e428af7e3ff.tar.bz2 gentoo-72a54e37f2f05fa5802fc80c905c3e428af7e3ff.zip |
dev-python/babelfish: Enable py3.10
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/babelfish')
-rw-r--r-- | dev-python/babelfish/babelfish-0.5.5-r1.ebuild | 8 | ||||
-rw-r--r-- | dev-python/babelfish/babelfish-9999.ebuild | 4 | ||||
-rw-r--r-- | dev-python/babelfish/files/babelfish-0.5.5-py310.patch | 51 |
3 files changed, 59 insertions, 4 deletions
diff --git a/dev-python/babelfish/babelfish-0.5.5-r1.ebuild b/dev-python/babelfish/babelfish-0.5.5-r1.ebuild index eafdce09e132..5e101e351f9b 100644 --- a/dev-python/babelfish/babelfish-0.5.5-r1.ebuild +++ b/dev-python/babelfish/babelfish-0.5.5-r1.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -PYTHON_COMPAT=( python3_{7,8,9} ) +PYTHON_COMPAT=( python3_{8..10} ) inherit distutils-r1 @@ -16,3 +16,7 @@ SLOT="0" KEYWORDS="amd64 ~arm ~arm64 x86" distutils_enable_tests setup.py + +PATCHES=( + "${FILESDIR}/${P}-py310.patch" +) diff --git a/dev-python/babelfish/babelfish-9999.ebuild b/dev-python/babelfish/babelfish-9999.ebuild index 382197499a3f..78c32c6b1e2f 100644 --- a/dev-python/babelfish/babelfish-9999.ebuild +++ b/dev-python/babelfish/babelfish-9999.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2020 Gentoo Authors +# Copyright 1999-2021 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -PYTHON_COMPAT=( python3_{7,8,9} ) +PYTHON_COMPAT=( python3_{8..10} ) inherit distutils-r1 git-r3 diff --git a/dev-python/babelfish/files/babelfish-0.5.5-py310.patch b/dev-python/babelfish/files/babelfish-0.5.5-py310.patch new file mode 100644 index 000000000000..3acd3c55132e --- /dev/null +++ b/dev-python/babelfish/files/babelfish-0.5.5-py310.patch @@ -0,0 +1,51 @@ +From 7667fb3179e421d4af78821132db8e2557fa2dc6 Mon Sep 17 00:00:00 2001 +From: Hugo <hugovk@users.noreply.github.com> +Date: Mon, 20 Jan 2020 18:14:46 +0200 +Subject: [PATCH] Fix imports for Python 3.9 + +--- + babelfish/converters/__init__.py | 13 +++++++++---- + 1 file changed, 9 insertions(+), 4 deletions(-) + +diff --git a/babelfish/converters/__init__.py b/babelfish/converters/__init__.py +index feb687b..d27f849 100644 +--- a/babelfish/converters/__init__.py ++++ b/babelfish/converters/__init__.py +@@ -2,17 +2,22 @@ + # Use of this source code is governed by the 3-clause BSD license + # that can be found in the LICENSE file. + # +-import collections + from pkg_resources import iter_entry_points, EntryPoint + from ..exceptions import LanguageConvertError, LanguageReverseError + ++try: ++ # Python 3.3+ ++ from collections.abc import Mapping, MutableMapping ++except ImportError: ++ from collections import Mapping, MutableMapping ++ + + # from https://github.com/kennethreitz/requests/blob/master/requests/structures.py +-class CaseInsensitiveDict(collections.MutableMapping): ++class CaseInsensitiveDict(MutableMapping): + """A case-insensitive ``dict``-like object. + + Implements all methods and operations of +- ``collections.MutableMapping`` as well as dict's ``copy``. Also ++ ``collections.abc.MutableMapping`` as well as dict's ``copy``. Also + provides ``lower_items``. + + All keys are expected to be strings. The structure remembers the +@@ -63,7 +68,7 @@ class CaseInsensitiveDict(collections.MutableMapping): + ) + + def __eq__(self, other): +- if isinstance(other, collections.Mapping): ++ if isinstance(other, Mapping): + other = CaseInsensitiveDict(other) + else: + return NotImplemented +-- +2.31.1 + |