From 0201e3d987e63b15b072c3af9604604f51b3a397 Mon Sep 17 00:00:00 2001 From: Carl George Date: Jan 23 2020 23:13:13 +0000 Subject: Add patch2 for Python 3.9 compatiblity rhbz#1794276 --- diff --git a/fix-deprecated-imports-from-collections.patch b/fix-deprecated-imports-from-collections.patch new file mode 100644 index 0000000..c582d59 --- /dev/null +++ b/fix-deprecated-imports-from-collections.patch @@ -0,0 +1,29 @@ +Backported to v0.3.1 from: +https://github.com/laike9m/pdir2/commit/5d44803dca3c24eba44aac373a8e06ebacea59a5 + +diff -Nurp pdir2-0.3.1.orig/pdir/attr_category.py pdir2-0.3.1/pdir/attr_category.py +--- pdir2-0.3.1.orig/pdir/attr_category.py 2020-01-23 16:58:02.899783934 -0600 ++++ pdir2-0.3.1/pdir/attr_category.py 2020-01-23 16:58:50.576002074 -0600 +@@ -1,4 +1,4 @@ +-import collections ++import collections.abc + import functools + import inspect + from enum import IntEnum # TODO: use native Python 3 enum +@@ -71,14 +71,14 @@ ATTR_MAP = { + '__next__': (AttrCategory.ITER, AttrCategory.FUNCTION), + '__reversed__': [ + ( +- lambda obj: isinstance(obj, collections.Iterator), ++ lambda obj: isinstance(obj, collections.abc.Iterator), + (AttrCategory.ITER, AttrCategory.FUNCTION), + ), + (_always_true, (AttrCategory.CONTAINER, AttrCategory.FUNCTION)), + ], + '__iter__': [ + ( +- lambda obj: isinstance(obj, collections.Iterator), ++ lambda obj: isinstance(obj, collections.abc.Iterator), + (AttrCategory.ITER, AttrCategory.FUNCTION), + ), + (_always_true, (AttrCategory.CONTAINER, AttrCategory.FUNCTION)), diff --git a/python-pdir2.spec b/python-pdir2.spec index 8c146aa..9c03754 100644 --- a/python-pdir2.spec +++ b/python-pdir2.spec @@ -29,7 +29,7 @@ bpython, and Jupyter Notebook.} Name: python-%{pkgname} Version: 0.3.1.post2 -Release: 5%{?dist} +Release: 6%{?dist} Summary: Pretty dir() printing with joy License: MIT URL: https://github.com/laike9m/pdir2 @@ -45,6 +45,10 @@ Patch0: remove-environment-markers.patch # https://github.com/laike9m/pdir2/commit/a85a7e2fc0b60b865039d8b75c5268be5ada99c3#diff-c3d931c13b4769887b493d82966b7771 # https://github.com/laike9m/pdir2/commit/ad9fe01639bc927fc0d721469254e6fbe78fea6a Patch1: pytest-compat.patch +# Patch to fix Python 3.9 compatibility. Backported from the upstream master +# branch. +# https://github.com/laike9m/pdir2/commit/5d44803dca3c24eba44aac373a8e06ebacea59a5 +Patch2: fix-deprecated-imports-from-collections.patch BuildArch: noarch @@ -123,6 +127,9 @@ BuildRequires: python%{python3_pkgversion}-pandas %changelog +* Thu Jan 23 2020 Carl George - 0.3.1.post2-6 +- Add patch2 for Python 3.9 compatiblity rhbz#1794276 + * Thu Jan 02 2020 Carl George - 0.3.1.post2-5 - Update patch1 to add support for pytest 5