Gentoo Archives: gentoo-commits

From: Patrick McLean <chutzpah@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/google-apitools/files/, dev-python/google-apitools/
Date: Thu, 07 May 2020 02:59:34
Message-Id: 1588820358.f701cdfa98aeb441638e594e246a4767ccdab479.chutzpah@gentoo
1 commit: f701cdfa98aeb441638e594e246a4767ccdab479
2 Author: Patrick McLean <patrick.mclean <AT> sony <DOT> com>
3 AuthorDate: Thu May 7 02:59:18 2020 +0000
4 Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
5 CommitDate: Thu May 7 02:59:18 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f701cdfa
7
8 dev-python/google-apitools-0.5.30_p20200507: Version bump. add py37, 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 dev-python/google-apitools/Manifest | 1 +
15 .../files/google-apitools-0.5.30-abc.patch | 81 ++++++++++++
16 .../files/google-apitools-0.5.30-py37.patch | 144 +++++++++++++++++++++
17 .../google-apitools-0.5.30_p20200507.ebuild | 37 ++++++
18 4 files changed, 263 insertions(+)
19
20 diff --git a/dev-python/google-apitools/Manifest b/dev-python/google-apitools/Manifest
21 index b04e1e87f7d..7db71160bda 100644
22 --- a/dev-python/google-apitools/Manifest
23 +++ b/dev-python/google-apitools/Manifest
24 @@ -1 +1,2 @@
25 DIST google-apitools-0.5.30.tar.gz 363524 BLAKE2B ed8477c85911f5855a449abe81b465635d3cc4e08d2915de5e882608e634f3dd9ffdda929bd8b25eb3daa5922851aa9304ffe07778cdf3a3aa629e215633515a SHA512 2dffffada829b9b962c64aab22b19cd227981819128c34f3e32515ee599297b3d5e8c97152d954110c2ef27c02737d3c30c785840b9f9767068688f62dc0b5c7
26 +DIST google-apitools-0.5.30_p20200507.tar.gz 365250 BLAKE2B 58d52016775b387b494d8b5897886f059fe74a360098f6527089039469d4d4e3c0d9ec63a12be1215741fd15a1a03e2204f54ace7c9eaf8bbdc8236c9c1fe576 SHA512 94879360c5de3d7405b7377b2baf0fa303c1b0bace56cf75d203b0a509ac028e1d3208a82ba08de7d17e4e26571c9b8601cb07e6897b658eeede9d06fd384fe3
27
28 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
29 new file mode 100644
30 index 00000000000..32f61a3d889
31 --- /dev/null
32 +++ b/dev-python/google-apitools/files/google-apitools-0.5.30-abc.patch
33 @@ -0,0 +1,81 @@
34 +commit cfefe5a8322b40c6e7bd3cc794fd644edcc3a6d6
35 +Author: Karthikeyan Singaravelan <tir.karthi@×××××.com>
36 +Date: Mon Jan 27 20:21:15 2020 +0530
37 +
38 + Import ABC from collections.abc instead of collections for Python 3.9 compatibility. (#286)
39 +
40 +diff --git a/apitools/base/py/extra_types.py b/apitools/base/py/extra_types.py
41 +index 847dc91..e40a785 100644
42 +--- a/apitools/base/py/extra_types.py
43 ++++ b/apitools/base/py/extra_types.py
44 +@@ -16,7 +16,6 @@
45 +
46 + """Extra types understood by apitools."""
47 +
48 +-import collections
49 + import datetime
50 + import json
51 + import numbers
52 +@@ -30,6 +29,11 @@ from apitools.base.py import encoding_helper as encoding
53 + from apitools.base.py import exceptions
54 + from apitools.base.py import util
55 +
56 ++if six.PY3:
57 ++ from collections.abc import Iterable
58 ++else:
59 ++ from collections import Iterable
60 ++
61 + __all__ = [
62 + 'DateField',
63 + 'DateTimeMessage',
64 +@@ -129,7 +133,7 @@ def _PythonValueToJsonValue(py_value):
65 + return JsonValue(double_value=float(py_value))
66 + if isinstance(py_value, dict):
67 + return JsonValue(object_value=_PythonValueToJsonObject(py_value))
68 +- if isinstance(py_value, collections.Iterable):
69 ++ if isinstance(py_value, Iterable):
70 + return JsonValue(array_value=_PythonValueToJsonArray(py_value))
71 + raise exceptions.InvalidDataError(
72 + 'Cannot convert "%s" to JsonValue' % py_value)
73 +@@ -212,7 +216,7 @@ def _JsonProtoToPythonValue(json_proto):
74 + def _PythonValueToJsonProto(py_value):
75 + if isinstance(py_value, dict):
76 + return _PythonValueToJsonObject(py_value)
77 +- if (isinstance(py_value, collections.Iterable) and
78 ++ if (isinstance(py_value, Iterable) and
79 + not isinstance(py_value, six.string_types)):
80 + return _PythonValueToJsonArray(py_value)
81 + return _PythonValueToJsonValue(py_value)
82 +diff --git a/apitools/base/py/util.py b/apitools/base/py/util.py
83 +index ac1a44c..ad086e4 100644
84 +--- a/apitools/base/py/util.py
85 ++++ b/apitools/base/py/util.py
86 +@@ -16,7 +16,6 @@
87 +
88 + """Assorted utilities shared between parts of apitools."""
89 +
90 +-import collections
91 + import os
92 + import random
93 +
94 +@@ -30,6 +29,11 @@ from apitools.base.protorpclite import messages
95 + from apitools.base.py import encoding_helper as encoding
96 + from apitools.base.py import exceptions
97 +
98 ++if six.PY3:
99 ++ from collections.abc import Iterable
100 ++else:
101 ++ from collections import Iterable
102 ++
103 + __all__ = [
104 + 'DetectGae',
105 + 'DetectGce',
106 +@@ -78,7 +82,7 @@ def NormalizeScopes(scope_spec):
107 + if isinstance(scope_spec, six.string_types):
108 + scope_spec = six.ensure_str(scope_spec)
109 + return set(scope_spec.split(' '))
110 +- elif isinstance(scope_spec, collections.Iterable):
111 ++ elif isinstance(scope_spec, Iterable):
112 + scope_spec = [six.ensure_str(x) for x in scope_spec]
113 + return set(scope_spec)
114 + raise exceptions.TypecheckError(
115
116 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
117 new file mode 100644
118 index 00000000000..77f2c59b829
119 --- /dev/null
120 +++ b/dev-python/google-apitools/files/google-apitools-0.5.30-py37.patch
121 @@ -0,0 +1,144 @@
122 +diff --git a/apitools/base/protorpclite/messages.py b/apitools/base/protorpclite/messages.py
123 +index 0d564e9..5b2346a 100644
124 +--- a/apitools/base/protorpclite/messages.py
125 ++++ b/apitools/base/protorpclite/messages.py
126 +@@ -757,6 +757,7 @@ class Message(six.with_metaclass(_MessageClass, object)):
127 + order.check_initialized()
128 +
129 + """
130 ++ __hash__ = None
131 +
132 + def __init__(self, **kwargs):
133 + """Initialize internal messages state.
134 +@@ -1079,9 +1080,9 @@ class FieldList(list):
135 + if not field_instance.repeated:
136 + raise FieldDefinitionError(
137 + 'FieldList may only accept repeated fields')
138 +- self.__field = field_instance
139 +- self.__field.validate(sequence)
140 +- list.__init__(self, sequence)
141 ++ self._field = field_instance
142 ++ self._field.validate(sequence)
143 ++ super().__init__(sequence)
144 +
145 + def __getstate__(self):
146 + """Enable pickling.
147 +@@ -1098,10 +1099,10 @@ class FieldList(list):
148 + None.
149 +
150 + """
151 +- message_class = self.__field.message_definition()
152 ++ message_class = self._field.message_definition()
153 + if message_class is None:
154 +- return self.__field, None, None
155 +- return None, message_class, self.__field.number
156 ++ return self._field, None, None
157 ++ return None, message_class, self._field.number
158 +
159 + def __setstate__(self, state):
160 + """Enable unpickling.
161 +@@ -1115,41 +1116,43 @@ class FieldList(list):
162 + """
163 + field_instance, message_class, number = state
164 + if field_instance is None:
165 +- self.__field = message_class.field_by_number(number)
166 ++ self._field = message_class.field_by_number(number)
167 + else:
168 +- self.__field = field_instance
169 ++ self._field = field_instance
170 +
171 + @property
172 + def field(self):
173 + """Field that validates list."""
174 +- return self.__field
175 ++ return self._field
176 +
177 + def __setslice__(self, i, j, sequence):
178 + """Validate slice assignment to list."""
179 +- self.__field.validate(sequence)
180 ++ self._field.validate(sequence)
181 + list.__setslice__(self, i, j, sequence)
182 +
183 + def __setitem__(self, index, value):
184 + """Validate item assignment to list."""
185 + if isinstance(index, slice):
186 +- self.__field.validate(value)
187 ++ self._field.validate(value)
188 + else:
189 +- self.__field.validate_element(value)
190 ++ self._field.validate_element(value)
191 + list.__setitem__(self, index, value)
192 +
193 + def append(self, value):
194 + """Validate item appending to list."""
195 +- self.__field.validate_element(value)
196 ++ if hasattr(self, '_field'):
197 ++ self._field.validate_element(value)
198 + return list.append(self, value)
199 +
200 + def extend(self, sequence):
201 + """Validate extension of list."""
202 +- self.__field.validate(sequence)
203 ++ if hasattr(self, '_field'):
204 ++ self._field.validate(sequence)
205 + return list.extend(self, sequence)
206 +
207 + def insert(self, index, value):
208 + """Validate item insertion to list."""
209 +- self.__field.validate_element(value)
210 ++ self._field.validate_element(value)
211 + return list.insert(self, index, value)
212 +
213 +
214 +diff --git a/apitools/base/protorpclite/messages_test.py b/apitools/base/protorpclite/messages_test.py
215 +index 3ad75e4..1acdab3 100644
216 +--- a/apitools/base/protorpclite/messages_test.py
217 ++++ b/apitools/base/protorpclite/messages_test.py
218 +@@ -508,7 +508,8 @@ class FieldListTest(test_util.TestCase):
219 + def testPickle(self):
220 + """Testing pickling and unpickling of FieldList instances."""
221 + field_list = messages.FieldList(self.integer_field, [1, 2, 3, 4, 5])
222 +- unpickled = pickle.loads(pickle.dumps(field_list))
223 ++ pickled = pickle.dumps(field_list)
224 ++ unpickled = pickle.loads(pickled)
225 + self.assertEquals(field_list, unpickled)
226 + self.assertIsInstance(unpickled.field, messages.IntegerField)
227 + self.assertEquals(1, unpickled.field.number)
228 +diff --git a/apitools/base/protorpclite/protojson_test.py b/apitools/base/protorpclite/protojson_test.py
229 +index 7a8f875..69804f5 100644
230 +--- a/apitools/base/protorpclite/protojson_test.py
231 ++++ b/apitools/base/protorpclite/protojson_test.py
232 +@@ -440,7 +440,7 @@ class ProtojsonTest(test_util.TestCase,
233 + """Test decoding improperly encoded base64 bytes value."""
234 + self.assertRaisesWithRegexpMatch(
235 + messages.DecodeError,
236 +- 'Base64 decoding error: Incorrect padding',
237 ++ 'Base64 decoding error: (?:Incorrect padding|Invalid base64-encoded string: .*)',
238 + protojson.decode_message,
239 + test_util.OptionalMessage,
240 + '{"bytes_value": "abcdefghijklmnopq"}')
241 +diff --git a/apitools/base/py/batch_test.py b/apitools/base/py/batch_test.py
242 +index 90cf4fb..e1384c5 100644
243 +--- a/apitools/base/py/batch_test.py
244 ++++ b/apitools/base/py/batch_test.py
245 +@@ -357,7 +357,7 @@ class BatchTest(unittest.TestCase):
246 + self._DoTestConvertIdToHeader('blah', '<%s+blah>')
247 +
248 + def testConvertIdThatNeedsEscaping(self):
249 +- self._DoTestConvertIdToHeader('~tilde1', '<%s+%%7Etilde1>')
250 ++ self._DoTestConvertIdToHeader('#hash1', r'<%s+%%23hash1>')
251 +
252 + def _DoTestConvertHeaderToId(self, header, expected_id):
253 + batch_request = batch.BatchHttpRequest('https://www.example.com')
254 +diff --git a/apitools/gen/client_generation_test.py b/apitools/gen/client_generation_test.py
255 +index 4e382dd..c26db39 100644
256 +--- a/apitools/gen/client_generation_test.py
257 ++++ b/apitools/gen/client_generation_test.py
258 +@@ -42,6 +42,7 @@ class ClientGenerationTest(unittest.TestCase):
259 + self.gen_client_binary = 'gen_client'
260 +
261 + @test_utils.SkipOnWindows
262 ++ @unittest.skip('needs network access')
263 + def testGeneration(self):
264 + for api in _API_LIST:
265 + with test_utils.TempDir(change_to=True):
266
267 diff --git a/dev-python/google-apitools/google-apitools-0.5.30_p20200507.ebuild b/dev-python/google-apitools/google-apitools-0.5.30_p20200507.ebuild
268 new file mode 100644
269 index 00000000000..c81be54c3e2
270 --- /dev/null
271 +++ b/dev-python/google-apitools/google-apitools-0.5.30_p20200507.ebuild
272 @@ -0,0 +1,37 @@
273 +# Copyright 1999-2020 Gentoo Authors
274 +# Distributed under the terms of the GNU General Public License v2
275 +
276 +EAPI=7
277 +
278 +PYTHON_COMPAT=( python3_{6,7,8} )
279 +DISTUTILS_USE_SETUPTOOLS=rdepend
280 +inherit distutils-r1
281 +
282 +COMMIT_HASH="02db277e2bbc5906c8787f64dc9a743fe3327f90"
283 +DESCRIPTION="Python library to manipulate Google APIs"
284 +HOMEPAGE="https://github.com/google/apitools"
285 +SRC_URI="https://github.com/google/apitools/archive/${COMMIT_HASH}.tar.gz -> ${P}.tar.gz"
286 +S="${WORKDIR}/${PN#google-}-${COMMIT_HASH}"
287 +
288 +LICENSE="Apache-2.0"
289 +SLOT="0"
290 +KEYWORDS="~amd64 ~arm ~x86"
291 +IUSE="test"
292 +RESTRICT="!test? ( test )"
293 +
294 +RDEPEND="
295 + >=dev-python/httplib2-0.8[${PYTHON_USEDEP}]
296 + >=dev-python/fasteners-0.14[${PYTHON_USEDEP}]
297 + >=dev-python/oauth2client-1.5.2[${PYTHON_USEDEP}]
298 + >=dev-python/six-1.12.0[${PYTHON_USEDEP}]
299 + >=dev-python/python-gflags-3.1.2[${PYTHON_USEDEP}]
300 +"
301 +DEPEND="${RDEPEND}
302 + >=dev-python/setuptools-18.5[${PYTHON_USEDEP}]
303 + test? ( >=dev-python/mock-1.0.1[${PYTHON_USEDEP}] )"
304 +
305 +PATCHES=(
306 + "${FILESDIR}/google-apitools-0.5.30-py37.patch"
307 +)
308 +
309 +distutils_enable_tests nose