1 |
commit: 7636ae1dea275d4302aafea4c7016917543264b8 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 2 16:25:52 2021 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 2 16:26:33 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7636ae1d |
7 |
|
8 |
dev-python/requests-toolbelt: Enable py3.10 |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
.../files/requests-toolbelt-0.9.1-py310.patch | 37 ++++++++++++++++++++++ |
13 |
.../requests-toolbelt-0.9.1.ebuild | 4 ++- |
14 |
2 files changed, 40 insertions(+), 1 deletion(-) |
15 |
|
16 |
diff --git a/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-py310.patch b/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-py310.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..182e413158c |
19 |
--- /dev/null |
20 |
+++ b/dev-python/requests-toolbelt/files/requests-toolbelt-0.9.1-py310.patch |
21 |
@@ -0,0 +1,37 @@ |
22 |
+From 7188b06330e5260be20bce8cbcf0d5ae44e34eaf Mon Sep 17 00:00:00 2001 |
23 |
+From: Jon Dufresne <jon.dufresne@×××××.com> |
24 |
+Date: Fri, 1 Feb 2019 16:30:01 -0800 |
25 |
+Subject: [PATCH] Fix collections.abc deprecation warning in downloadutils |
26 |
+ |
27 |
+Warning appears as: |
28 |
+ |
29 |
+tests/test_downloadutils.py::test_stream_response_to_specific_filename |
30 |
+ requests_toolbelt/downloadutils/stream.py:161: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working |
31 |
+ if path and isinstance(getattr(path, 'write', None), collections.Callable): |
32 |
+--- |
33 |
+ requests_toolbelt/downloadutils/stream.py | 3 +-- |
34 |
+ 1 file changed, 1 insertion(+), 2 deletions(-) |
35 |
+ |
36 |
+diff --git a/requests_toolbelt/downloadutils/stream.py b/requests_toolbelt/downloadutils/stream.py |
37 |
+index eed60a7..1d1c31b 100644 |
38 |
+--- a/requests_toolbelt/downloadutils/stream.py |
39 |
++++ b/requests_toolbelt/downloadutils/stream.py |
40 |
+@@ -1,6 +1,5 @@ |
41 |
+ # -*- coding: utf-8 -*- |
42 |
+ """Utilities for dealing with streamed requests.""" |
43 |
+-import collections |
44 |
+ import os.path |
45 |
+ import re |
46 |
+ |
47 |
+@@ -158,7 +157,7 @@ def stream_response_to_file(response, path=None, chunksize=_DEFAULT_CHUNKSIZE): |
48 |
+ pre_opened = False |
49 |
+ fd = None |
50 |
+ filename = None |
51 |
+- if path and isinstance(getattr(path, 'write', None), collections.Callable): |
52 |
++ if path and callable(getattr(path, 'write', None)): |
53 |
+ pre_opened = True |
54 |
+ fd = path |
55 |
+ filename = getattr(fd, 'name', None) |
56 |
+-- |
57 |
+2.31.1 |
58 |
+ |
59 |
|
60 |
diff --git a/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild b/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild |
61 |
index dd4056a4fc3..afbd3421e3a 100644 |
62 |
--- a/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild |
63 |
+++ b/dev-python/requests-toolbelt/requests-toolbelt-0.9.1.ebuild |
64 |
@@ -2,7 +2,7 @@ |
65 |
# Distributed under the terms of the GNU General Public License v2 |
66 |
|
67 |
EAPI=7 |
68 |
-PYTHON_COMPAT=( python3_{7..9} pypy3 ) |
69 |
+PYTHON_COMPAT=( python3_{7..10} pypy3 ) |
70 |
|
71 |
inherit distutils-r1 |
72 |
|
73 |
@@ -36,6 +36,8 @@ PATCHES=( |
74 |
|
75 |
# disable tests that require internet access |
76 |
"${FILESDIR}/requests-toolbelt-0.9.1-tests-internet.patch" |
77 |
+ |
78 |
+ "${FILESDIR}/requests-toolbelt-0.9.1-py310.patch" |
79 |
) |
80 |
|
81 |
distutils_enable_tests pytest |