public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/oauth2client/files/, dev-python/oauth2client/
@ 2020-05-07  1:38 Patrick McLean
  0 siblings, 0 replies; only message in thread
From: Patrick McLean @ 2020-05-07  1:38 UTC (permalink / raw
  To: gentoo-commits

commit:     c5b2eb834ba0438d8333ef158be3bc19bffcd757
Author:     Patrick McLean <patrick.mclean <AT> sony <DOT> com>
AuthorDate: Thu May  7 01:33:32 2020 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Thu May  7 01:33:32 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c5b2eb83

dev-python/oauth2client-4.1.3-r1: revbump, EAPI=7, add py38

Copyright: Sony Interactive Entertainment Inc.
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 .../files/oauth2client-4.1.3-py38.patch            | 35 +++++++++++++
 .../oauth2client/oauth2client-4.1.3-r1.ebuild      | 61 ++++++++++++++++++++++
 2 files changed, 96 insertions(+)

diff --git a/dev-python/oauth2client/files/oauth2client-4.1.3-py38.patch b/dev-python/oauth2client/files/oauth2client-4.1.3-py38.patch
new file mode 100644
index 00000000000..d0898c02036
--- /dev/null
+++ b/dev-python/oauth2client/files/oauth2client-4.1.3-py38.patch
@@ -0,0 +1,35 @@
+diff --git a/oauth2client/contrib/xsrfutil.py b/oauth2client/contrib/xsrfutil.py
+index 7c3ec03..20f35c9 100644
+--- a/oauth2client/contrib/xsrfutil.py
++++ b/oauth2client/contrib/xsrfutil.py
+@@ -44,7 +44,7 @@ def generate_token(key, user_id, action_id='', when=None):
+     Returns:
+         A string XSRF protection token.
+     """
+-    digester = hmac.new(_helpers._to_bytes(key, encoding='utf-8'))
++    digester = hmac.new(_helpers._to_bytes(key, encoding='utf-8'), digestmod='MD5')
+     digester.update(_helpers._to_bytes(str(user_id), encoding='utf-8'))
+     digester.update(DELIMITER)
+     digester.update(_helpers._to_bytes(action_id, encoding='utf-8'))
+diff --git a/tests/contrib/test_xsrfutil.py b/tests/contrib/test_xsrfutil.py
+index 3115827..deae568 100644
+--- a/tests/contrib/test_xsrfutil.py
++++ b/tests/contrib/test_xsrfutil.py
+@@ -54,7 +54,7 @@ class Test_generate_token(unittest.TestCase):
+                                             TEST_USER_ID_1,
+                                             action_id=TEST_ACTION_ID_1,
+                                             when=TEST_TIME)
+-            hmac.new.assert_called_once_with(TEST_KEY)
++            hmac.new.assert_called_once_with(TEST_KEY, digestmod='MD5')
+             digester.digest.assert_called_once_with()
+ 
+             expected_digest_calls = [
+@@ -87,7 +87,7 @@ class Test_generate_token(unittest.TestCase):
+                                                 TEST_USER_ID_1,
+                                                 action_id=TEST_ACTION_ID_1)
+ 
+-                hmac.new.assert_called_once_with(TEST_KEY)
++                hmac.new.assert_called_once_with(TEST_KEY, digestmod='MD5')
+                 time.time.assert_called_once_with()
+                 digester.digest.assert_called_once_with()
+ 

diff --git a/dev-python/oauth2client/oauth2client-4.1.3-r1.ebuild b/dev-python/oauth2client/oauth2client-4.1.3-r1.ebuild
new file mode 100644
index 00000000000..36afd8a2e56
--- /dev/null
+++ b/dev-python/oauth2client/oauth2client-4.1.3-r1.ebuild
@@ -0,0 +1,61 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{6,7,8} )
+
+inherit distutils-r1
+
+DESCRIPTION="Library for accessing resources protected by OAuth 2.0"
+HOMEPAGE="https://github.com/google/oauth2client"
+SRC_URI="https://github.com/google/oauth2client/archive/v${PV/_p/-post}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}"/${P/_p/-post}
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="|| ( $(python_gen_useflags 'python*') )"
+
+RDEPEND="
+	>=dev-python/httplib2-0.9.1[${PYTHON_USEDEP}]
+	>=dev-python/pyasn1-0.1.7[${PYTHON_USEDEP}]
+	>=dev-python/pyasn1-modules-0.0.5[${PYTHON_USEDEP}]
+	>=dev-python/rsa-3.1.4[${PYTHON_USEDEP}]
+	>=dev-python/six-1.6.1[${PYTHON_USEDEP}]
+	dev-python/keyring[${PYTHON_USEDEP}]
+	!<=dev-python/google-api-python-client-1.1[${PYTHON_USEDEP}]
+"
+BDEPEND="${RDEPEND}
+	dev-python/setuptools[${PYTHON_USEDEP}]
+	test? ( ${RDEPEND}
+		dev-python/sqlalchemy[${PYTHON_USEDEP}]
+	)
+"
+
+PATCHES=(
+	"${FILESDIR}/oauth2client-4.1.3-py38.patch"
+)
+
+python_prepare() {
+	# keyring is not fuly supported by pypy yet, because dbus-python can't support pypy
+	# oauth2client -> keyring -> secretstorage -> dbus-python
+	# https://github.com/mitya57/secretstorage/issues/10
+	case $PYTHON in
+		pypy|*pypy|*pypy3|pypy3) \
+			find "${BUILD_DIR}/.." -name '*keyring*py' -delete ;;
+	esac
+}
+
+python_test() {
+	nosetests -v \
+		-e appengine \
+		-e django_util \
+		-e test_multiprocess_file_storage \
+		-e test_bad_positional || die "tests fail with ${EPYTHON}"
+	# appengine - requires appengine
+	# django_util - requires django
+	# test_multiprocess_file_storage - requires fasteners
+	# test_bad_positional - expects TypeError, gets ValueError
+}


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-07  1:38 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-07  1:38 [gentoo-commits] repo/gentoo:master commit in: dev-python/oauth2client/files/, dev-python/oauth2client/ Patrick McLean

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox