diff options
Diffstat (limited to 'dev-python/google-apitools')
-rw-r--r-- | dev-python/google-apitools/Manifest | 6 | ||||
-rw-r--r-- | dev-python/google-apitools/files/google-apitools-0.5.30-abc.patch | 81 | ||||
-rw-r--r-- | dev-python/google-apitools/files/google-apitools-0.5.30-py37.patch | 144 | ||||
-rw-r--r-- | dev-python/google-apitools/google-apitools-0.5.30_p20200507.ebuild (renamed from dev-python/google-apitools/google-apitools-0.5.30.ebuild) | 28 |
4 files changed, 241 insertions, 18 deletions
diff --git a/dev-python/google-apitools/Manifest b/dev-python/google-apitools/Manifest index 3d708f574b28..bae6771bf004 100644 --- a/dev-python/google-apitools/Manifest +++ b/dev-python/google-apitools/Manifest @@ -1,4 +1,6 @@ +AUX google-apitools-0.5.30-abc.patch 2828 BLAKE2B 52f328e0701002fbc95f2749329e03a682a15113c693030cc3648ca7432b05a4975d2b4437a76bb1e40232d8317cdf3db7e3e3a14fab780326526a494fe05311 SHA512 d53104ebded8c19a4ef74f721056c107b7be42c5936215d4722672e8ace02d4adc2d7fb8589d92b3025950c2535879c4e79e1ab43fa6ac2dfa1ea6e48594aa47 +AUX google-apitools-0.5.30-py37.patch 5938 BLAKE2B efc0962d612017903092b7ed37561a09eb78f8b2c189d7c8bf902fd11b711676a230fed57f2671ac0d0c9fdddfbe66ac911d84ce1cfab64ed6b3a865d3ba1aaa SHA512 0cbeaf85568a23224c32647c1e3f6ce3a173093df1d40e36a8f2dd9155f19b3211fc926c054add955934104a069787d7cac03aa86efad526556f3255cdff98f0 AUX google-apitools-0.5.30-skip-enum-test-on-new-python.patch 807 BLAKE2B 7753d11545ffbf40abd7003e3efa777ec7245151eae2a3ee825e4fd5905af99cee3d5306a9b745d749785f818f6cf6daeca1f25895a179d2ac5aca2a58c18865 SHA512 a614ebefabc75ced727dece6a5a531e857b1282c7e7053c4a5fff90514f8240177ebfac8af8d000791f2adf69d624a2e5d68c16bfd1ec8e1083e354121d6f434 -DIST google-apitools-0.5.30.tar.gz 363524 BLAKE2B ed8477c85911f5855a449abe81b465635d3cc4e08d2915de5e882608e634f3dd9ffdda929bd8b25eb3daa5922851aa9304ffe07778cdf3a3aa629e215633515a SHA512 2dffffada829b9b962c64aab22b19cd227981819128c34f3e32515ee599297b3d5e8c97152d954110c2ef27c02737d3c30c785840b9f9767068688f62dc0b5c7 -EBUILD google-apitools-0.5.30.ebuild 1090 BLAKE2B 1d1490909f7a4e806967b719a28f02375e3b76c5b0bb0aa011a529efc5ab4090caf170308e61ea89bcdf309e52f19634a8fcb894e778e40950ddc63b2371cc68 SHA512 3ce729efd5aab9986bdf37a1e16c7b488167ed49b20571e14531981d448937b4efe307cf87de8c47441ad626a6ceb5c539020c4634e29413eafdcff6228637d0 +DIST google-apitools-0.5.30_p20200507.tar.gz 365250 BLAKE2B 58d52016775b387b494d8b5897886f059fe74a360098f6527089039469d4d4e3c0d9ec63a12be1215741fd15a1a03e2204f54ace7c9eaf8bbdc8236c9c1fe576 SHA512 94879360c5de3d7405b7377b2baf0fa303c1b0bace56cf75d203b0a509ac028e1d3208a82ba08de7d17e4e26571c9b8601cb07e6897b658eeede9d06fd384fe3 +EBUILD google-apitools-0.5.30_p20200507.ebuild 1053 BLAKE2B e52b88a54e0140f768849d625eb80208c4bb0831785d4f630bf84ff71f5a350e8c3b3e8dafcd64d77ef588289e457e392bb7da130d33e7ca000962f7d5a254c5 SHA512 bcc2bd37d218564d257f3b72de3200398851a0816fbc2bd9e373ee6700d9b0d49b3433d55bebc835e383d246b3c48385ad7f76297c6a3a183b3e4df3dd2c30ab MISC metadata.xml 330 BLAKE2B cea2ae09b3468b95764b84c8891b9840e918db4961a77f4d514a4c15a33248a011b79f235728883e31a968c69a07c436a31a282f1e4a2baed2cbb2c7ba3c4982 SHA512 a4b6c01f3d8c411c5e96b911585770af30c8a1f262e92bf01748447111798a8e6ede7aa5979f16c3cf7068b3f158842023546e234049e2345f1a2f2891e51296 diff --git a/dev-python/google-apitools/files/google-apitools-0.5.30-abc.patch b/dev-python/google-apitools/files/google-apitools-0.5.30-abc.patch new file mode 100644 index 000000000000..32f61a3d889a --- /dev/null +++ b/dev-python/google-apitools/files/google-apitools-0.5.30-abc.patch @@ -0,0 +1,81 @@ +commit cfefe5a8322b40c6e7bd3cc794fd644edcc3a6d6 +Author: Karthikeyan Singaravelan <tir.karthi@gmail.com> +Date: Mon Jan 27 20:21:15 2020 +0530 + + Import ABC from collections.abc instead of collections for Python 3.9 compatibility. (#286) + +diff --git a/apitools/base/py/extra_types.py b/apitools/base/py/extra_types.py +index 847dc91..e40a785 100644 +--- a/apitools/base/py/extra_types.py ++++ b/apitools/base/py/extra_types.py +@@ -16,7 +16,6 @@ + + """Extra types understood by apitools.""" + +-import collections + import datetime + import json + import numbers +@@ -30,6 +29,11 @@ from apitools.base.py import encoding_helper as encoding + from apitools.base.py import exceptions + from apitools.base.py import util + ++if six.PY3: ++ from collections.abc import Iterable ++else: ++ from collections import Iterable ++ + __all__ = [ + 'DateField', + 'DateTimeMessage', +@@ -129,7 +133,7 @@ def _PythonValueToJsonValue(py_value): + return JsonValue(double_value=float(py_value)) + if isinstance(py_value, dict): + return JsonValue(object_value=_PythonValueToJsonObject(py_value)) +- if isinstance(py_value, collections.Iterable): ++ if isinstance(py_value, Iterable): + return JsonValue(array_value=_PythonValueToJsonArray(py_value)) + raise exceptions.InvalidDataError( + 'Cannot convert "%s" to JsonValue' % py_value) +@@ -212,7 +216,7 @@ def _JsonProtoToPythonValue(json_proto): + def _PythonValueToJsonProto(py_value): + if isinstance(py_value, dict): + return _PythonValueToJsonObject(py_value) +- if (isinstance(py_value, collections.Iterable) and ++ if (isinstance(py_value, Iterable) and + not isinstance(py_value, six.string_types)): + return _PythonValueToJsonArray(py_value) + return _PythonValueToJsonValue(py_value) +diff --git a/apitools/base/py/util.py b/apitools/base/py/util.py +index ac1a44c..ad086e4 100644 +--- a/apitools/base/py/util.py ++++ b/apitools/base/py/util.py +@@ -16,7 +16,6 @@ + + """Assorted utilities shared between parts of apitools.""" + +-import collections + import os + import random + +@@ -30,6 +29,11 @@ from apitools.base.protorpclite import messages + from apitools.base.py import encoding_helper as encoding + from apitools.base.py import exceptions + ++if six.PY3: ++ from collections.abc import Iterable ++else: ++ from collections import Iterable ++ + __all__ = [ + 'DetectGae', + 'DetectGce', +@@ -78,7 +82,7 @@ def NormalizeScopes(scope_spec): + if isinstance(scope_spec, six.string_types): + scope_spec = six.ensure_str(scope_spec) + return set(scope_spec.split(' ')) +- elif isinstance(scope_spec, collections.Iterable): ++ elif isinstance(scope_spec, Iterable): + scope_spec = [six.ensure_str(x) for x in scope_spec] + return set(scope_spec) + raise exceptions.TypecheckError( diff --git a/dev-python/google-apitools/files/google-apitools-0.5.30-py37.patch b/dev-python/google-apitools/files/google-apitools-0.5.30-py37.patch new file mode 100644 index 000000000000..77f2c59b8296 --- /dev/null +++ b/dev-python/google-apitools/files/google-apitools-0.5.30-py37.patch @@ -0,0 +1,144 @@ +diff --git a/apitools/base/protorpclite/messages.py b/apitools/base/protorpclite/messages.py +index 0d564e9..5b2346a 100644 +--- a/apitools/base/protorpclite/messages.py ++++ b/apitools/base/protorpclite/messages.py +@@ -757,6 +757,7 @@ class Message(six.with_metaclass(_MessageClass, object)): + order.check_initialized() + + """ ++ __hash__ = None + + def __init__(self, **kwargs): + """Initialize internal messages state. +@@ -1079,9 +1080,9 @@ class FieldList(list): + if not field_instance.repeated: + raise FieldDefinitionError( + 'FieldList may only accept repeated fields') +- self.__field = field_instance +- self.__field.validate(sequence) +- list.__init__(self, sequence) ++ self._field = field_instance ++ self._field.validate(sequence) ++ super().__init__(sequence) + + def __getstate__(self): + """Enable pickling. +@@ -1098,10 +1099,10 @@ class FieldList(list): + None. + + """ +- message_class = self.__field.message_definition() ++ message_class = self._field.message_definition() + if message_class is None: +- return self.__field, None, None +- return None, message_class, self.__field.number ++ return self._field, None, None ++ return None, message_class, self._field.number + + def __setstate__(self, state): + """Enable unpickling. +@@ -1115,41 +1116,43 @@ class FieldList(list): + """ + field_instance, message_class, number = state + if field_instance is None: +- self.__field = message_class.field_by_number(number) ++ self._field = message_class.field_by_number(number) + else: +- self.__field = field_instance ++ self._field = field_instance + + @property + def field(self): + """Field that validates list.""" +- return self.__field ++ return self._field + + def __setslice__(self, i, j, sequence): + """Validate slice assignment to list.""" +- self.__field.validate(sequence) ++ self._field.validate(sequence) + list.__setslice__(self, i, j, sequence) + + def __setitem__(self, index, value): + """Validate item assignment to list.""" + if isinstance(index, slice): +- self.__field.validate(value) ++ self._field.validate(value) + else: +- self.__field.validate_element(value) ++ self._field.validate_element(value) + list.__setitem__(self, index, value) + + def append(self, value): + """Validate item appending to list.""" +- self.__field.validate_element(value) ++ if hasattr(self, '_field'): ++ self._field.validate_element(value) + return list.append(self, value) + + def extend(self, sequence): + """Validate extension of list.""" +- self.__field.validate(sequence) ++ if hasattr(self, '_field'): ++ self._field.validate(sequence) + return list.extend(self, sequence) + + def insert(self, index, value): + """Validate item insertion to list.""" +- self.__field.validate_element(value) ++ self._field.validate_element(value) + return list.insert(self, index, value) + + +diff --git a/apitools/base/protorpclite/messages_test.py b/apitools/base/protorpclite/messages_test.py +index 3ad75e4..1acdab3 100644 +--- a/apitools/base/protorpclite/messages_test.py ++++ b/apitools/base/protorpclite/messages_test.py +@@ -508,7 +508,8 @@ class FieldListTest(test_util.TestCase): + def testPickle(self): + """Testing pickling and unpickling of FieldList instances.""" + field_list = messages.FieldList(self.integer_field, [1, 2, 3, 4, 5]) +- unpickled = pickle.loads(pickle.dumps(field_list)) ++ pickled = pickle.dumps(field_list) ++ unpickled = pickle.loads(pickled) + self.assertEquals(field_list, unpickled) + self.assertIsInstance(unpickled.field, messages.IntegerField) + self.assertEquals(1, unpickled.field.number) +diff --git a/apitools/base/protorpclite/protojson_test.py b/apitools/base/protorpclite/protojson_test.py +index 7a8f875..69804f5 100644 +--- a/apitools/base/protorpclite/protojson_test.py ++++ b/apitools/base/protorpclite/protojson_test.py +@@ -440,7 +440,7 @@ class ProtojsonTest(test_util.TestCase, + """Test decoding improperly encoded base64 bytes value.""" + self.assertRaisesWithRegexpMatch( + messages.DecodeError, +- 'Base64 decoding error: Incorrect padding', ++ 'Base64 decoding error: (?:Incorrect padding|Invalid base64-encoded string: .*)', + protojson.decode_message, + test_util.OptionalMessage, + '{"bytes_value": "abcdefghijklmnopq"}') +diff --git a/apitools/base/py/batch_test.py b/apitools/base/py/batch_test.py +index 90cf4fb..e1384c5 100644 +--- a/apitools/base/py/batch_test.py ++++ b/apitools/base/py/batch_test.py +@@ -357,7 +357,7 @@ class BatchTest(unittest.TestCase): + self._DoTestConvertIdToHeader('blah', '<%s+blah>') + + def testConvertIdThatNeedsEscaping(self): +- self._DoTestConvertIdToHeader('~tilde1', '<%s+%%7Etilde1>') ++ self._DoTestConvertIdToHeader('#hash1', r'<%s+%%23hash1>') + + def _DoTestConvertHeaderToId(self, header, expected_id): + batch_request = batch.BatchHttpRequest('https://www.example.com') +diff --git a/apitools/gen/client_generation_test.py b/apitools/gen/client_generation_test.py +index 4e382dd..c26db39 100644 +--- a/apitools/gen/client_generation_test.py ++++ b/apitools/gen/client_generation_test.py +@@ -42,6 +42,7 @@ class ClientGenerationTest(unittest.TestCase): + self.gen_client_binary = 'gen_client' + + @test_utils.SkipOnWindows ++ @unittest.skip('needs network access') + def testGeneration(self): + for api in _API_LIST: + with test_utils.TempDir(change_to=True): diff --git a/dev-python/google-apitools/google-apitools-0.5.30.ebuild b/dev-python/google-apitools/google-apitools-0.5.30_p20200507.ebuild index 7b8566aa6130..c81be54c3e20 100644 --- a/dev-python/google-apitools/google-apitools-0.5.30.ebuild +++ b/dev-python/google-apitools/google-apitools-0.5.30_p20200507.ebuild @@ -3,13 +3,15 @@ EAPI=7 -PYTHON_COMPAT=( python3_6 ) - +PYTHON_COMPAT=( python3_{6,7,8} ) +DISTUTILS_USE_SETUPTOOLS=rdepend inherit distutils-r1 +COMMIT_HASH="02db277e2bbc5906c8787f64dc9a743fe3327f90" DESCRIPTION="Python library to manipulate Google APIs" HOMEPAGE="https://github.com/google/apitools" -SRC_URI="https://github.com/google/apitools/archive/v${PV}.tar.gz -> ${P}.tar.gz" +SRC_URI="https://github.com/google/apitools/archive/${COMMIT_HASH}.tar.gz -> ${P}.tar.gz" +S="${WORKDIR}/${PN#google-}-${COMMIT_HASH}" LICENSE="Apache-2.0" SLOT="0" @@ -17,25 +19,19 @@ KEYWORDS="~amd64 ~arm ~x86" IUSE="test" RESTRICT="!test? ( test )" -RDEPEND=">=dev-python/httplib2-0.8[${PYTHON_USEDEP}] +RDEPEND=" + >=dev-python/httplib2-0.8[${PYTHON_USEDEP}] >=dev-python/fasteners-0.14[${PYTHON_USEDEP}] >=dev-python/oauth2client-1.5.2[${PYTHON_USEDEP}] >=dev-python/six-1.12.0[${PYTHON_USEDEP}] - >=dev-python/python-gflags-3.1.2[${PYTHON_USEDEP}]" + >=dev-python/python-gflags-3.1.2[${PYTHON_USEDEP}] +" DEPEND="${RDEPEND} >=dev-python/setuptools-18.5[${PYTHON_USEDEP}] - test? ( - dev-python/nose[${PYTHON_USEDEP}] - >=dev-python/unittest2-0.5.1[${PYTHON_USEDEP}] - >=dev-python/mock-1.0.1[${PYTHON_USEDEP}] - )" - -S="${WORKDIR}/apitools-${PV}" + test? ( >=dev-python/mock-1.0.1[${PYTHON_USEDEP}] )" PATCHES=( - "${FILESDIR}/google-apitools-0.5.30-skip-enum-test-on-new-python.patch" + "${FILESDIR}/google-apitools-0.5.30-py37.patch" ) -python_test() { - nosetests -v || die "tests failed with ${EPYTHON}" -} +distutils_enable_tests nose |