Date: Sunday, July 29, 2018 @ 15:20:13 Author: heftig Revision: 364833
2.3.0-2: python 3.7 Added: apache-libcloud/trunk/py3.7.diff Modified: apache-libcloud/trunk/PKGBUILD ------------+ PKGBUILD | 9 +++- py3.7.diff | 109 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2018-07-29 15:17:36 UTC (rev 364832) +++ PKGBUILD 2018-07-29 15:20:13 UTC (rev 364833) @@ -7,7 +7,7 @@ pkgbase=apache-libcloud pkgname=('python-apache-libcloud' 'python2-apache-libcloud') pkgver=2.3.0 -pkgrel=1 +pkgrel=2 pkgdesc="Apache Libcloud is a standard Python library that abstracts away differences among multiple cloud provider APIs" arch=('any') url="https://libcloud.apache.org" @@ -15,10 +15,13 @@ makedepends=('python-setuptools' 'python2-setuptools' 'python-requests' 'python2-requests') checkdepends=('python-mock' 'python2-mock' 'python-pytest-runner' 'python2-pytest-runner' 'openssh' 'python-requests-mock' 'python2-requests-mock') -source=("https://pypi.io/packages/source/a/apache-libcloud/apache-libcloud-${pkgver}.tar.gz") -sha512sums=('3c77b0261a9386af7b215f354126d0f3189209eeab3cac8e02eabddcb36ccc979159e148854bf0118ba2d8b9fa5bf57f493b144b860b1809c9aeff9efb0161a5') +source=("https://pypi.io/packages/source/a/apache-libcloud/apache-libcloud-${pkgver}.tar.gz" + py3.7.diff) +sha512sums=('3c77b0261a9386af7b215f354126d0f3189209eeab3cac8e02eabddcb36ccc979159e148854bf0118ba2d8b9fa5bf57f493b144b860b1809c9aeff9efb0161a5' + '080da5aab7ca75c0041dab927526921cb4ebcbb9fdd4a8bf35baca214a378f962c3a9ba7ea55b262ffb4ff2d02b84fddee3483cdaa7c869d386cc24e2834cd71') prepare() { + patch -d apache-libcloud-$pkgver -p1 < py3.7.diff cp -a apache-libcloud-$pkgver{,-py2} } Added: py3.7.diff =================================================================== --- py3.7.diff (rev 0) +++ py3.7.diff 2018-07-29 15:20:13 UTC (rev 364833) @@ -0,0 +1,109 @@ +diff -u -r apache-libcloud-2.3.0/libcloud/common/dimensiondata.py apache-libcloud-2.3.0-py3.7/libcloud/common/dimensiondata.py +--- apache-libcloud-2.3.0/libcloud/common/dimensiondata.py 2017-04-11 00:03:27.000000000 +0200 ++++ apache-libcloud-2.3.0-py3.7/libcloud/common/dimensiondata.py 2018-07-29 17:14:21.030942695 +0200 +@@ -526,7 +526,7 @@ + method).object + yield resp + if len(resp) <= 0: +- raise StopIteration ++ return + + pcount = resp.get('pageCount') # pylint: disable=no-member + psize = resp.get('pageSize') # pylint: disable=no-member +diff -u -r apache-libcloud-2.3.0/libcloud/compute/drivers/azure.py apache-libcloud-2.3.0-py3.7/libcloud/compute/drivers/azure.py +--- apache-libcloud-2.3.0/libcloud/compute/drivers/azure.py 2017-04-24 04:18:37.000000000 +0200 ++++ apache-libcloud-2.3.0-py3.7/libcloud/compute/drivers/azure.py 2018-07-29 17:14:21.034276037 +0200 +@@ -1435,7 +1435,7 @@ + + return response + +- def _perform_post(self, path, body, response_type=None, async=False): ++ def _perform_post(self, path, body, response_type=None, is_async=False): + request = AzureHTTPRequest() + request.method = 'POST' + request.host = AZURE_SERVICE_MANAGEMENT_HOST +@@ -1447,7 +1447,7 @@ + + return response + +- def _perform_put(self, path, body, response_type=None, async=False): ++ def _perform_put(self, path, body, response_type=None, is_async=False): + request = AzureHTTPRequest() + request.method = 'PUT' + request.host = AZURE_SERVICE_MANAGEMENT_HOST +@@ -1459,7 +1459,7 @@ + + return response + +- def _perform_delete(self, path, async=False): ++ def _perform_delete(self, path, is_async=False): + request = AzureHTTPRequest() + request.method = 'DELETE' + request.host = AZURE_SERVICE_MANAGEMENT_HOST +@@ -1470,7 +1470,7 @@ + + self.raise_for_response(response, 202) + +- if async: ++ if is_async: + return self._parse_response_for_async_op(response) + + def _perform_request(self, request): +diff -u -r apache-libcloud-2.3.0/libcloud/storage/drivers/dummy.py apache-libcloud-2.3.0-py3.7/libcloud/storage/drivers/dummy.py +--- apache-libcloud-2.3.0/libcloud/storage/drivers/dummy.py 2017-04-11 00:03:27.000000000 +0200 ++++ apache-libcloud-2.3.0-py3.7/libcloud/storage/drivers/dummy.py 2018-07-29 17:14:21.034276037 +0200 +@@ -44,8 +44,6 @@ + yield self._get_chunk(self._chunk_len) + i += 1 + +- raise StopIteration +- + def _get_chunk(self, chunk_len): + chunk = [str(x) for x in random.randint(97, 120)] + return chunk +diff -u -r apache-libcloud-2.3.0/libcloud/utils/py3.py apache-libcloud-2.3.0-py3.7/libcloud/utils/py3.py +--- apache-libcloud-2.3.0/libcloud/utils/py3.py 2018-02-02 08:53:42.000000000 +0100 ++++ apache-libcloud-2.3.0-py3.7/libcloud/utils/py3.py 2018-07-29 17:15:20.421118700 +0200 +@@ -42,6 +42,7 @@ + PY2 = False + PY27 = False + PY3 = False ++PY37 = False + + if sys.version_info >= (2, 0) and sys.version_info < (3, 0): + PY2 = True +@@ -52,6 +53,9 @@ + if sys.version_info >= (3, 0): + PY3 = True + ++if sys.version_info >= (3, 7): ++ PY37 = True ++ + if PY2_pre_279: + try: + from backports.ssl_match_hostname import match_hostname, CertificateError # NOQA +@@ -71,7 +75,7 @@ + import urllib.parse as urlparse + import xmlrpc.client as xmlrpclib + +- from urllib.parse import quote as urlquote ++ from urllib.parse import quote as _urlquote + from urllib.parse import unquote as urlunquote + from urllib.parse import urlencode as urlencode + from os.path import relpath +@@ -124,6 +128,15 @@ + def tostring(node): + return ET.tostring(node, encoding='unicode') + ++ if PY37: ++ def urlquote(s, safe='/'): ++ res = _urlquote(s, safe) ++ if '~' not in safe: ++ res = res.replace('~', '%7E') ++ return res ++ else: ++ urlquote = _urlquote ++ + def hexadigits(s): + # s needs to be a byte string. + return [format(x, "x") for x in s]