commit:     dae248ff819cd6f6a36633ed1844335475fb5b91
Author:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  8 11:54:46 2021 +0000
Commit:     Louis Sautier <sbraz <AT> gentoo <DOT> org>
CommitDate: Sun Aug  8 12:02:02 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dae248ff

dev-python/pretty-yaml: enable py3.10 and disable py3.7

Signed-off-by: Louis Sautier <sbraz <AT> gentoo.org>

 .../files/pretty-yaml-20.4.0-fix-py3.10.patch      | 28 ++++++++++++++++++++++
 dev-python/pretty-yaml/pretty-yaml-20.4.0.ebuild   |  9 +++++--
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/dev-python/pretty-yaml/files/pretty-yaml-20.4.0-fix-py3.10.patch 
b/dev-python/pretty-yaml/files/pretty-yaml-20.4.0-fix-py3.10.patch
new file mode 100644
index 00000000000..c2cd44152d1
--- /dev/null
+++ b/dev-python/pretty-yaml/files/pretty-yaml-20.4.0-fix-py3.10.patch
@@ -0,0 +1,28 @@
+From 707e14bd714e91dc53295393e2c8eea257aced5a Mon Sep 17 00:00:00 2001
+From: Louis Sautier <[email protected]>
+Date: Sun, 8 Aug 2021 13:44:52 +0200
+Subject: [PATCH] Fix tests for Python 3.10: abstract base classes have moved
+
+As mentioned in the documentation:
+"Deprecated since version 3.3, will be removed in version 3.10: Moved
+Collections Abstract Base Classes to the collections.abc module. For
+backwards compatibility, they continue to be visible in this module through
+Python 3.9."
+---
+ pyaml/tests/dump.py | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/pyaml/tests/dump.py b/pyaml/tests/dump.py
+index 882a8e8..e1a93ba 100644
+--- a/pyaml/tests/dump.py
++++ b/pyaml/tests/dump.py
+@@ -2,7 +2,8 @@
+ from __future__ import unicode_literals, print_function
+ 
+ import itertools as it, operator as op, functools as ft
+-from collections import Mapping, OrderedDict, namedtuple
++from collections import OrderedDict, namedtuple
++from collections.abc import Mapping
+ import os, sys, io, yaml, unittest
+ 
+ if sys.version_info.major > 2: unicode = str

diff --git a/dev-python/pretty-yaml/pretty-yaml-20.4.0.ebuild 
b/dev-python/pretty-yaml/pretty-yaml-20.4.0.ebuild
index 13be942b018..f592bf0fbda 100644
--- a/dev-python/pretty-yaml/pretty-yaml-20.4.0.ebuild
+++ b/dev-python/pretty-yaml/pretty-yaml-20.4.0.ebuild
@@ -1,8 +1,8 @@
-# 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..9} )
+PYTHON_COMPAT=( python3_{8..10} )
 
 inherit distutils-r1
 
@@ -25,6 +25,11 @@ BDEPEND="
                dev-python/unidecode[${PYTHON_USEDEP}]
        )"
 
+PATCHES=(
+       # https://github.com/mk-fg/pretty-yaml/pull/38
+       "${FILESDIR}/${P}-fix-py3.10.patch"
+)
+
 python_test() {
        "${EPYTHON}" pyaml/tests/dump.py -v ||
                die "tests failed under ${EPYTHON}"

Reply via email to