1 |
commit: 69c5596e5eafc8d0ef9109e4d034a4561b71cfd2 |
2 |
Author: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Aug 23 18:27:20 2021 +0000 |
4 |
Commit: Arthur Zamarin <arthurzam <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Aug 24 18:19:27 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=69c5596e |
7 |
|
8 |
dev-python/flask-login: enable py3.10 |
9 |
|
10 |
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org> |
11 |
|
12 |
.../files/flask-login-0.5.0-fix-tests-py3.10.patch | 26 ++++++++++++++++++++++ |
13 |
dev-python/flask-login/flask-login-0.5.0.ebuild | 8 +++++-- |
14 |
2 files changed, 32 insertions(+), 2 deletions(-) |
15 |
|
16 |
diff --git a/dev-python/flask-login/files/flask-login-0.5.0-fix-tests-py3.10.patch b/dev-python/flask-login/files/flask-login-0.5.0-fix-tests-py3.10.patch |
17 |
new file mode 100644 |
18 |
index 00000000000..858783b36e7 |
19 |
--- /dev/null |
20 |
+++ b/dev-python/flask-login/files/flask-login-0.5.0-fix-tests-py3.10.patch |
21 |
@@ -0,0 +1,26 @@ |
22 |
+From: Karthikeyan Singaravelan <tir.karthi@×××××.com> |
23 |
+Date: Sun, 10 Jan 2021 21:12:36 +0530 |
24 |
+Subject: [PATCH] Import ABC from collections.abc (#525) |
25 |
+ |
26 |
+--- a/test_login.py |
27 |
++++ b/test_login.py |
28 |
+@@ -12,6 +12,10 @@ |
29 |
+ from mock import ANY, patch, Mock |
30 |
+ except ImportError: |
31 |
+ from unittest.mock import ANY, patch, Mock |
32 |
++try: |
33 |
++ from collections.abc import Hashable |
34 |
++except ImportError: |
35 |
++ from collections import Hashable |
36 |
+ from semantic_version import Version |
37 |
+ |
38 |
+ |
39 |
+@@ -1548,7 +1552,7 @@ def test_equality(self): |
40 |
+ self.assertTrue(first != u'1') |
41 |
+ |
42 |
+ def test_hashable(self): |
43 |
+- self.assertTrue(isinstance(UserMixin(), collections.Hashable)) |
44 |
++ self.assertTrue(isinstance(UserMixin(), Hashable)) |
45 |
+ |
46 |
+ |
47 |
+ class AnonymousUserTestCase(unittest.TestCase): |
48 |
|
49 |
diff --git a/dev-python/flask-login/flask-login-0.5.0.ebuild b/dev-python/flask-login/flask-login-0.5.0.ebuild |
50 |
index 3891e82cb9d..b23911bf568 100644 |
51 |
--- a/dev-python/flask-login/flask-login-0.5.0.ebuild |
52 |
+++ b/dev-python/flask-login/flask-login-0.5.0.ebuild |
53 |
@@ -3,7 +3,7 @@ |
54 |
|
55 |
EAPI=7 |
56 |
|
57 |
-PYTHON_COMPAT=( python3_{7..9} ) |
58 |
+PYTHON_COMPAT=( python3_{8..10} ) |
59 |
inherit distutils-r1 |
60 |
|
61 |
DESCRIPTION="Login session support for Flask" |
62 |
@@ -27,9 +27,13 @@ DEPEND=" |
63 |
dev-python/semantic_version[${PYTHON_USEDEP}] |
64 |
)" |
65 |
|
66 |
+PATCHES=( |
67 |
+ "${FILESDIR}/${P}-fix-tests-py3.10.patch" |
68 |
+) |
69 |
+ |
70 |
distutils_enable_sphinx docs |
71 |
distutils_enable_tests pytest |
72 |
|
73 |
python_test() { |
74 |
- pytest -vv -p no:httpbin || die "Tests failed with ${EPYTHON}" |
75 |
+ epytest -p no:httpbin |
76 |
} |