dev-python/gcs-oauth2-boto-plugin: version bump to 1.13

This commit is contained in:
Mike Frysinger
2016-06-14 23:55:32 -04:00
parent 98a1065abb
commit 28ab49214e
4 changed files with 127 additions and 0 deletions

View File

@@ -1,3 +1,4 @@
DIST gcs-oauth2-boto-plugin-1.12.tar.gz 14601 SHA256 4d35958f3724d6632f91a70acb3761c3860425ea6438c001e7e6b94d1431ad23 SHA512 998bc3187ef1483d8301f952dd68daf1dabf5775c7c948a18bdec1ed1c0ecacc336d8a0b4401e93f10e7d2b70a2fd4675c2c9d8f077fed5f126ee334e966ca19 WHIRLPOOL 48bda2622963b93b3d87abd2c3744ca9a21ba1e9f574b0a29c02e1de7379f4f4af35612b89cfcce60e09ee629960f2491347b11f7cfe26b6ae4d5199c2783af1
DIST gcs-oauth2-boto-plugin-1.13.tar.gz 14960 SHA256 e8d583ce47f14f2975deae7139824f7756a8487ae36f4f37ad08d637f6a5afd2 SHA512 db56b040789418c5c4f546bfbf51dd00ee15e19736d8e92713fff3ab1d633d738a089b109c4051e625ed7f42cfd05f4656ab9a605fb70bd2de6e051284105e08 WHIRLPOOL a5032fd9802a5a490fb2b27cfc65e5dd2d887faef31cacdd7d81a3d8ec57577021e07385ec1552de6543eb2d036032d3eaf8317a3d5e37bb45926bebbf2bb537
DIST gcs-oauth2-boto-plugin-1.8.tar.gz 13248 SHA256 cb4f3c608c953c9f6eecbad0dd33c6a2dba283cf1cd332ceaac1a9ba8a17c64b SHA512 5504fc38d58ee68a78ee2b8e6c3757045494d000748382bc26888a65085cec08d2d137c63cb51afd1cef72d31b3f0cac5d40014548cca47c5322a67a7f1ef204 WHIRLPOOL 238ee67cdad11162abe614fad7d6eb6175a27fc132c790e17f4380373b8c8d48906e5ac361c4d3c34fbac85e851bdf6426c3660434bf809d4abca87f6cb995a9
DIST gcs-oauth2-boto-plugin-1.9.tar.gz 14625 SHA256 82e70621354a0291ff312d060fedf25f8016eb0af215d443562ac2b26f94b28d SHA512 439def0c7b78a103bd3041600e25eaede44c3aac8a161f12acd6dee98cd8404b03229df24cf4e7814d63600ca50793496a80893f1e32f8ed8ac4a2825dd07df8 WHIRLPOOL ba28ac45e909a2410f36c81ba7f5e83e9c71963b1fd4d69df7fe425d26f066ea8376cf935f6b732c57d98b7d2e770d68a2658953279f0985725970af9d206dd6

View File

