1 |
commit: c5b2eb834ba0438d8333ef158be3bc19bffcd757 |
2 |
Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com> |
3 |
AuthorDate: Thu May 7 01:33:32 2020 +0000 |
4 |
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 7 01:33:32 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5b2eb83 |
7 |
|
8 |
dev-python/oauth2client-4.1.3-r1: revbump, EAPI=7, add py38 |
9 |
|
10 |
Copyright: Sony Interactive Entertainment Inc. |
11 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
12 |
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org> |
13 |
|
14 |
.../files/oauth2client-4.1.3-py38.patch | 35 +++++++++++++ |
15 |
.../oauth2client/oauth2client-4.1.3-r1.ebuild | 61 ++++++++++++++++++++++ |
16 |
2 files changed, 96 insertions(+) |
17 |
|
18 |
diff --git a/dev-python/oauth2client/files/oauth2client-4.1.3-py38.patch b/dev-python/oauth2client/files/oauth2client-4.1.3-py38.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..d0898c02036 |
21 |
--- /dev/null |
22 |
+++ b/dev-python/oauth2client/files/oauth2client-4.1.3-py38.patch |
23 |
@@ -0,0 +1,35 @@ |
24 |
+diff --git a/oauth2client/contrib/xsrfutil.py b/oauth2client/contrib/xsrfutil.py |
25 |
+index 7c3ec03..20f35c9 100644 |
26 |
+--- a/oauth2client/contrib/xsrfutil.py |
27 |
++++ b/oauth2client/contrib/xsrfutil.py |
28 |
+@@ -44,7 +44,7 @@ def generate_token(key, user_id, action_id='', when=None): |
29 |
+ Returns: |
30 |
+ A string XSRF protection token. |
31 |
+ """ |
32 |
+- digester = hmac.new(_helpers._to_bytes(key, encoding='utf-8')) |
33 |
++ digester = hmac.new(_helpers._to_bytes(key, encoding='utf-8'), digestmod='MD5') |
34 |
+ digester.update(_helpers._to_bytes(str(user_id), encoding='utf-8')) |
35 |
+ digester.update(DELIMITER) |
36 |
+ digester.update(_helpers._to_bytes(action_id, encoding='utf-8')) |
37 |
+diff --git a/tests/contrib/test_xsrfutil.py b/tests/contrib/test_xsrfutil.py |
38 |
+index 3115827..deae568 100644 |
39 |
+--- a/tests/contrib/test_xsrfutil.py |
40 |
++++ b/tests/contrib/test_xsrfutil.py |
41 |
+@@ -54,7 +54,7 @@ class Test_generate_token(unittest.TestCase): |
42 |
+ TEST_USER_ID_1, |
43 |
+ action_id=TEST_ACTION_ID_1, |
44 |
+ when=TEST_TIME) |
45 |
+- hmac.new.assert_called_once_with(TEST_KEY) |
46 |
++ hmac.new.assert_called_once_with(TEST_KEY, digestmod='MD5') |
47 |
+ digester.digest.assert_called_once_with() |
48 |
+ |
49 |
+ expected_digest_calls = [ |
50 |
+@@ -87,7 +87,7 @@ class Test_generate_token(unittest.TestCase): |
51 |
+ TEST_USER_ID_1, |
52 |
+ action_id=TEST_ACTION_ID_1) |
53 |
+ |
54 |
+- hmac.new.assert_called_once_with(TEST_KEY) |
55 |
++ hmac.new.assert_called_once_with(TEST_KEY, digestmod='MD5') |
56 |
+ time.time.assert_called_once_with() |
57 |
+ digester.digest.assert_called_once_with() |
58 |
+ |
59 |
|
60 |
diff --git a/dev-python/oauth2client/oauth2client-4.1.3-r1.ebuild b/dev-python/oauth2client/oauth2client-4.1.3-r1.ebuild |
61 |
new file mode 100644 |
62 |
index 00000000000..36afd8a2e56 |
63 |
--- /dev/null |
64 |
+++ b/dev-python/oauth2client/oauth2client-4.1.3-r1.ebuild |
65 |
@@ -0,0 +1,61 @@ |
66 |
+# Copyright 1999-2020 Gentoo Authors |
67 |
+# Distributed under the terms of the GNU General Public License v2 |
68 |
+ |
69 |
+EAPI=7 |
70 |
+PYTHON_COMPAT=( python3_{6,7,8} ) |
71 |
+ |
72 |
+inherit distutils-r1 |
73 |
+ |
74 |
+DESCRIPTION="Library for accessing resources protected by OAuth 2.0" |
75 |
+HOMEPAGE="https://github.com/google/oauth2client" |
76 |
+SRC_URI="https://github.com/google/oauth2client/archive/v${PV/_p/-post}.tar.gz -> ${P}.tar.gz" |
77 |
+S="${WORKDIR}"/${P/_p/-post} |
78 |
+ |
79 |
+LICENSE="Apache-2.0" |
80 |
+SLOT="0" |
81 |
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux" |
82 |
+IUSE="test" |
83 |
+RESTRICT="!test? ( test )" |
84 |
+REQUIRED_USE="|| ( $(python_gen_useflags 'python*') )" |
85 |
+ |
86 |
+RDEPEND=" |
87 |
+ >=dev-python/httplib2-0.9.1[${PYTHON_USEDEP}] |
88 |
+ >=dev-python/pyasn1-0.1.7[${PYTHON_USEDEP}] |
89 |
+ >=dev-python/pyasn1-modules-0.0.5[${PYTHON_USEDEP}] |
90 |
+ >=dev-python/rsa-3.1.4[${PYTHON_USEDEP}] |
91 |
+ >=dev-python/six-1.6.1[${PYTHON_USEDEP}] |
92 |
+ dev-python/keyring[${PYTHON_USEDEP}] |
93 |
+ !<=dev-python/google-api-python-client-1.1[${PYTHON_USEDEP}] |
94 |
+" |
95 |
+BDEPEND="${RDEPEND} |
96 |
+ dev-python/setuptools[${PYTHON_USEDEP}] |
97 |
+ test? ( ${RDEPEND} |
98 |
+ dev-python/sqlalchemy[${PYTHON_USEDEP}] |
99 |
+ ) |
100 |
+" |
101 |
+ |
102 |
+PATCHES=( |
103 |
+ "${FILESDIR}/oauth2client-4.1.3-py38.patch" |
104 |
+) |
105 |
+ |
106 |
+python_prepare() { |
107 |
+ # keyring is not fuly supported by pypy yet, because dbus-python can't support pypy |
108 |
+ # oauth2client -> keyring -> secretstorage -> dbus-python |
109 |
+ # https://github.com/mitya57/secretstorage/issues/10 |
110 |
+ case $PYTHON in |
111 |
+ pypy|*pypy|*pypy3|pypy3) \ |
112 |
+ find "${BUILD_DIR}/.." -name '*keyring*py' -delete ;; |
113 |
+ esac |
114 |
+} |
115 |
+ |
116 |
+python_test() { |
117 |
+ nosetests -v \ |
118 |
+ -e appengine \ |
119 |
+ -e django_util \ |
120 |
+ -e test_multiprocess_file_storage \ |
121 |
+ -e test_bad_positional || die "tests fail with ${EPYTHON}" |
122 |
+ # appengine - requires appengine |
123 |
+ # django_util - requires django |
124 |
+ # test_multiprocess_file_storage - requires fasteners |
125 |
+ # test_bad_positional - expects TypeError, gets ValueError |
126 |
+} |