@@ -0,0 +1,60 @@
https://github.com/GoogleCloudPlatform/gcs-oauth2-boto-plugin/pull/18
--- a/gcs_oauth2_boto_plugin/oauth2_client.py
+++ b/gcs_oauth2_boto_plugin/oauth2_client.py
@@ -122,7 +122,7 @@ except ImportError:
retval.token_expiry = datetime.datetime.strptime(
data['token_expiry'], EXPIRY_FORMAT)
return retval
- except KeyError, e:
+ except KeyError as e:
raise Exception('Your JSON credentials are invalid; '
'missing required entry %s.' % e[0])
# pylint: enable=protected-access
@@ -274,7 +274,7 @@ class FileSystemTokenCache(TokenCache):
flags |= os.O_BINARY
try:
- fd = os.open(cache_file, flags, 0600)
+ fd = os.open(cache_file, flags, 0o0600)
except (OSError, IOError) as e:
LOG.warning('FileSystemTokenCache.PutToken: '
'Failed to create cache file %s: %s', cache_file, e)
@@ -633,7 +633,7 @@ class OAuth2UserAccountClient(OAuth2Client):
return AccessToken(
credentials.access_token, credentials.token_expiry,
datetime_strategy=self.datetime_strategy)
- except AccessTokenRefreshError, e:
+ except AccessTokenRefreshError as e:
if 'Invalid response 403' in e.message:
# This is the most we can do at the moment to accurately detect rate
# limiting errors since they come back as 403s with no further
@@ -669,7 +669,7 @@ class OAuth2GCEClient(OAuth2Client):
http = httplib2.Http()
response, content = http.request(META_TOKEN_URI, method='GET',
body=None, headers=META_HEADERS)
- except Exception, e:
+ except Exception as e:
raise GsAccessTokenRefreshError(e)
if response.status == 200:
@@ -695,7 +695,7 @@ def _IsGCE():
# this approach, we'll avoid having to enumerate all possible non-transient
# socket errors.
return False
- except Exception, e: # pylint: disable=broad-except
+ except Exception as e: # pylint: disable=broad-except
LOG.warning("Failed to determine whether we're running on GCE, so we'll"
"assume that we aren't: %s", e)
return False
--- a/gcs_oauth2_boto_plugin/test_oauth2_client.py
+++ b/gcs_oauth2_boto_plugin/test_oauth2_client.py
@@ -248,7 +248,7 @@ class FileSystemTokenCacheTest(unittest.TestCase):
# Assert that the cache file exists and has correct permissions.
if not IS_WINDOWS:
self.assertEquals(
- 0600,
+ 0o0600,
stat.S_IMODE(os.stat(self.cache.CacheFileName(self.key)).st_mode))
def testPutGet(self):

View File

@@ -0,0 +1,13 @@
--- a/setup.py
+++ b/setup.py
@@ -36,9 +36,7 @@
'httplib2>=0.8',
'oauth2client>=1.5.2, !=2.0.*',
'pyOpenSSL>=0.13',
- # Not using 1.02 because of:
- # https://code.google.com/p/socksipy-branch/issues/detail?id=3
- 'SocksiPy-branch==1.01',
+ 'SocksiPy-branch>=1.01',
'retry_decorator>=1.0.0',
'six>=1.6.1'
]

View File

@@ -0,0 +1,53 @@
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
PYTHON_COMPAT=( python{2_7,3_4,3_5} )
inherit distutils-r1
DESCRIPTION="OAuth 2.0 plugin for Google Cloud Storage credentials in the Boto library"
HOMEPAGE="https://pypi.python.org/pypi/gcs-oauth2-boto-plugin"
SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
LICENSE="Apache-2.0"
SLOT="0"
KEYWORDS="~amd64 ~arm ~x86"
IUSE="test"
# The tests only work with py2 atm.
RESTRICT="test"
PATCHES=(
"${FILESDIR}/${PN}-1.13-use-friendy-version-checks.patch"
"${FILESDIR}/${PN}-1.13-py3.patch"
)
# Keep versions in sync with setup.py.
DEPEND="${PYTHON_DEPS}
dev-python/setuptools[${PYTHON_USEDEP}]
test? (
dev-python/freezegun[${PYTHON_USEDEP}]
)"
RDEPEND="${PYTHON_DEPS}
>=dev-python/boto-2.29.1[${PYTHON_USEDEP}]
>=dev-python/httplib2-0.8[${PYTHON_USEDEP}]
>=dev-python/oauth2client-1.5.2[${PYTHON_USEDEP}]
!=dev-python/oauth2client-2.0*
>=dev-python/pyopenssl-0.13[${PYTHON_USEDEP}]
>=dev-python/retry-decorator-1.0.0[${PYTHON_USEDEP}]
>=dev-python/PySocks-1.01[${PYTHON_USEDEP}]
>=dev-python/six-1.6.1[${PYTHON_USEDEP}]"
python_prepare_all() {
distutils-r1_python_prepare_all
sed -i \
-e '/SocksiPy-branch/d' \
setup.py || die
# Make sure the unittests aren't installed.
mv gcs_oauth2_boto_plugin/test_oauth2_client.py ./ || die
}
python_test() {
${EPYTHON} "${S}"/test_oauth2_client.py || die
}