From ac1508e0dbaa28be9a8868288862e9db7b58e0e6 Mon Sep 17 00:00:00 2001 From: Martha Giannoudovardi Date: Thu, 12 Aug 2021 12:06:24 +0100 Subject: [PATCH 01/15] Remove python 2 from tox --- setup.py | 2 +- tox.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index 03ccac3f..37eb8da0 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup, find_packages from version import get_version -from subprocess import setup_timeseries, build_messages +from commands import setup_timeseries, build_messages install_requires = ['six >= 1.8.0', 'basho_erlastic >= 2.1.1'] requires = ['six(>=1.8.0)', 'basho_erlastic(>= 2.1.1)'] diff --git a/tox.ini b/tox.ini index f411b799..3e29001b 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ # test suite on all supported python versions. [tox] -envlist = py2, py3 +envlist = py3 [testenv] install_command = pip install --upgrade {packages} From 552edb42600494b7cad23e4b532545e1a73f271a Mon Sep 17 00:00:00 2001 From: Martha Giannoudovardi Date: Thu, 12 Aug 2021 16:35:57 +0100 Subject: [PATCH 02/15] Remove six usage from python files --- riak/bucket.py | 23 +--- riak/client/__init__.py | 34 ++--- riak/client/multi.py | 6 +- riak/client/operations.py | 22 ++- riak/client/transport.py | 6 +- riak/codecs/http.py | 11 +- riak/codecs/pbuf.py | 36 ++--- riak/codecs/ttb.py | 9 +- riak/content.py | 3 +- riak/datatypes/counter.py | 4 +- riak/datatypes/hll.py | 5 +- riak/datatypes/register.py | 3 +- riak/datatypes/set.py | 5 +- riak/mapreduce.py | 13 +- riak/riak_object.py | 36 ++--- riak/table.py | 10 +- riak/test_server.py | 3 +- riak/tests/base.py | 1 - riak/tests/comparison.py | 192 +++++++++++++-------------- riak/tests/pool-grinder.py | 8 +- riak/tests/test_2i.py | 1 - riak/tests/test_client.py | 78 +++-------- riak/tests/test_comparison.py | 1 - riak/tests/test_datatypes.py | 1 - riak/tests/test_datetime.py | 1 - riak/tests/test_feature_detection.py | 1 - riak/tests/test_filters.py | 1 - riak/tests/test_kv.py | 85 +++--------- riak/tests/test_mapreduce.py | 70 +++------- riak/tests/test_pool.py | 7 +- riak/tests/test_security.py | 1 - riak/tests/test_timeseries_pbuf.py | 1 - riak/tests/test_timeseries_ttb.py | 1 - riak/tests/test_yokozuna.py | 1 - riak/transports/http/__init__.py | 48 ++----- riak/transports/http/connection.py | 6 +- riak/transports/http/resources.py | 11 +- riak/transports/http/stream.py | 12 +- riak/transports/http/transport.py | 11 +- riak/transports/tcp/connection.py | 3 +- riak/transports/tcp/stream.py | 6 +- riak/transports/tcp/transport.py | 4 - riak/transports/transport.py | 11 +- riak/util.py | 9 +- 44 files changed, 239 insertions(+), 562 deletions(-) diff --git a/riak/bucket.py b/riak/bucket.py index 7dde7351..4e96c462 100644 --- a/riak/bucket.py +++ b/riak/bucket.py @@ -15,7 +15,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from six import string_types, PY2 import mimetypes from riak.util import lazy_property from riak.datatypes import TYPES @@ -51,15 +50,9 @@ def __init__(self, client, name, bucket_type): :type bucket_type: :class:`BucketType` """ - if not isinstance(name, string_types): + if not isinstance(name, str): raise TypeError('Bucket name must be a string') - if PY2: - try: - name = name.encode('ascii') - except UnicodeError: - raise TypeError('Unicode bucket names are not supported.') - if not isinstance(bucket_type, BucketType): raise TypeError('Parent bucket type must be a BucketType instance') @@ -176,13 +169,6 @@ def new(self, key=None, data=None, content_type='application/json', if self.bucket_type.datatype: return TYPES[self.bucket_type.datatype](bucket=self, key=key) - if PY2: - try: - if isinstance(data, string_types): - data = data.encode('ascii') - except UnicodeError: - raise TypeError('Unicode data values are not supported.') - obj = RiakObject(self._client, self, key) obj.content_type = content_type if data is not None: @@ -427,12 +413,7 @@ def new_from_file(self, key, filename): binary_data = bytearray(binary_data) if not mimetype: mimetype = 'application/octet-stream' - if PY2: - return self.new(key, encoded_data=binary_data, - content_type=mimetype) - else: - return self.new(key, encoded_data=bytes(binary_data), - content_type=mimetype) + return self.new(key, encoded_data=bytes(binary_data), content_type=mimetype) def search_enabled(self): """ diff --git a/riak/client/__init__.py b/riak/client/__init__.py index 06ca6137..2cd716ae 100644 --- a/riak/client/__init__.py +++ b/riak/client/__init__.py @@ -30,7 +30,6 @@ from riak.transports.tcp import TcpPool from riak.security import SecurityCreds from riak.util import lazy_property, bytes_to_str, str_to_bytes -from six import string_types, PY2 from riak.client.multi import MultiGetPool, MultiPutPool @@ -124,23 +123,14 @@ def __init__(self, protocol='pbc', transport_options={}, self._http_pool = HttpPool(self, **transport_options) self._tcp_pool = TcpPool(self, **transport_options) self._closed = False - - if PY2: - self._encoders = {'application/json': default_encoder, - 'text/json': default_encoder, - 'text/plain': str} - self._decoders = {'application/json': json.loads, - 'text/json': json.loads, - 'text/plain': str} - else: - self._encoders = {'application/json': binary_json_encoder, - 'text/json': binary_json_encoder, - 'text/plain': str_to_bytes, - 'binary/octet-stream': binary_encoder_decoder} - self._decoders = {'application/json': binary_json_decoder, - 'text/json': binary_json_decoder, - 'text/plain': bytes_to_str, - 'binary/octet-stream': binary_encoder_decoder} + self._encoders = {'application/json': binary_json_encoder, + 'text/json': binary_json_encoder, + 'text/plain': str_to_bytes, + 'binary/octet-stream': binary_encoder_decoder} + self._decoders = {'application/json': binary_json_decoder, + 'text/json': binary_json_decoder, + 'text/plain': bytes_to_str, + 'binary/octet-stream': binary_encoder_decoder} self._buckets = WeakValueDictionary() self._bucket_types = WeakValueDictionary() self._tables = WeakValueDictionary() @@ -266,10 +256,10 @@ def bucket(self, name, bucket_type='default'): :rtype: :class:`RiakBucket ` """ - if not isinstance(name, string_types): + if not isinstance(name, str): raise TypeError('Bucket name must be a string') - if isinstance(bucket_type, string_types): + if isinstance(bucket_type, str): bucket_type = self.bucket_type(bucket_type) elif not isinstance(bucket_type, BucketType): raise TypeError('bucket_type must be a string ' @@ -289,7 +279,7 @@ def bucket_type(self, name): :type name: str :rtype: :class:`BucketType ` """ - if not isinstance(name, string_types): + if not isinstance(name, str): raise TypeError('BucketType name must be a string') btype = BucketType(self, name) @@ -306,7 +296,7 @@ def table(self, name): :type name: str :rtype: :class:`Table ` """ - if not isinstance(name, string_types): + if not isinstance(name, str): raise TypeError('Table name must be a string') if name in self._tables: diff --git a/riak/client/multi.py b/riak/client/multi.py index 39a4a4a3..7d93d501 100644 --- a/riak/client/multi.py +++ b/riak/client/multi.py @@ -16,15 +16,11 @@ from collections import namedtuple from threading import Thread, Lock, Event from multiprocessing import cpu_count -from six import PY2 from riak.riak_object import RiakObject from riak.ts_object import TsObject -if PY2: - from queue import Queue, Empty -else: - from queue import Queue, Empty +from queue import Queue, Empty __all__ = ['multiget', 'multiput', 'MultiGetPool', 'MultiPutPool'] diff --git a/riak/client/operations.py b/riak/client/operations.py index 0d507f12..dbb9ca50 100644 --- a/riak/client/operations.py +++ b/riak/client/operations.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import six import riak.client.multi from riak import ListError @@ -524,10 +523,7 @@ def make_op(transport): for keylist in self._stream_with_retry(make_op): if len(keylist) > 0: - if six.PY2: - yield keylist - else: - yield [bytes_to_str(item) for item in keylist] + yield [bytes_to_str(item) for item in keylist] @retryable def put(self, transport, robj, w=None, dw=None, pw=None, return_body=None, @@ -579,7 +575,7 @@ def ts_describe(self, transport, table): :rtype: :class:`TsObject ` """ t = table - if isinstance(t, six.string_types): + if isinstance(t, str): t = Table(self, table) return transport.ts_describe(t) @@ -600,7 +596,7 @@ def ts_get(self, transport, table, key): :rtype: :class:`TsObject ` """ t = table - if isinstance(t, six.string_types): + if isinstance(t, str): t = Table(self, table) return transport.ts_get(t, key) @@ -637,7 +633,7 @@ def ts_delete(self, transport, table, key): :rtype: boolean """ t = table - if isinstance(t, six.string_types): + if isinstance(t, str): t = Table(self, table) return transport.ts_delete(t, key) @@ -658,7 +654,7 @@ def ts_query(self, transport, table, query, interpolations=None): :rtype: :class:`TsObject ` """ t = table - if isinstance(t, six.string_types): + if isinstance(t, str): t = Table(self, table) return transport.ts_query(t, query, interpolations) @@ -696,7 +692,7 @@ def ts_stream_keys(self, table, timeout=None): raise ListError() t = table - if isinstance(t, six.string_types): + if isinstance(t, str): t = Table(self, table) _validate_timeout(timeout) @@ -741,7 +737,7 @@ def get(self, transport, robj, r=None, pr=None, timeout=None, :type head_only: bool """ _validate_timeout(timeout) - if not isinstance(robj.key, six.string_types): + if not isinstance(robj.key, str): raise TypeError( 'key must be a string, instead got {0}'.format(repr(robj.key))) @@ -1091,7 +1087,7 @@ def update_counter(self, bucket, key, value, w=None, dw=None, pw=None, :param returnvalue: whether to return the updated value of the counter :type returnvalue: bool """ - if not isinstance(value, six.integer_types): + if not isinstance(value, int): raise TypeError("Counter update amount must be an integer") if value == 0: raise ValueError("Cannot increment counter by 0") @@ -1282,7 +1278,7 @@ def _validate_timeout(timeout, infinity_ok=False): 'timeout must be a positive integer ' '("infinity" is not valid)') - if isinstance(timeout, six.integer_types) and timeout > 0: + if isinstance(timeout, int) and timeout > 0: return raise ValueError('timeout must be a positive integer') diff --git a/riak/client/transport.py b/riak/client/transport.py index d8474e35..352629d8 100644 --- a/riak/client/transport.py +++ b/riak/client/transport.py @@ -16,14 +16,10 @@ from riak.transports.pool import BadResource, ConnectionClosed from riak.transports.tcp import is_retryable as is_tcp_retryable from riak.transports.http import is_retryable as is_http_retryable -from six import PY2 import threading -if PY2: - from http.client import HTTPException -else: - from http.client import HTTPException +from http.client import HTTPException #: The default (global) number of times to retry requests that are #: retryable. This can be modified locally, per-thread, via the diff --git a/riak/codecs/http.py b/riak/codecs/http.py index f8efc99d..6aeaa714 100644 --- a/riak/codecs/http.py +++ b/riak/codecs/http.py @@ -14,7 +14,6 @@ import re import csv -import six from cgi import parse_header from email import message_from_string @@ -27,10 +26,7 @@ from riak.transports.http.search import XMLSearchResult from riak.util import decode_index_value, bytes_to_str -if six.PY2: - from urllib.parse import unquote_plus -else: - from urllib.parse import unquote_plus +from urllib.parse import unquote_plus # subtract length of "Link: " header string and newline @@ -77,8 +73,7 @@ def _parse_body(self, robj, response, expected_statuses): elif status == 300: ctype, params = parse_header(headers['content-type']) if ctype == 'multipart/mixed': - if six.PY3: - data = bytes_to_str(data) + data = bytes_to_str(data) boundary = re.compile('\r?\n--%s(?:--)?\r?\n' % re.escape(params['boundary'])) parts = [message_from_string(p) @@ -245,7 +240,7 @@ def _normalize_json_search_response(self, json): # Riak Search 1.0 Legacy assumptions about format resdoc['id'] = doc['id'] if 'fields' in doc: - for k, v in six.iteritems(doc['fields']): + for k, v in doc['fields'].items: resdoc[k] = v docs.append(resdoc) result['docs'] = docs diff --git a/riak/codecs/pbuf.py b/riak/codecs/pbuf.py index 6b5bfa7d..864568e9 100644 --- a/riak/codecs/pbuf.py +++ b/riak/codecs/pbuf.py @@ -13,7 +13,6 @@ # limitations under the License. import datetime -import six import riak.pb.messages import riak.pb.riak_pb2 @@ -252,10 +251,7 @@ def encode_content(self, robj, rpb_content): pair.value = str_to_bytes(str(value)) # Python 2.x data is stored in a string - if six.PY2: - rpb_content.value = str(robj.encoded_data) - else: - rpb_content.value = robj.encoded_data + rpb_content.value = robj.encoded_data def decode_link(self, link): """ @@ -306,7 +302,7 @@ def encode_bucket_props(self, props, msg): """ for prop in NORMAL_PROPS: if prop in props and props[prop] is not None: - if isinstance(props[prop], six.string_types): + if isinstance(props[prop], str): setattr(msg.props, prop, str_to_bytes(props[prop])) else: setattr(msg.props, prop, props[prop]) @@ -321,7 +317,7 @@ def encode_bucket_props(self, props, msg): if prop in props and props[prop] not in (None, 'default'): value = self.encode_quorum(props[prop]) if value is not None: - if isinstance(value, six.string_types): + if isinstance(value, str): setattr(msg.props, prop, str_to_bytes(value)) else: setattr(msg.props, prop, value) @@ -508,13 +504,12 @@ def decode_index_req(self, resp, index, for pair in resp.results] else: results = resp.keys[:] - if six.PY3: - results = [bytes_to_str(key) for key in resp.keys] + results = [bytes_to_str(key) for key in resp.keys] if max_results is not None and resp.HasField('continuation'): - return (results, bytes_to_str(resp.continuation)) + return results, bytes_to_str(resp.continuation) else: - return (results, None) + return results, None def decode_search_index(self, index): """ @@ -524,8 +519,7 @@ def decode_search_index(self, index): :type index: riak.pb.riak_yokozuna_pb2.RpbYokozunaIndex :rtype dict """ - result = {} - result['name'] = bytes_to_str(index.name) + result = {'name': bytes_to_str(index.name)} if index.HasField('schema'): result['schema'] = bytes_to_str(index.schema) if index.HasField('n_val'): @@ -565,12 +559,8 @@ def encode_search_query(self, req, **kwargs): def decode_search_doc(self, doc): resultdoc = MultiDict() for pair in doc.fields: - if six.PY2: - ukey = str(pair.key, 'utf-8') # noqa - uval = str(pair.value, 'utf-8') # noqa - else: - ukey = bytes_to_str(pair.key) - uval = bytes_to_str(pair.value) + ukey = bytes_to_str(pair.key) + uval = bytes_to_str(pair.value) resultdoc.add(ukey, uval) return resultdoc.mixed() @@ -704,13 +694,13 @@ def encode_to_ts_cell(self, cell, ts_cell): ts_cell.timestamp_value = unix_time_millis(cell) elif isinstance(cell, bool): ts_cell.boolean_value = cell - elif isinstance(cell, six.binary_type): + elif isinstance(cell, bytes): ts_cell.varchar_value = cell - elif isinstance(cell, six.text_type): + elif isinstance(cell, str): ts_cell.varchar_value = str_to_bytes(cell) - elif isinstance(cell, six.string_types): + elif isinstance(cell, str): ts_cell.varchar_value = str_to_bytes(cell) - elif (isinstance(cell, six.integer_types)): + elif (isinstance(cell, int)): ts_cell.sint64_value = cell elif isinstance(cell, float): ts_cell.double_value = cell diff --git a/riak/codecs/ttb.py b/riak/codecs/ttb.py index 70a8b6fc..3dd632d4 100644 --- a/riak/codecs/ttb.py +++ b/riak/codecs/ttb.py @@ -13,7 +13,6 @@ # limitations under the License. import datetime -import six from erlastic import encode, decode from erlastic.types import Atom @@ -74,11 +73,11 @@ def encode_to_ts_cell(self, cell): return ts elif isinstance(cell, bool): return cell - elif isinstance(cell, six.text_type) or \ - isinstance(cell, six.binary_type) or \ - isinstance(cell, six.string_types): + elif isinstance(cell, str) or \ + isinstance(cell, bytes) or \ + isinstance(cell, str): return cell - elif (isinstance(cell, six.integer_types)): + elif (isinstance(cell, int)): return cell elif isinstance(cell, float): return cell diff --git a/riak/content.py b/riak/content.py index 6eb9e7df..0847d4fc 100644 --- a/riak/content.py +++ b/riak/content.py @@ -13,7 +13,6 @@ # limitations under the License. from riak import RiakError -from six import string_types class RiakContent(object): @@ -79,7 +78,7 @@ def _serialize(self, value): encoder = self._robject.bucket.get_encoder(self.content_type) if encoder: return encoder(value) - elif isinstance(value, string_types): + elif isinstance(value, str): return value.encode() else: raise TypeError('No encoder for non-string data ' diff --git a/riak/datatypes/counter.py b/riak/datatypes/counter.py index b57ac9d0..1c46763d 100644 --- a/riak/datatypes/counter.py +++ b/riak/datatypes/counter.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import six - from riak.datatypes.datatype import Datatype from riak.datatypes import TYPES @@ -70,7 +68,7 @@ def decrement(self, amount=1): self._increment -= amount def _check_type(self, new_value): - return isinstance(new_value, six.integer_types) + return isinstance(new_value, int) TYPES['counter'] = Counter diff --git a/riak/datatypes/hll.py b/riak/datatypes/hll.py index 1d962731..e261b1a6 100644 --- a/riak/datatypes/hll.py +++ b/riak/datatypes/hll.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import six from .datatype import Datatype from riak.datatypes import TYPES @@ -67,7 +66,7 @@ def add(self, element): :param element: the element to add :type element: str """ - if not isinstance(element, six.string_types): + if not isinstance(element, str): raise TypeError("Hll elements can only be strings") self._adds.add(element) @@ -75,7 +74,7 @@ def _coerce_value(self, new_value): return int(new_value) def _check_type(self, new_value): - return isinstance(new_value, six.integer_types) + return isinstance(new_value, int) TYPES['hll'] = Hll diff --git a/riak/datatypes/register.py b/riak/datatypes/register.py index 247a2a52..b9c347f3 100644 --- a/riak/datatypes/register.py +++ b/riak/datatypes/register.py @@ -14,7 +14,6 @@ from collections import Sized from riak.datatypes.datatype import Datatype -from six import string_types from riak.datatypes import TYPES @@ -73,7 +72,7 @@ def __len__(self): return len(self.value) def _check_type(self, new_value): - return isinstance(new_value, string_types) + return isinstance(new_value, str) TYPES['register'] = Register diff --git a/riak/datatypes/set.py b/riak/datatypes/set.py index 19829cf3..1dadde94 100644 --- a/riak/datatypes/set.py +++ b/riak/datatypes/set.py @@ -15,7 +15,6 @@ import collections from .datatype import Datatype -from six import string_types from riak.datatypes import TYPES __all__ = ['Set'] @@ -119,13 +118,13 @@ def _check_type(self, new_value): if not isinstance(new_value, collections.Iterable): return False for element in new_value: - if not isinstance(element, string_types): + if not isinstance(element, str): return False return True def _check_element(element): - if not isinstance(element, string_types): + if not isinstance(element, str): raise TypeError("Set elements can only be strings") diff --git a/riak/mapreduce.py b/riak/mapreduce.py index b6363eb3..66abc568 100644 --- a/riak/mapreduce.py +++ b/riak/mapreduce.py @@ -17,7 +17,6 @@ from collections import Iterable, namedtuple -from six import string_types, PY2 import riak @@ -104,7 +103,7 @@ def add_bucket_key_data(self, bucket, key, data, bucket_type=None): raise ValueError('Already added a query, can\'t add an object.') else: if isinstance(key, Iterable) and \ - not isinstance(key, string_types): + not isinstance(key, str): if bucket_type is not None: for k in key: self._inputs.append([bucket, k, data, bucket_type]) @@ -554,12 +553,6 @@ def __init__(self, type, function, language, keep, arg): reduce function. :type arg: string, dict, list """ - try: - if isinstance(function, string_types) and PY2: - function = function.encode('ascii') - except UnicodeError: - raise TypeError('Unicode encoded functions are not supported.') - self._type = type self._language = language self._function = function @@ -581,7 +574,7 @@ def to_array(self): if isinstance(self._function, list): stepdef['bucket'] = self._function[0] stepdef['key'] = self._function[1] - elif isinstance(self._function, string_types): + elif isinstance(self._function, str): if ("{" in self._function): stepdef['source'] = self._function else: @@ -592,7 +585,7 @@ def to_array(self): stepdef['function'] = self._function[1] elif (self._language == 'erlang' and - isinstance(self._function, string_types)): + isinstance(self._function, str)): stepdef['source'] = self._function return {self._type: stepdef} diff --git a/riak/riak_object.py b/riak/riak_object.py index ab9650ca..baaee607 100644 --- a/riak/riak_object.py +++ b/riak/riak_object.py @@ -15,7 +15,6 @@ from riak import ConflictError from riak.content import RiakContent import base64 -from six import string_types, PY2 from riak.mapreduce import RiakMapReduce @@ -62,27 +61,15 @@ class VClock(object): """ A representation of a vector clock received from Riak. """ + _decoders = { + 'base64': base64.b64decode, + 'binary': bytes + } - if PY2: - _decoders = { - 'base64': base64.b64decode, - 'binary': str - } - - _encoders = { - 'base64': base64.b64encode, - 'binary': str - } - else: - _decoders = { - 'base64': base64.b64decode, - 'binary': bytes - } - - _encoders = { - 'base64': base64.b64encode, - 'binary': bytes - } + _encoders = { + 'base64': base64.b64encode, + 'binary': bytes + } def __init__(self, value, encoding): self._vclock = self._decoders[encoding].__call__(value) @@ -116,13 +103,6 @@ def __init__(self, client, bucket, key=None): is generated by the server when :func:`store` is called. :type key: string """ - if PY2: - try: - if isinstance(key, string_types): - key = key.encode('ascii') - except UnicodeError: - raise TypeError('Unicode keys are not supported.') - if key is not None and len(key) == 0: raise ValueError('Key name must either be "None"' ' or a non-empty string.') diff --git a/riak/table.py b/riak/table.py index d4006503..bcbb62e2 100644 --- a/riak/table.py +++ b/riak/table.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from six import string_types, PY2 - class Table(object): """ @@ -30,15 +28,9 @@ def __init__(self, client, name): :param name: The table's name :type name: string """ - if not isinstance(name, string_types): + if not isinstance(name, str): raise TypeError('Table name must be a string') - if PY2: - try: - name = name.encode('ascii') - except UnicodeError: - raise TypeError('Unicode table names are not supported.') - self._client = client self.name = name diff --git a/riak/test_server.py b/riak/test_server.py index a2e0b8b8..cf7f2bfe 100644 --- a/riak/test_server.py +++ b/riak/test_server.py @@ -24,7 +24,6 @@ import stat from subprocess import Popen, PIPE from riak.util import deep_merge -from six import string_types try: bytes @@ -52,7 +51,7 @@ def __lt__(self, other): def erlang_config(hash, depth=1): def printable(item): k, v = item - if isinstance(v, string_types): + if isinstance(v, str): p = '"%s"' % v elif isinstance(v, dict): p = erlang_config(v, depth + 1) diff --git a/riak/tests/base.py b/riak/tests/base.py index 9aaf4e69..66481579 100644 --- a/riak/tests/base.py +++ b/riak/tests/base.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import logging import random import riak diff --git a/riak/tests/comparison.py b/riak/tests/comparison.py index 3276fbe5..2473fa3e 100644 --- a/riak/tests/comparison.py +++ b/riak/tests/comparison.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- -from six import PY2, PY3 import collections import warnings @@ -24,111 +22,107 @@ class Comparison(object): since its name changed between Python 2.x and Python 3.x ''' - if PY3: - # Stolen from Python 2.7.8's unittest - _Mismatch = collections.namedtuple('Mismatch', 'actual expected value') + # Stolen from Python 2.7.8's unittest + _Mismatch = collections.namedtuple('Mismatch', 'actual expected value') - def _count_diff_all_purpose(self, actual, expected): - ''' - Returns list of (cnt_act, cnt_exp, elem) - triples where the counts differ - ''' - # elements need not be hashable - s, t = list(actual), list(expected) - m, n = len(s), len(t) - NULL = object() - result = [] - for i, elem in enumerate(s): - if elem is NULL: - continue - cnt_s = cnt_t = 0 - for j in range(i, m): - if s[j] == elem: - cnt_s += 1 - s[j] = NULL - for j, other_elem in enumerate(t): - if other_elem == elem: - cnt_t += 1 - t[j] = NULL - if cnt_s != cnt_t: - diff = self._Mismatch(cnt_s, cnt_t, elem) - result.append(diff) + def _count_diff_all_purpose(self, actual, expected): + ''' + Returns list of (cnt_act, cnt_exp, elem) + triples where the counts differ + ''' + # elements need not be hashable + s, t = list(actual), list(expected) + m, n = len(s), len(t) + NULL = object() + result = [] + for i, elem in enumerate(s): + if elem is NULL: + continue + cnt_s = cnt_t = 0 + for j in range(i, m): + if s[j] == elem: + cnt_s += 1 + s[j] = NULL + for j, other_elem in enumerate(t): + if other_elem == elem: + cnt_t += 1 + t[j] = NULL + if cnt_s != cnt_t: + diff = self._Mismatch(cnt_s, cnt_t, elem) + result.append(diff) + + for i, elem in enumerate(t): + if elem is NULL: + continue + cnt_t = 0 + for j in range(i, n): + if t[j] == elem: + cnt_t += 1 + t[j] = NULL + diff = self._Mismatch(0, cnt_t, elem) + result.append(diff) + return result - for i, elem in enumerate(t): - if elem is NULL: - continue - cnt_t = 0 - for j in range(i, n): - if t[j] == elem: - cnt_t += 1 - t[j] = NULL + def _count_diff_hashable(self, actual, expected): + ''' + Returns list of (cnt_act, cnt_exp, elem) triples + where the counts differ + ''' + # elements must be hashable + s, t = self._ordered_count(actual), self._ordered_count(expected) + result = [] + for elem, cnt_s in s.items(): + cnt_t = t.get(elem, 0) + if cnt_s != cnt_t: + diff = self._Mismatch(cnt_s, cnt_t, elem) + result.append(diff) + for elem, cnt_t in t.items(): + if elem not in s: diff = self._Mismatch(0, cnt_t, elem) result.append(diff) - return result - - def _count_diff_hashable(self, actual, expected): - ''' - Returns list of (cnt_act, cnt_exp, elem) triples - where the counts differ - ''' - # elements must be hashable - s, t = self._ordered_count(actual), self._ordered_count(expected) - result = [] - for elem, cnt_s in s.items(): - cnt_t = t.get(elem, 0) - if cnt_s != cnt_t: - diff = self._Mismatch(cnt_s, cnt_t, elem) - result.append(diff) - for elem, cnt_t in t.items(): - if elem not in s: - diff = self._Mismatch(0, cnt_t, elem) - result.append(diff) - return result + return result - def _ordered_count(self, iterable): - 'Return dict of element counts, in the order they were first seen' - c = collections.OrderedDict() - for elem in iterable: - c[elem] = c.get(elem, 0) + 1 - return c + def _ordered_count(self, iterable): + 'Return dict of element counts, in the order they were first seen' + c = collections.OrderedDict() + for elem in iterable: + c[elem] = c.get(elem, 0) + 1 + return c - def assertItemsEqual(self, expected_seq, actual_seq, msg=None): - """An unordered sequence specific comparison. It asserts that - actual_seq and expected_seq have the same element counts. - Equivalent to:: + def assertItemsEqual(self, expected_seq, actual_seq, msg=None): + """An unordered sequence specific comparison. It asserts that + actual_seq and expected_seq have the same element counts. + Equivalent to:: - self.assertEqual(Counter(iter(actual_seq)), - Counter(iter(expected_seq))) + self.assertEqual(Counter(iter(actual_seq)), + Counter(iter(expected_seq))) - Asserts that each element has the same count in both sequences. - Example: - - [0, 1, 1] and [1, 0, 1] compare equal. - - [0, 0, 1] and [0, 1] compare unequal. - """ - first_seq, second_seq = list(expected_seq), list(actual_seq) - with warnings.catch_warnings(): - try: - first = collections.Counter(first_seq) - second = collections.Counter(second_seq) - except TypeError: - # Handle case with unhashable elements - differences = self._count_diff_all_purpose(first_seq, - second_seq) - else: - if first == second: - return - differences = self._count_diff_hashable(first_seq, - second_seq) + Asserts that each element has the same count in both sequences. + Example: + - [0, 1, 1] and [1, 0, 1] compare equal. + - [0, 0, 1] and [0, 1] compare unequal. + """ + first_seq, second_seq = list(expected_seq), list(actual_seq) + with warnings.catch_warnings(): + try: + first = collections.Counter(first_seq) + second = collections.Counter(second_seq) + except TypeError: + # Handle case with unhashable elements + differences = self._count_diff_all_purpose(first_seq, + second_seq) + else: + if first == second: + return + differences = self._count_diff_hashable(first_seq, + second_seq) - if differences: - standardMsg = 'Element counts were not equal:\n' - lines = ['First has %d, Second has %d: %r' % - diff for diff in differences] - diffMsg = '\n'.join(lines) - standardMsg = self._truncateMessage(standardMsg, diffMsg) + if differences: + standardMsg = 'Element counts were not equal:\n' + lines = ['First has %d, Second has %d: %r' % + diff for diff in differences] + diffMsg = '\n'.join(lines) + standardMsg = self._truncateMessage(standardMsg, diffMsg) def assert_raises_regex(self, exception, regexp): - if PY2: - return self.assertRaisesRegex(exception, regexp) - else: - return self.assertRaisesRegex(exception, regexp) + return self.assertRaisesRegex(exception, regexp) diff --git a/riak/tests/pool-grinder.py b/riak/tests/pool-grinder.py index d65b3fb1..7d2bab34 100755 --- a/riak/tests/pool-grinder.py +++ b/riak/tests/pool-grinder.py @@ -14,16 +14,12 @@ # limitations under the License. -from six import PY2 from threading import Thread import sys -from pool import Pool +from multiprocessing import Pool from random import SystemRandom from time import sleep -if PY2: - from queue import Queue -else: - from queue import Queue +from queue import Queue sys.path.append("../transports/") diff --git a/riak/tests/test_2i.py b/riak/tests/test_2i.py index 01f02aee..cf10a2a2 100644 --- a/riak/tests/test_2i.py +++ b/riak/tests/test_2i.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import unittest from riak import RiakError diff --git a/riak/tests/test_client.py b/riak/tests/test_client.py index 88ef1ae0..96fd524b 100644 --- a/riak/tests/test_client.py +++ b/riak/tests/test_client.py @@ -14,7 +14,6 @@ import unittest -from six import PY2 from threading import Thread from riak.riak_object import RiakObject from riak.transports.tcp import TcpTransport @@ -22,10 +21,7 @@ RUN_POOL, RUN_CLIENT from riak.tests.base import IntegrationTestBase -if PY2: - from queue import Queue -else: - from queue import Queue +from queue import Queue @unittest.skipUnless(RUN_CLIENT, 'RUN_CLIENT is 0') @@ -146,22 +142,14 @@ def test_multiget_bucket(self): """ keys = [self.key_name, self.randname(), self.randname()] for key in keys: - if PY2: - self.client.bucket(self.bucket_name)\ - .new(key, encoded_data=key, content_type="text/plain")\ - .store() - else: - self.client.bucket(self.bucket_name)\ - .new(key, data=key, - content_type="text/plain").store() + self.client.bucket(self.bucket_name)\ + .new(key, data=key, + content_type="text/plain").store() results = self.client.bucket(self.bucket_name).multiget(keys) for obj in results: self.assertIsInstance(obj, RiakObject) self.assertTrue(obj.exists) - if PY2: - self.assertEqual(obj.key, obj.encoded_data) - else: - self.assertEqual(obj.key, obj.data) + self.assertEqual(obj.key, obj.data) def test_multiget_errors(self): """ @@ -177,10 +165,7 @@ def test_multiget_errors(self): self.assertEqual(failure[0], 'default') self.assertEqual(failure[1], self.bucket_name) self.assertIn(failure[2], keys) - if PY2: - self.assertIsInstance(failure[3], Exception) # noqa - else: - self.assertIsInstance(failure[3], Exception) + self.assertIsInstance(failure[3], Exception) client.close() def test_multiput_errors(self): @@ -195,13 +180,8 @@ def test_multiput_errors(self): k2 = self.randname() o1 = RiakObject(client, bucket, k1) o2 = RiakObject(client, bucket, k2) - - if PY2: - o1.encoded_data = k1 - o2.encoded_data = k2 - else: - o1.data = k1 - o2.data = k2 + o1.data = k1 + o2.data = k2 objs = [o1, o2] for robj in objs: @@ -211,10 +191,7 @@ def test_multiput_errors(self): for failure in results: self.assertIsInstance(failure, tuple) self.assertIsInstance(failure[0], RiakObject) - if PY2: - self.assertIsInstance(failure[1], Exception) # noqa - else: - self.assertIsInstance(failure[1], Exception) + self.assertIsInstance(failure[1], Exception) client.close() def test_multiget_notfounds(self): @@ -238,23 +215,15 @@ def test_multiget_pool_size(self): keys = [self.key_name, self.randname(), self.randname()] for key in keys: - if PY2: - client.bucket(self.bucket_name)\ - .new(key, encoded_data=key, content_type="text/plain")\ - .store() - else: - client.bucket(self.bucket_name)\ - .new(key, data=key, content_type="text/plain")\ - .store() + client.bucket(self.bucket_name)\ + .new(key, data=key, content_type="text/plain")\ + .store() results = client.bucket(self.bucket_name).multiget(keys) for obj in results: self.assertIsInstance(obj, RiakObject) self.assertTrue(obj.exists) - if PY2: - self.assertEqual(obj.key, obj.encoded_data) - else: - self.assertEqual(obj.key, obj.data) + self.assertEqual(obj.key, obj.data) client.close() def test_multiput_pool_size(self): @@ -271,12 +240,8 @@ def test_multiput_pool_size(self): o1 = RiakObject(client, bucket, k1) o2 = RiakObject(client, bucket, k2) - if PY2: - o1.encoded_data = k1 - o2.encoded_data = k2 - else: - o1.data = k1 - o2.data = k2 + o1.data = k1 + o2.data = k2 objs = [o1, o2] for robj in objs: @@ -287,10 +252,7 @@ def test_multiput_pool_size(self): self.assertIsInstance(obj, RiakObject) self.assertTrue(obj.exists) self.assertEqual(obj.content_type, 'text/plain') - if PY2: - self.assertEqual(obj.key, obj.encoded_data) - else: - self.assertEqual(obj.key, obj.data) + self.assertEqual(obj.key, obj.data) client.close() def test_multiput_pool_options(self): @@ -304,12 +266,8 @@ def test_multiput_pool_options(self): o1 = RiakObject(client, bucket, k1) o2 = RiakObject(client, bucket, k2) - if PY2: - o1.encoded_data = k1 - o2.encoded_data = k2 - else: - o1.data = k1 - o2.data = k2 + o1.data = k1 + o2.data = k2 objs = [o1, o2] for robj in objs: diff --git a/riak/tests/test_comparison.py b/riak/tests/test_comparison.py index 8aac4ef8..ee30ee85 100644 --- a/riak/tests/test_comparison.py +++ b/riak/tests/test_comparison.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import unittest from riak.riak_object import RiakObject diff --git a/riak/tests/test_datatypes.py b/riak/tests/test_datatypes.py index 17aa4bf2..17f37a5b 100644 --- a/riak/tests/test_datatypes.py +++ b/riak/tests/test_datatypes.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import unittest import riak.datatypes as datatypes diff --git a/riak/tests/test_datetime.py b/riak/tests/test_datetime.py index f3367179..1bc74f80 100644 --- a/riak/tests/test_datetime.py +++ b/riak/tests/test_datetime.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import datetime import unittest diff --git a/riak/tests/test_feature_detection.py b/riak/tests/test_feature_detection.py index bf0c0c7b..39d37cda 100644 --- a/riak/tests/test_feature_detection.py +++ b/riak/tests/test_feature_detection.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import unittest from riak.transports.feature_detect import FeatureDetection diff --git a/riak/tests/test_filters.py b/riak/tests/test_filters.py index f4a77db0..5ca4f7e5 100644 --- a/riak/tests/test_filters.py +++ b/riak/tests/test_filters.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import unittest from riak.mapreduce import RiakKeyFilter diff --git a/riak/tests/test_kv.py b/riak/tests/test_kv.py index 79b25917..46208c90 100644 --- a/riak/tests/test_kv.py +++ b/riak/tests/test_kv.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -18,7 +17,6 @@ import sys import unittest -from six import string_types, PY2, PY3 from time import sleep from riak import ConflictError, RiakError, ListError from riak import RiakClient, RiakBucket, BucketType @@ -28,18 +26,13 @@ from riak.tests.comparison import Comparison try: - import simplejson as json + import simplejson as json # todo: remove this, supports < p3.3 except ImportError: import json -if PY2: - import pickle - test_pickle_dumps = pickle.dumps - test_pickle_loads = pickle.loads -else: - import pickle - test_pickle_dumps = pickle.dumps - test_pickle_loads = pickle.loads +import pickle +test_pickle_dumps = pickle.dumps +test_pickle_loads = pickle.loads testrun_sibs_bucket = 'sibsbucket' @@ -163,34 +156,13 @@ def test_store_and_get(self): # unicode objects are fine, as long as they don't # contain any non-ASCII chars - if PY2: - self.client.bucket(str(self.bucket_name)) # noqa - else: - self.client.bucket(self.bucket_name) - if PY2: - self.assertRaises(TypeError, self.client.bucket, 'búcket') - self.assertRaises(TypeError, self.client.bucket, 'búcket') - else: - self.client.bucket(u'búcket') - self.client.bucket('búcket') + self.client.bucket(self.bucket_name) + self.client.bucket('búcket') bucket.get('foo') - if PY2: - self.assertRaises(TypeError, bucket.get, 'føø') - self.assertRaises(TypeError, bucket.get, 'føø') - - self.assertRaises(TypeError, bucket.new, 'foo', 'éå') - self.assertRaises(TypeError, bucket.new, 'foo', 'éå') - self.assertRaises(TypeError, bucket.new, 'foo', 'éå') - self.assertRaises(TypeError, bucket.new, 'foo', 'éå') - else: - bucket.get(u'føø') - bucket.get('føø') - - bucket.new(u'foo', 'éå') - bucket.new(u'foo', 'éå') - bucket.new('foo', u'éå') - bucket.new('foo', u'éå') + bucket.get('føø') + + bucket.new(u'foo', 'éå') obj2 = bucket.new('baz', rand, 'application/json') obj2.charset = 'UTF-8' @@ -225,16 +197,7 @@ def test_string_bucket_name(self): with self.assert_raises_regex(TypeError, 'must be a string'): RiakBucket(self.client, bad, None) - # Unicode bucket names are not supported in Python 2.x, - # if they can't be encoded to ASCII. This should be changed in a - # future release. - if PY2: - with self.assert_raises_regex(TypeError, - 'Unicode bucket names ' - 'are not supported'): - self.client.bucket('føø') - else: - self.client.bucket(u'føø') + self.client.bucket('føø') # This is fine, since it's already ASCII self.client.bucket('ASCII') @@ -272,7 +235,7 @@ def test_stream_keys(self): for keylist in bucket.stream_keys(): self.assertNotEqual([], keylist) for key in keylist: - self.assertIsInstance(key, string_types) + self.assertIsInstance(key, str) streamed_keys += keylist self.assertEqual(sorted(regular_keys), sorted(streamed_keys)) @@ -284,7 +247,7 @@ def test_stream_keys_timeout(self): for keylist in self.client.stream_keys(bucket, timeout=1): self.assertNotEqual([], keylist) for key in keylist: - self.assertIsInstance(key, string_types) + self.assertIsInstance(key, str) streamed_keys += keylist def test_stream_keys_abort(self): @@ -319,10 +282,7 @@ def test_binary_store_and_get(self): bucket = self.client.bucket(self.bucket_name) # Store as binary, retrieve as binary, then compare... rand = str(self.randint()) - if PY2: - rand = bytes(rand) - else: - rand = bytes(rand, 'utf-8') + rand = bytes(rand, 'utf-8') obj = bucket.new(self.key_name, encoded_data=rand, content_type='text/plain') obj.store() @@ -342,10 +302,7 @@ def test_blank_binary_204(self): # this should *not* raise an error empty = "" - if PY2: - empty = bytes(empty) - else: - empty = bytes(empty, 'utf-8') + empty = bytes(empty, 'utf-8') obj = bucket.new('foo2', encoded_data=empty, content_type='text/plain') obj.store() obj = bucket.get('foo2') @@ -378,9 +335,7 @@ def test_unknown_content_type_encoder_decoder(self): # Bypass the content_type encoders bucket = self.client.bucket(self.bucket_name) data = "some funny data" - if PY3: - # Python 3.x needs to store binaries - data = data.encode() + data = data.encode() obj = bucket.new(self.key_name, encoded_data=data, content_type='application/x-frobnicator') @@ -605,17 +560,11 @@ def test_store_of_missing_object(self): # for binary objects o = bucket.get(self.randname()) self.assertEqual(o.exists, False) - if PY2: - o.encoded_data = "1234567890" - else: - o.encoded_data = "1234567890".encode() + o.encoded_data = "1234567890".encode() o.content_type = 'application/octet-stream' o = o.store() - if PY2: - self.assertEqual(o.encoded_data, "1234567890") - else: - self.assertEqual(o.encoded_data, "1234567890".encode()) + self.assertEqual(o.encoded_data, "1234567890".encode()) self.assertEqual(o.content_type, "application/octet-stream") o.delete() diff --git a/riak/tests/test_mapreduce.py b/riak/tests/test_mapreduce.py index b2fab7f9..c0e5382a 100644 --- a/riak/tests/test_mapreduce.py +++ b/riak/tests/test_mapreduce.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -17,7 +16,6 @@ import unittest -from six import PY2 from riak.mapreduce import RiakMapReduce from riak import key_filter, RiakClient, RiakError, ListError from riak.tests import RUN_MAPREDUCE, RUN_SECURITY, RUN_YZ @@ -51,20 +49,12 @@ class LinkTests(IntegrationTestBase, unittest.TestCase): def test_store_and_get_links(self): # Create the object... bucket = self.client.bucket(self.bucket_name) - if PY2: - bucket.new(key=self.key_name, encoded_data='2', - content_type='application/octet-stream') \ - .add_link(bucket.new("foo1")) \ - .add_link(bucket.new("foo2"), "tag") \ - .add_link(bucket.new("foo3"), "tag2!@#%^&*)") \ - .store() - else: - bucket.new(key=self.key_name, data='2', - content_type='application/octet-stream') \ - .add_link(bucket.new("foo1")) \ - .add_link(bucket.new("foo2"), "tag") \ - .add_link(bucket.new("foo3"), "tag2!@#%^&*)") \ - .store() + bucket.new(key=self.key_name, data='2', + content_type='application/octet-stream') \ + .add_link(bucket.new("foo1")) \ + .add_link(bucket.new("foo2"), "tag") \ + .add_link(bucket.new("foo3"), "tag2!@#%^&*)") \ + .store() obj = bucket.get(self.key_name) links = obj.links self.assertEqual(len(links), 3) @@ -240,29 +230,12 @@ def test_javascript_source_map(self): # test ASCII-encodable unicode is accepted mr.map("function (v) { return [JSON.parse(v.values[0].data)]; }") - # test non-ASCII-encodable unicode is rejected in Python 2.x - if PY2: - self.assertRaises(TypeError, mr.map, - """ - function (v) { - /* æ */ - return [JSON.parse(v.values[0].data)]; - }""") - else: - mr = self.client.add(self.bucket_name, "foo") - result = mr.map("""function (v) { - /* æ */ - return [JSON.parse(v.values[0].data)]; - }""").run() - self.assertEqual(result, [2]) - - # test non-ASCII-encodable string is rejected in Python 2.x - if PY2: - self.assertRaises(TypeError, mr.map, - """function (v) { - /* æ */ - return [JSON.parse(v.values[0].data)]; - }""") + mr = self.client.add(self.bucket_name, "foo") + result = mr.map("""function (v) { + /* æ */ + return [JSON.parse(v.values[0].data)]; + }""").run() + self.assertEqual(result, [2]) def test_javascript_named_map(self): # Create the object... @@ -593,16 +566,10 @@ class MapReduceAliasTests(IntegrationTestBase, unittest.TestCase): def test_map_values(self): # Add a value to the bucket bucket = self.client.bucket(self.bucket_name) - if PY2: - bucket.new('one', encoded_data='value_1', - content_type='text/plain').store() - bucket.new('two', encoded_data='value_2', - content_type='text/plain').store() - else: - bucket.new('one', data='value_1', - content_type='text/plain').store() - bucket.new('two', data='value_2', - content_type='text/plain').store() + bucket.new('one', data='value_1', + content_type='text/plain').store() + bucket.new('two', data='value_2', + content_type='text/plain').store() # Create a map reduce object and use one and two as inputs mr = self.client.add(self.bucket_name, 'one')\ @@ -814,7 +781,4 @@ def test_stream_cleanoperationsup(self): # This should not raise an exception obj = bucket.get('one') - if PY2: - self.assertEqual('1', obj.encoded_data) - else: - self.assertEqual(b'1', obj.encoded_data) + self.assertEqual(b'1', obj.encoded_data) diff --git a/riak/tests/test_pool.py b/riak/tests/test_pool.py index c07110ba..d68002fe 100644 --- a/riak/tests/test_pool.py +++ b/riak/tests/test_pool.py @@ -12,10 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import unittest -from six import PY2 from threading import Thread, currentThread from random import SystemRandom from time import sleep @@ -25,10 +23,7 @@ from riak.tests.comparison import Comparison from riak.transports.pool import Pool, BadResource -if PY2: - from queue import Queue -else: - from queue import Queue +from queue import Queue class SimplePool(Pool): diff --git a/riak/tests/test_security.py b/riak/tests/test_security.py index d9e1ee10..ae87c980 100644 --- a/riak/tests/test_security.py +++ b/riak/tests/test_security.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -# -*- coding: utf-8 -*- import sys import unittest diff --git a/riak/tests/test_timeseries_pbuf.py b/riak/tests/test_timeseries_pbuf.py index 8cffa1c7..653d5b2f 100644 --- a/riak/tests/test_timeseries_pbuf.py +++ b/riak/tests/test_timeseries_pbuf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/riak/tests/test_timeseries_ttb.py b/riak/tests/test_timeseries_ttb.py index d2434799..074a75b6 100644 --- a/riak/tests/test_timeseries_ttb.py +++ b/riak/tests/test_timeseries_ttb.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/riak/tests/test_yokozuna.py b/riak/tests/test_yokozuna.py index 587bd282..a0cef3eb 100644 --- a/riak/tests/test_yokozuna.py +++ b/riak/tests/test_yokozuna.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # Copyright 2010-present Basho Technologies, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/riak/transports/http/__init__.py b/riak/transports/http/__init__.py index e911f967..7f833b67 100644 --- a/riak/transports/http/__init__.py +++ b/riak/transports/http/__init__.py @@ -15,7 +15,6 @@ import socket import select -from six import PY2 from riak.security import SecurityError, USE_STDLIB_SSL from riak.transports.pool import Pool from riak.transports.http.transport import HttpTransport @@ -28,20 +27,12 @@ from riak.transports.security import RiakWrappedSocket,\ configure_pyopenssl_context -if PY2: - from http.client import HTTPConnection, \ - NotConnected, \ - IncompleteRead, \ - ImproperConnectionState, \ - BadStatusLine, \ - HTTPSConnection -else: - from http.client import HTTPConnection, \ - HTTPSConnection, \ - NotConnected, \ - IncompleteRead, \ - ImproperConnectionState, \ - BadStatusLine +from http.client import HTTPConnection, \ + HTTPSConnection, \ + NotConnected, \ + IncompleteRead, \ + ImproperConnectionState, \ + BadStatusLine class NoNagleHTTPConnection(HTTPConnection): @@ -84,28 +75,11 @@ def __init__(self, :param timeout: Number of seconds before timing out :type timeout: int """ - if PY2: - # NB: it appears that pkey_file / cert_file are never set - # in riak/transports/http/connection.py#_connect() method - pkf = pkey_file - if pkf is None and credentials is not None: - pkf = credentials._pkey_file - - cf = cert_file - if cf is None and credentials is not None: - cf = credentials._cert_file - - HTTPSConnection.__init__(self, - host, - port, - key_file=pkf, - cert_file=cf) - else: - super(RiakHTTPSConnection, self). \ - __init__(host=host, - port=port, - key_file=credentials._pkey_file, - cert_file=credentials._cert_file) + super(RiakHTTPSConnection, self). \ + __init__(host=host, + port=port, + key_file=credentials._pkey_file, + cert_file=credentials._cert_file) self.pkey_file = pkey_file self.cert_file = cert_file self.credentials = credentials diff --git a/riak/transports/http/connection.py b/riak/transports/http/connection.py index 48b4b4eb..075dcaef 100644 --- a/riak/transports/http/connection.py +++ b/riak/transports/http/connection.py @@ -14,13 +14,9 @@ import base64 -from six import PY2 from riak.util import str_to_bytes -if PY2: - from http.client import NotConnected, HTTPConnection -else: - from http.client import NotConnected, HTTPConnection +from http.client import NotConnected, HTTPConnection class HttpConnection(object): diff --git a/riak/transports/http/resources.py b/riak/transports/http/resources.py index 9ab56563..2ca66861 100644 --- a/riak/transports/http/resources.py +++ b/riak/transports/http/resources.py @@ -14,14 +14,10 @@ import re -from six import PY2 from riak import RiakError from riak.util import lazy_property, bytes_to_str -if PY2: - from urllib.parse import quote_plus, urlencode -else: - from urllib.parse import quote_plus, urlencode +from urllib.parse import quote_plus, urlencode class HttpResources(object): @@ -290,10 +286,7 @@ def mkpath(*segments, **query): if query[key] in [False, True]: _query[key] = str(query[key]).lower() elif query[key] is not None: - if PY2 and isinstance(query[key], str): # noqa - _query[key] = query[key].encode('utf-8') - else: - _query[key] = query[key] + _query[key] = query[key] if len(_query) > 0: pathstring += "?" + urlencode(_query) diff --git a/riak/transports/http/stream.py b/riak/transports/http/stream.py index 95236973..82810890 100644 --- a/riak/transports/http/stream.py +++ b/riak/transports/http/stream.py @@ -20,7 +20,6 @@ from riak.util import decode_index_value from riak.client.index_page import CONTINUATION from riak import RiakError -from six import PY2 class HttpStream(object): @@ -41,14 +40,9 @@ def __iter__(self): def _read(self): chunk = self.response.read(self.BLOCK_SIZE) - if PY2: - if chunk == '': - self.response_done = True - self.buffer += chunk - else: - if chunk == b'': - self.response_done = True - self.buffer += chunk.decode('utf-8') + if chunk == b'': + self.response_done = True + self.buffer += chunk.decode('utf-8') def __next__(self): raise NotImplementedError diff --git a/riak/transports/http/transport.py b/riak/transports/http/transport.py index a5decc0d..d0680062 100644 --- a/riak/transports/http/transport.py +++ b/riak/transports/http/transport.py @@ -17,7 +17,6 @@ except ImportError: import json -from six import PY2 from xml.dom.minidom import Document from riak import RiakError @@ -33,10 +32,7 @@ from riak.security import SecurityError from riak.util import decode_index_value, bytes_to_str, str_to_long -if PY2: - from http.client import HTTPConnection -else: - from http.client import HTTPConnection +from http.client import HTTPConnection class HttpTransport(Transport, @@ -154,10 +150,7 @@ def put(self, robj, w=None, dw=None, pw=None, return_body=True, bucket_type=bucket_type, **params) headers = self._build_put_headers(robj, if_none_match=if_none_match) - if PY2: - content = bytearray(robj.encoded_data) - else: - content = robj.encoded_data + content = robj.encoded_data if robj.key is None: expect = [201] diff --git a/riak/transports/tcp/connection.py b/riak/transports/tcp/connection.py index 13c02cf4..65805d86 100644 --- a/riak/transports/tcp/connection.py +++ b/riak/transports/tcp/connection.py @@ -16,7 +16,6 @@ import logging import socket import struct -import six import riak.pb.riak_pb2 import riak.pb.messages @@ -255,7 +254,7 @@ def _connect(self): self._socket = socket.create_connection(self._address) if self._socket_tcp_options: ka_opts = self._socket_tcp_options - for k, v in six.iteritems(ka_opts): + for k, v in ka_opts.items(): self._socket.setsockopt(socket.SOL_TCP, k, v) if self._socket_keepalive: self._socket.setsockopt( diff --git a/riak/transports/tcp/stream.py b/riak/transports/tcp/stream.py index db2322af..b8c2bed3 100644 --- a/riak/transports/tcp/stream.py +++ b/riak/transports/tcp/stream.py @@ -19,7 +19,6 @@ from riak.util import decode_index_value, bytes_to_str from riak.client.index_page import CONTINUATION from riak.codecs.ttb import TtbCodec -from six import PY2 class PbufStream(object): @@ -173,10 +172,7 @@ def __next__(self): bytes_to_str(r.value)) for r in response.results] elif response.keys: - if PY2: - return response.keys[:] - else: - return [bytes_to_str(key) for key in response.keys] + return [bytes_to_str(key) for key in response.keys] elif response.continuation: return CONTINUATION(bytes_to_str(response.continuation)) diff --git a/riak/transports/tcp/transport.py b/riak/transports/tcp/transport.py index 5bf0ab65..b3802681 100644 --- a/riak/transports/tcp/transport.py +++ b/riak/transports/tcp/transport.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -import six - import riak.pb.messages from riak import RiakError @@ -466,8 +464,6 @@ def search(self, index, query, **kwargs): # TODO FUTURE NUKE THIS MAPRED if not self.pb_search(): return self._search_mapred_emu(index, query) - if six.PY2 and isinstance(query, str): # noqa - query = query.encode('utf8') msg_code = riak.pb.messages.MSG_CODE_SEARCH_QUERY_REQ codec = self._get_codec(msg_code) msg = codec.encode_search(index, query, **kwargs) diff --git a/riak/transports/transport.py b/riak/transports/transport.py index 968b3067..f921ce1f 100644 --- a/riak/transports/transport.py +++ b/riak/transports/transport.py @@ -19,7 +19,6 @@ import json import platform -from six import PY2 from riak.transports.feature_detect import FeatureDetection @@ -43,13 +42,9 @@ def make_random_client_id(self): """ Returns a random client identifier """ - if PY2: - return ('py_%s' % - base64.b64encode(str(random.randint(1, 0x40000000)))) - else: - return ('py_%s' % - base64.b64encode(bytes(str(random.randint(1, 0x40000000)), - 'ascii'))) + return ('py_%s' % + base64.b64encode(bytes(str(random.randint(1, 0x40000000)), + 'ascii'))) @classmethod def make_fixed_client_id(self): diff --git a/riak/util.py b/riak/util.py index 46cfde8f..ecd78bd4 100644 --- a/riak/util.py +++ b/riak/util.py @@ -19,7 +19,6 @@ import warnings from collections import Mapping -from six import string_types, PY2 epoch = datetime.datetime.utcfromtimestamp(0) try: @@ -117,14 +116,12 @@ def __get__(self, obj, cls): def decode_index_value(index, value): if "_int" in bytes_to_str(index): return str_to_long(value) - elif PY2: - return str(value) else: return bytes_to_str(value) def bytes_to_str(value, encoding='utf-8'): - if isinstance(value, string_types) or value is None: + if isinstance(value, str) or value is None: return value elif isinstance(value, list): return [bytes_to_str(elem) for elem in value] @@ -133,7 +130,7 @@ def bytes_to_str(value, encoding='utf-8'): def str_to_bytes(value, encoding='utf-8'): - if PY2 or value is None: + if value is None: return value elif isinstance(value, list): return [str_to_bytes(elem) for elem in value] @@ -144,7 +141,5 @@ def str_to_bytes(value, encoding='utf-8'): def str_to_long(value, base=10): if value is None: return None - elif PY2: - return int(value, base) # noqa else: return int(value, base) From 35912554c45159bb83101071d6534c8a968dcdb4 Mon Sep 17 00:00:00 2001 From: Travis Woodruff Date: Thu, 12 Aug 2021 10:12:14 -0500 Subject: [PATCH 03/15] Don't use `encoding` in RiakBucket.new_from_file --- riak/bucket.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/riak/bucket.py b/riak/bucket.py index 4e96c462..c47f3b69 100644 --- a/riak/bucket.py +++ b/riak/bucket.py @@ -407,13 +407,9 @@ def new_from_file(self, key, filename): with open(filename, 'rb') as f: binary_data = f.read() mimetype, encoding = mimetypes.guess_type(filename) - if encoding: - binary_data = bytearray(binary_data, encoding) - else: - binary_data = bytearray(binary_data) if not mimetype: mimetype = 'application/octet-stream' - return self.new(key, encoded_data=bytes(binary_data), content_type=mimetype) + return self.new(key, encoded_data=binary_data, content_type=mimetype) def search_enabled(self): """ From 8678cbea6a0f135216afcddb37253e720e9c4ad4 Mon Sep 17 00:00:00 2001 From: Travis Woodruff Date: Thu, 12 Aug 2021 12:25:30 -0500 Subject: [PATCH 04/15] Remove python 2 from setup scripts --- Makefile | 8 +++-- commands.py | 22 +++--------- riak/benchmark.py | 2 -- riak/pb/riak_dt_pb2.py | 31 ++++++++--------- riak/pb/riak_kv_pb2.py | 66 +++++++++++++++++------------------- riak/pb/riak_pb2.py | 29 ++++++++-------- riak/pb/riak_search_pb2.py | 9 +++-- riak/pb/riak_ts_pb2.py | 39 +++++++++++---------- riak/pb/riak_yokozuna_pb2.py | 21 ++++++------ setup.py | 17 +++------- 10 files changed, 109 insertions(+), 135 deletions(-) diff --git a/Makefile b/Makefile index 166e4007..9f600a77 100644 --- a/Makefile +++ b/Makefile @@ -87,14 +87,18 @@ ifeq ("$(wildcard $(PROJDIR)/.python-version)","") $(error expected $(PROJDIR)/.python-version to exist. Run $(PROJDIR)/build/pyenv-setup) endif @echo "==> pypi repository: $(PYPI_REPOSITORY)" - @echo "==> Python 2.7 (bdist_egg)" - @python2.7 setup.py build --build-base=py-build/2.7 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) @echo "==> Python 3.3 (bdist_egg)" @python3.3 setup.py build --build-base=py-build/3.3 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) @echo "==> Python 3.4 (bdist_egg)" @python3.4 setup.py build --build-base=py-build/3.4 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) @echo "==> Python 3.5 (bdist_egg)" @python3.5 setup.py build --build-base=py-build/3.5 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) + @echo "==> Python 3.6 (bdist_egg)" + @python3.5 setup.py build --build-base=py-build/3.6 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) + @echo "==> Python 3.7 (bdist_egg)" + @python3.5 setup.py build --build-base=py-build/3.7 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) + @echo "==> Python 3.8 (bdist_egg)" + @python3.5 setup.py build --build-base=py-build/3.8 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) .PHONY: unit-test unit-test: diff --git a/commands.py b/commands.py index d4f63d20..6d29dcdf 100644 --- a/commands.py +++ b/commands.py @@ -309,7 +309,7 @@ def run(self): self._load_and_generate, []) def _load_and_generate(self): - self._format_python2_or_3() + self._update_pb_pathnames() self._load() self._generate() @@ -369,10 +369,9 @@ def _generate_mapping(self, m): pair = (self._linesep + ' ').join(pair.split(' ')) return pair - def _format_python2_or_3(self): + def _update_pb_pathnames(self): """ - Change the PB files to use full pathnames for Python 3.x - and modify the metaclasses to be version agnostic + Change the PB files to use full pathnames """ pb_files = set() with open(self.source, 'r', buffering=1) as csvfile: @@ -383,23 +382,10 @@ def _format_python2_or_3(self): for im in sorted(pb_files): with open(im, 'r', buffering=1) as pbfile: - contents = 'from six import *\n' + pbfile.read() + contents = pbfile.read() contents = re.sub(r'riak_pb2', r'riak.pb.riak_pb2', contents) - # Look for this pattern in the protoc-generated file: - # - # class RpbCounterGetResp(_message.Message): - # __metaclass__ = _reflection.GeneratedProtocolMessageType - # - # and convert it to: - # - # @add_metaclass(_reflection.GeneratedProtocolMessageType) - # class RpbCounterGetResp(_message.Message): - contents = re.sub( - r'class\s+(\S+)\((\S+)\):\s*\n' - r'\s+__metaclass__\s+=\s+(\S+)\s*\n', - r'@add_metaclass(\3)\nclass \1(\2):\n', contents) with open(im, 'w', buffering=1) as pbfile: pbfile.write(contents) diff --git a/riak/benchmark.py b/riak/benchmark.py index 94ec0f3e..cc728062 100644 --- a/riak/benchmark.py +++ b/riak/benchmark.py @@ -12,8 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - - import os import gc import sys diff --git a/riak/pb/riak_dt_pb2.py b/riak/pb/riak_dt_pb2.py index 3ce5bc53..8cd8b076 100644 --- a/riak/pb/riak_dt_pb2.py +++ b/riak/pb/riak_dt_pb2.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_dt.proto @@ -909,91 +908,91 @@ DESCRIPTOR.message_types_by_name['DtUpdateReq'] = _DTUPDATEREQ DESCRIPTOR.message_types_by_name['DtUpdateResp'] = _DTUPDATERESP -@add_metaclass(_reflection.GeneratedProtocolMessageType) class MapField(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _MAPFIELD # @@protoc_insertion_point(class_scope:MapField) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class MapEntry(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _MAPENTRY # @@protoc_insertion_point(class_scope:MapEntry) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class DtFetchReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _DTFETCHREQ # @@protoc_insertion_point(class_scope:DtFetchReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class DtValue(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _DTVALUE # @@protoc_insertion_point(class_scope:DtValue) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class DtFetchResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _DTFETCHRESP # @@protoc_insertion_point(class_scope:DtFetchResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class CounterOp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _COUNTEROP # @@protoc_insertion_point(class_scope:CounterOp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class SetOp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _SETOP # @@protoc_insertion_point(class_scope:SetOp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class GSetOp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _GSETOP # @@protoc_insertion_point(class_scope:GSetOp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class HllOp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _HLLOP # @@protoc_insertion_point(class_scope:HllOp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class MapUpdate(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _MAPUPDATE # @@protoc_insertion_point(class_scope:MapUpdate) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class MapOp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _MAPOP # @@protoc_insertion_point(class_scope:MapOp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class DtOp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _DTOP # @@protoc_insertion_point(class_scope:DtOp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class DtUpdateReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _DTUPDATEREQ # @@protoc_insertion_point(class_scope:DtUpdateReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class DtUpdateResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _DTUPDATERESP # @@protoc_insertion_point(class_scope:DtUpdateResp) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\010RiakDtPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\010RiakDtPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/pb/riak_kv_pb2.py b/riak/pb/riak_kv_pb2.py index bd456e80..542a395b 100644 --- a/riak/pb/riak_kv_pb2.py +++ b/riak/pb/riak_kv_pb2.py @@ -11,8 +11,6 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -from six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_kv.proto @@ -1795,193 +1793,193 @@ DESCRIPTOR.message_types_by_name['RpbCoverageResp'] = _RPBCOVERAGERESP DESCRIPTOR.message_types_by_name['RpbCoverageEntry'] = _RPBCOVERAGEENTRY -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbGetClientIdResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBGETCLIENTIDRESP # @@protoc_insertion_point(class_scope:RpbGetClientIdResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbSetClientIdReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBSETCLIENTIDREQ # @@protoc_insertion_point(class_scope:RpbSetClientIdReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbGetReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBGETREQ # @@protoc_insertion_point(class_scope:RpbGetReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbGetResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBGETRESP # @@protoc_insertion_point(class_scope:RpbGetResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbPutReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBPUTREQ # @@protoc_insertion_point(class_scope:RpbPutReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbPutResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBPUTRESP # @@protoc_insertion_point(class_scope:RpbPutResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbDelReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBDELREQ # @@protoc_insertion_point(class_scope:RpbDelReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbListBucketsReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBLISTBUCKETSREQ # @@protoc_insertion_point(class_scope:RpbListBucketsReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbListBucketsResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBLISTBUCKETSRESP # @@protoc_insertion_point(class_scope:RpbListBucketsResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbListKeysReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBLISTKEYSREQ # @@protoc_insertion_point(class_scope:RpbListKeysReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbListKeysResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBLISTKEYSRESP # @@protoc_insertion_point(class_scope:RpbListKeysResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbMapRedReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBMAPREDREQ # @@protoc_insertion_point(class_scope:RpbMapRedReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbMapRedResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBMAPREDRESP # @@protoc_insertion_point(class_scope:RpbMapRedResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbIndexReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBINDEXREQ # @@protoc_insertion_point(class_scope:RpbIndexReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbIndexResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBINDEXRESP # @@protoc_insertion_point(class_scope:RpbIndexResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbIndexBodyResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBINDEXBODYRESP # @@protoc_insertion_point(class_scope:RpbIndexBodyResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbCSBucketReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCSBUCKETREQ # @@protoc_insertion_point(class_scope:RpbCSBucketReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbCSBucketResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCSBUCKETRESP # @@protoc_insertion_point(class_scope:RpbCSBucketResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbIndexObject(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBINDEXOBJECT # @@protoc_insertion_point(class_scope:RpbIndexObject) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbContent(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCONTENT # @@protoc_insertion_point(class_scope:RpbContent) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbLink(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBLINK # @@protoc_insertion_point(class_scope:RpbLink) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbCounterUpdateReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCOUNTERUPDATEREQ # @@protoc_insertion_point(class_scope:RpbCounterUpdateReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbCounterUpdateResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCOUNTERUPDATERESP # @@protoc_insertion_point(class_scope:RpbCounterUpdateResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbCounterGetReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCOUNTERGETREQ # @@protoc_insertion_point(class_scope:RpbCounterGetReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbCounterGetResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCOUNTERGETRESP # @@protoc_insertion_point(class_scope:RpbCounterGetResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbGetBucketKeyPreflistReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBGETBUCKETKEYPREFLISTREQ # @@protoc_insertion_point(class_scope:RpbGetBucketKeyPreflistReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbGetBucketKeyPreflistResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBGETBUCKETKEYPREFLISTRESP # @@protoc_insertion_point(class_scope:RpbGetBucketKeyPreflistResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbBucketKeyPreflistItem(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBBUCKETKEYPREFLISTITEM # @@protoc_insertion_point(class_scope:RpbBucketKeyPreflistItem) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbCoverageReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCOVERAGEREQ # @@protoc_insertion_point(class_scope:RpbCoverageReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbCoverageResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCOVERAGERESP # @@protoc_insertion_point(class_scope:RpbCoverageResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbCoverageEntry(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCOVERAGEENTRY # @@protoc_insertion_point(class_scope:RpbCoverageEntry) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\010RiakKvPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\010RiakKvPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/pb/riak_pb2.py b/riak/pb/riak_pb2.py index 5bb8f11b..174f6e95 100644 --- a/riak/pb/riak_pb2.py +++ b/riak/pb/riak_pb2.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak.proto @@ -723,85 +722,85 @@ DESCRIPTOR.message_types_by_name['RpbBucketProps'] = _RPBBUCKETPROPS DESCRIPTOR.message_types_by_name['RpbAuthReq'] = _RPBAUTHREQ -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbErrorResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBERRORRESP # @@protoc_insertion_point(class_scope:RpbErrorResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbGetServerInfoResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBGETSERVERINFORESP # @@protoc_insertion_point(class_scope:RpbGetServerInfoResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbPair(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBPAIR # @@protoc_insertion_point(class_scope:RpbPair) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbGetBucketReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBGETBUCKETREQ # @@protoc_insertion_point(class_scope:RpbGetBucketReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbGetBucketResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBGETBUCKETRESP # @@protoc_insertion_point(class_scope:RpbGetBucketResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbSetBucketReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBSETBUCKETREQ # @@protoc_insertion_point(class_scope:RpbSetBucketReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbResetBucketReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBRESETBUCKETREQ # @@protoc_insertion_point(class_scope:RpbResetBucketReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbGetBucketTypeReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBGETBUCKETTYPEREQ # @@protoc_insertion_point(class_scope:RpbGetBucketTypeReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbSetBucketTypeReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBSETBUCKETTYPEREQ # @@protoc_insertion_point(class_scope:RpbSetBucketTypeReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbModFun(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBMODFUN # @@protoc_insertion_point(class_scope:RpbModFun) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbCommitHook(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBCOMMITHOOK # @@protoc_insertion_point(class_scope:RpbCommitHook) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbBucketProps(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBBUCKETPROPS # @@protoc_insertion_point(class_scope:RpbBucketProps) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbAuthReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBAUTHREQ # @@protoc_insertion_point(class_scope:RpbAuthReq) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\006RiakPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\006RiakPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/pb/riak_search_pb2.py b/riak/pb/riak_search_pb2.py index 53160b9b..691b5307 100644 --- a/riak/pb/riak_search_pb2.py +++ b/riak/pb/riak_search_pb2.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_search.proto @@ -200,25 +199,25 @@ DESCRIPTOR.message_types_by_name['RpbSearchQueryReq'] = _RPBSEARCHQUERYREQ DESCRIPTOR.message_types_by_name['RpbSearchQueryResp'] = _RPBSEARCHQUERYRESP -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbSearchDoc(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBSEARCHDOC # @@protoc_insertion_point(class_scope:RpbSearchDoc) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbSearchQueryReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBSEARCHQUERYREQ # @@protoc_insertion_point(class_scope:RpbSearchQueryReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbSearchQueryResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBSEARCHQUERYRESP # @@protoc_insertion_point(class_scope:RpbSearchQueryResp) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\014RiakSearchPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\014RiakSearchPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/pb/riak_ts_pb2.py b/riak/pb/riak_ts_pb2.py index ff758ccb..15573751 100644 --- a/riak/pb/riak_ts_pb2.py +++ b/riak/pb/riak_ts_pb2.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_ts.proto @@ -820,115 +819,115 @@ DESCRIPTOR.message_types_by_name['TsCoverageEntry'] = _TSCOVERAGEENTRY DESCRIPTOR.message_types_by_name['TsRange'] = _TSRANGE -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsQueryReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSQUERYREQ # @@protoc_insertion_point(class_scope:TsQueryReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsQueryResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSQUERYRESP # @@protoc_insertion_point(class_scope:TsQueryResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsGetReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSGETREQ # @@protoc_insertion_point(class_scope:TsGetReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsGetResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSGETRESP # @@protoc_insertion_point(class_scope:TsGetResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsPutReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSPUTREQ # @@protoc_insertion_point(class_scope:TsPutReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsPutResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSPUTRESP # @@protoc_insertion_point(class_scope:TsPutResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsDelReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSDELREQ # @@protoc_insertion_point(class_scope:TsDelReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsDelResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSDELRESP # @@protoc_insertion_point(class_scope:TsDelResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsInterpolation(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSINTERPOLATION # @@protoc_insertion_point(class_scope:TsInterpolation) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsColumnDescription(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSCOLUMNDESCRIPTION # @@protoc_insertion_point(class_scope:TsColumnDescription) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsRow(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSROW # @@protoc_insertion_point(class_scope:TsRow) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsCell(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSCELL # @@protoc_insertion_point(class_scope:TsCell) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsListKeysReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSLISTKEYSREQ # @@protoc_insertion_point(class_scope:TsListKeysReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsListKeysResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSLISTKEYSRESP # @@protoc_insertion_point(class_scope:TsListKeysResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsCoverageReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSCOVERAGEREQ # @@protoc_insertion_point(class_scope:TsCoverageReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsCoverageResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSCOVERAGERESP # @@protoc_insertion_point(class_scope:TsCoverageResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsCoverageEntry(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSCOVERAGEENTRY # @@protoc_insertion_point(class_scope:TsCoverageEntry) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class TsRange(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _TSRANGE # @@protoc_insertion_point(class_scope:TsRange) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\010RiakTsPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\010RiakTsPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/pb/riak_yokozuna_pb2.py b/riak/pb/riak_yokozuna_pb2.py index c9b9c80f..a6a58724 100644 --- a/riak/pb/riak_yokozuna_pb2.py +++ b/riak/pb/riak_yokozuna_pb2.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from six import * # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_yokozuna.proto @@ -326,61 +325,61 @@ DESCRIPTOR.message_types_by_name['RpbYokozunaSchemaGetReq'] = _RPBYOKOZUNASCHEMAGETREQ DESCRIPTOR.message_types_by_name['RpbYokozunaSchemaGetResp'] = _RPBYOKOZUNASCHEMAGETRESP -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbYokozunaIndex(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBYOKOZUNAINDEX # @@protoc_insertion_point(class_scope:RpbYokozunaIndex) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbYokozunaIndexGetReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBYOKOZUNAINDEXGETREQ # @@protoc_insertion_point(class_scope:RpbYokozunaIndexGetReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbYokozunaIndexGetResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBYOKOZUNAINDEXGETRESP # @@protoc_insertion_point(class_scope:RpbYokozunaIndexGetResp) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbYokozunaIndexPutReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBYOKOZUNAINDEXPUTREQ # @@protoc_insertion_point(class_scope:RpbYokozunaIndexPutReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbYokozunaIndexDeleteReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBYOKOZUNAINDEXDELETEREQ # @@protoc_insertion_point(class_scope:RpbYokozunaIndexDeleteReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbYokozunaSchema(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBYOKOZUNASCHEMA # @@protoc_insertion_point(class_scope:RpbYokozunaSchema) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbYokozunaSchemaPutReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBYOKOZUNASCHEMAPUTREQ # @@protoc_insertion_point(class_scope:RpbYokozunaSchemaPutReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbYokozunaSchemaGetReq(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBYOKOZUNASCHEMAGETREQ # @@protoc_insertion_point(class_scope:RpbYokozunaSchemaGetReq) -@add_metaclass(_reflection.GeneratedProtocolMessageType) class RpbYokozunaSchemaGetResp(_message.Message): + __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _RPBYOKOZUNASCHEMAGETRESP # @@protoc_insertion_point(class_scope:RpbYokozunaSchemaGetResp) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\016RiakYokozunaPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\016RiakYokozunaPB') # @@protoc_insertion_point(module_scope) diff --git a/setup.py b/setup.py index 37eb8da0..931ceb28 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,6 @@ #!/usr/bin/env python import codecs -import sys from setuptools import setup, find_packages from version import get_version @@ -10,16 +9,8 @@ install_requires = ['six >= 1.8.0', 'basho_erlastic >= 2.1.1'] requires = ['six(>=1.8.0)', 'basho_erlastic(>= 2.1.1)'] -if sys.version_info[:3] <= (2, 7, 9): - install_requires.append("pyOpenSSL >= 0.14") - requires.append("pyOpenSSL(>=0.14)") - -if sys.version_info[:3] <= (3, 0, 0): - install_requires.append('protobuf >=2.4.1, <2.7.0') - requires.append('protobuf(>=2.4.1, <2.7.0)') -else: - install_requires.append('python3_protobuf >=2.4.1, <2.6.0') - requires.append('python3_protobuf(>=2.4.1, <2.6.0)') +install_requires.append('python3_protobuf >=2.4.1, <2.6.0') +requires.append('python3_protobuf(>=2.4.1, <2.6.0)') with codecs.open('README.md', 'r', 'utf-8') as f: readme_md = f.read() @@ -57,9 +48,11 @@ classifiers=['License :: OSI Approved :: Apache Software License', 'Intended Audience :: Developers', 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', 'Topic :: Database'] ) From cc6b48554be9a83060d15034003d078e6963239b Mon Sep 17 00:00:00 2001 From: Travis Woodruff Date: Thu, 12 Aug 2021 13:38:27 -0500 Subject: [PATCH 05/15] Additional lint fixes --- riak/benchmark.py | 4 ---- riak/bucket.py | 1 - riak/client/operations.py | 3 +-- riak/codecs/http.py | 5 +---- riak/codecs/ttb.py | 4 ++-- riak/mapreduce.py | 6 +----- riak/riak_object.py | 2 -- riak/tests/__init__.py | 10 ++++------ riak/tests/comparison.py | 2 -- riak/tests/test_client.py | 1 - riak/tests/test_kv.py | 3 +-- riak/tests/test_pool.py | 1 - riak/tests/test_yokozuna.py | 11 +++++++++-- riak/transports/http/__init__.py | 1 - riak/transports/http/connection.py | 1 - riak/transports/http/resources.py | 1 - riak/transports/http/stream.py | 3 --- riak/transports/http/transport.py | 4 ++-- riak/transports/tcp/stream.py | 2 +- riak/transports/tcp/transport.py | 1 - riak/transports/transport.py | 1 - setup.cfg | 2 +- setup.py | 2 +- 23 files changed, 24 insertions(+), 47 deletions(-) diff --git a/riak/benchmark.py b/riak/benchmark.py index 45531ad7..337c2504 100644 --- a/riak/benchmark.py +++ b/riak/benchmark.py @@ -109,10 +109,6 @@ def __next__(self): self.count -= 1 return self - def __next__(self): - # Python 3.x Version - return next(self) - def report(self, name): """ Returns a report for the current step of the benchmark. diff --git a/riak/bucket.py b/riak/bucket.py index 504c97fe..b44ba3db 100644 --- a/riak/bucket.py +++ b/riak/bucket.py @@ -19,7 +19,6 @@ from riak.datatypes import TYPES from riak.util import lazy_property -from six import PY2, string_types def bucket_property(name, doc=None): diff --git a/riak/client/operations.py b/riak/client/operations.py index 34a9196a..6d98db85 100644 --- a/riak/client/operations.py +++ b/riak/client/operations.py @@ -13,7 +13,6 @@ # limitations under the License. import riak.client.multi -import six from riak import ListError from riak.client.index_page import IndexPage @@ -119,7 +118,7 @@ def stream_buckets(self, bucket_type=None, timeout=None): def make_op(transport): return transport.stream_buckets( - bucket_type=bucket_type, timeout=timeout) + bucket_type=bucket_type, timeout=timeout) for bucket_list in self._stream_with_retry(make_op): bucket_list = [bucketfn(bytes_to_str(name), bucket_type) diff --git a/riak/codecs/http.py b/riak/codecs/http.py index a9aed9d3..1df85e48 100644 --- a/riak/codecs/http.py +++ b/riak/codecs/http.py @@ -20,8 +20,6 @@ from email.utils import mktime_tz, parsedate_tz from xml.etree import ElementTree -import six - from riak import RiakError from riak.content import RiakContent from riak.multidict import MultiDict @@ -157,8 +155,7 @@ def _parse_links(self, linkHeaders): newform = '; ?riaktag=\"([^\"]+)\"' for linkHeader in linkHeaders.strip().split(","): linkHeader = linkHeader.strip() - matches = (re.match(oldform, linkHeader) or - re.match(newform, linkHeader)) + matches = (re.match(oldform, linkHeader) or re.match(newform, linkHeader)) if matches is not None: link = (unquote_plus(matches.group(2)), unquote_plus(matches.group(3)), diff --git a/riak/codecs/ttb.py b/riak/codecs/ttb.py index fba800a1..bfbb8313 100644 --- a/riak/codecs/ttb.py +++ b/riak/codecs/ttb.py @@ -14,7 +14,7 @@ import datetime -from erlastic import decode, encode +from erlastic import decode, encode from erlastic.types import Atom from riak import RiakError from riak.codecs import Codec, Msg @@ -185,7 +185,7 @@ def decode_timeseries(self, resp_ttb, tsobj, resp_colnames = resp_data[0] resp_coltypes = resp_data[1] tsobj.columns = self.decode_timeseries_cols( - resp_colnames, resp_coltypes) + resp_colnames, resp_coltypes) resp_rows = resp_data[2] tsobj.rows = [] for resp_row in resp_rows: diff --git a/riak/mapreduce.py b/riak/mapreduce.py index 65f0c3af..3466e757 100644 --- a/riak/mapreduce.py +++ b/riak/mapreduce.py @@ -17,11 +17,8 @@ from collections import Iterable, namedtuple - import riak -from six import PY2, string_types - #: Links are just bucket/key/tag tuples, this class provides a #: backwards-compatible format: ``RiakLink(bucket, key, tag)`` @@ -585,8 +582,7 @@ def to_array(self): stepdef["module"] = self._function[0] stepdef["function"] = self._function[1] - elif (self._language == "erlang" and - isinstance(self._function, str)): + elif (self._language == "erlang" and isinstance(self._function, str)): stepdef["source"] = self._function return {self._type: stepdef} diff --git a/riak/riak_object.py b/riak/riak_object.py index ea5200ba..5fbeadf9 100644 --- a/riak/riak_object.py +++ b/riak/riak_object.py @@ -16,9 +16,7 @@ from riak import ConflictError from riak.content import RiakContent -import base64 from riak.mapreduce import RiakMapReduce -from six import PY2, string_types def content_property(name, doc=None): diff --git a/riak/tests/__init__.py b/riak/tests/__init__.py index a00cf031..21466adb 100644 --- a/riak/tests/__init__.py +++ b/riak/tests/__init__.py @@ -87,9 +87,8 @@ def hostname_resolves(hostname): HOST = PB_HOST = HTTP_HOST = h else: raise AssertionError( - "RUN_SECURITY requires that the host name 'riak-test' resolves to the IP address" + - " of a Riak node with security enabled.", - ) + "RUN_SECURITY requires that the host name 'riak-test' resolves to the IP address" + + " of a Riak node with security enabled.") SECURITY_USER = os.environ.get("RIAK_TEST_SECURITY_USER", "riakpass") SECURITY_PASSWD = os.environ.get("RIAK_TEST_SECURITY_PASSWD", "Test1234") @@ -101,9 +100,8 @@ def hostname_resolves(hostname): SECURITY_BAD_CERT = os.environ.get("RIAK_TEST_SECURITY_BAD_CERT", "tools/test-ca/certs/badcert.pem") # Certificate-based Authentication only supported by PBC -SECURITY_KEY = os.environ.get( - "RIAK_TEST_SECURITY_KEY", - "tools/test-ca/private/riakuser-client-cert-key.pem") +SECURITY_KEY = os.environ.get("RIAK_TEST_SECURITY_KEY", + "tools/test-ca/private/riakuser-client-cert-key.pem") SECURITY_CERT = os.environ.get("RIAK_TEST_SECURITY_CERT", "tools/test-ca/certs/riakuser-client-cert.pem") SECURITY_CERT_USER = os.environ.get("RIAK_TEST_SECURITY_CERT_USER", diff --git a/riak/tests/comparison.py b/riak/tests/comparison.py index b0b602d4..1da74181 100644 --- a/riak/tests/comparison.py +++ b/riak/tests/comparison.py @@ -15,8 +15,6 @@ import collections import warnings -from six import PY2, PY3 - class Comparison(object): """ diff --git a/riak/tests/test_client.py b/riak/tests/test_client.py index 68387323..68b6ac93 100644 --- a/riak/tests/test_client.py +++ b/riak/tests/test_client.py @@ -24,7 +24,6 @@ ) from riak.tests.base import IntegrationTestBase from riak.transports.tcp import TcpTransport -from six import PY2 from queue import Queue diff --git a/riak/tests/test_kv.py b/riak/tests/test_kv.py index bad87551..cfb39e97 100644 --- a/riak/tests/test_kv.py +++ b/riak/tests/test_kv.py @@ -31,10 +31,9 @@ from riak.tests import PROTOCOL, RUN_KV, RUN_RESOLVE from riak.tests.base import IntegrationTestBase from riak.tests.comparison import Comparison -from six import PY2, PY3, string_types try: - import simplejson as json # todo: remove this, supports < p3.3 + import simplejson as json # todo: remove this, supports < p3.3 except ImportError: import json diff --git a/riak/tests/test_pool.py b/riak/tests/test_pool.py index a0db1d3e..ac7ce491 100644 --- a/riak/tests/test_pool.py +++ b/riak/tests/test_pool.py @@ -22,7 +22,6 @@ from riak.tests import RUN_POOL from riak.tests.comparison import Comparison from riak.transports.pool import BadResource, Pool -from six import PY2 from queue import Queue diff --git a/riak/tests/test_yokozuna.py b/riak/tests/test_yokozuna.py index 578af87e..1962fb56 100644 --- a/riak/tests/test_yokozuna.py +++ b/riak/tests/test_yokozuna.py @@ -32,8 +32,14 @@ def wait_for_yz_index(bucket, key, index=None): while len(bucket.search("_yz_rk:" + key, index=index)["docs"]) == 0: pass + # YZ index on bucket of the same name -testrun_yz = {"btype": None, "bucket": "yzbucket", "index": "yzbucket"} +testrun_yz = { + "btype": None, + "bucket": "yzbucket", + "index": "yzbucket" +} + # YZ index on bucket of a different name testrun_yz_index = { "btype": None, @@ -41,6 +47,7 @@ def wait_for_yz_index(bucket, key, index=None): "index": "yzindex", } + def setUpModule(): yzSetUp(testrun_yz, testrun_yz_index) @@ -178,7 +185,7 @@ def test_yz_search_queries(self): results = bucket.search("age_i:[30 TO 33]") self.assertEqual(2, len(results["docs"])) # phrase - results = bucket.search("name_s:"bryan fink"") + results = bucket.search('name_s:"bryan fink"') self.assertEqual(1, len(results["docs"])) # wildcard results = bucket.search("name_s:*ryan*") diff --git a/riak/transports/http/__init__.py b/riak/transports/http/__init__.py index a373b498..4e93186d 100644 --- a/riak/transports/http/__init__.py +++ b/riak/transports/http/__init__.py @@ -18,7 +18,6 @@ from riak.security import SecurityError, USE_STDLIB_SSL from riak.transports.http.transport import HttpTransport from riak.transports.pool import Pool -from six import PY2 if USE_STDLIB_SSL: import ssl diff --git a/riak/transports/http/connection.py b/riak/transports/http/connection.py index 244b5157..1aca51d1 100644 --- a/riak/transports/http/connection.py +++ b/riak/transports/http/connection.py @@ -15,7 +15,6 @@ import base64 from riak.util import str_to_bytes -from six import PY2 from http.client import NotConnected, HTTPConnection diff --git a/riak/transports/http/resources.py b/riak/transports/http/resources.py index 0e829e05..95dbaaa4 100644 --- a/riak/transports/http/resources.py +++ b/riak/transports/http/resources.py @@ -16,7 +16,6 @@ from riak import RiakError from riak.util import bytes_to_str, lazy_property -from six import PY2 from urllib.parse import quote_plus, urlencode diff --git a/riak/transports/http/stream.py b/riak/transports/http/stream.py index a17a2abc..39351f7e 100644 --- a/riak/transports/http/stream.py +++ b/riak/transports/http/stream.py @@ -48,9 +48,6 @@ def _read(self): def __next__(self): raise NotImplementedError - def __next__(self): - raise NotImplementedError - def attach(self, resource): self.resource = resource diff --git a/riak/transports/http/transport.py b/riak/transports/http/transport.py index 79d918d3..aeb992bc 100644 --- a/riak/transports/http/transport.py +++ b/riak/transports/http/transport.py @@ -32,7 +32,6 @@ ) from riak.transports.transport import Transport from riak.util import bytes_to_str, decode_index_value, str_to_long -from six import PY2 from http.client import HTTPConnection @@ -387,7 +386,8 @@ def get_index( "continuation": continuation, "timeout": timeout, "term_regex": term_regex} bucket_type = self._get_bucket_type(bucket.bucket_type) - url = self.index_path(bucket.name, index, startkey, endkey, bucket_type=bucket_type, **params) + url = self.index_path(bucket.name, index, startkey, endkey, bucket_type=bucket_type, + **params) status, headers, body = self._request("GET", url) self.check_http_code(status, [200]) json_data = json.loads(bytes_to_str(body)) diff --git a/riak/transports/tcp/stream.py b/riak/transports/tcp/stream.py index 670e736d..6124bcb7 100644 --- a/riak/transports/tcp/stream.py +++ b/riak/transports/tcp/stream.py @@ -18,7 +18,7 @@ from riak.client.index_page import CONTINUATION from riak.codecs.ttb import TtbCodec -from riak.util import bytes_to_str, decode_index_value +from riak.util import bytes_to_str, decode_index_value class PbufStream(object): diff --git a/riak/transports/tcp/transport.py b/riak/transports/tcp/transport.py index ce3a861d..10788525 100644 --- a/riak/transports/tcp/transport.py +++ b/riak/transports/tcp/transport.py @@ -13,7 +13,6 @@ # limitations under the License. import riak.pb.messages -import six from riak import RiakError from riak.codecs import Codec, Msg diff --git a/riak/transports/transport.py b/riak/transports/transport.py index 75849d02..7a116e4c 100644 --- a/riak/transports/transport.py +++ b/riak/transports/transport.py @@ -20,7 +20,6 @@ import threading from riak.transports.feature_detect import FeatureDetection -from six import PY2 class Transport(FeatureDetection): diff --git a/setup.cfg b/setup.cfg index b82986c9..eb33f0f6 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,7 +5,7 @@ cover-package=riak cover-erase=1 [flake8] -ignore = D203 +extend-ignore = D203 exclude = .git, riak/pb diff --git a/setup.py b/setup.py index 073dc2c8..422daaac 100755 --- a/setup.py +++ b/setup.py @@ -55,4 +55,4 @@ "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Database"] - ) +) From b6540b41b85d42b54e41200be4fbc862ed6da839 Mon Sep 17 00:00:00 2001 From: Travis Woodruff Date: Thu, 12 Aug 2021 15:39:43 -0500 Subject: [PATCH 06/15] Fixes to make tests work --- commands.py | 11 +- riak/__init__.py | 3 +- riak/datatypes/__init__.py | 2 +- riak/datatypes/counter.py | 2 +- riak/datatypes/datatype.py | 2 +- riak/pb/messages.py | 16 +- riak/pb/riak_dt_pb2.py | 369 +++++++++++++++++----------------- riak/pb/riak_kv_pb2.py | 96 +++------ riak/pb/riak_pb2.py | 41 ++-- riak/pb/riak_search_pb2.py | 11 +- riak/pb/riak_ts_pb2.py | 56 ++---- riak/pb/riak_yokozuna_pb2.py | 29 +-- riak/tests/test_2i.py | 3 + riak/transports/pool.py | 1 - riak/transports/tcp/stream.py | 10 +- setup.py | 6 +- 16 files changed, 292 insertions(+), 366 deletions(-) diff --git a/commands.py b/commands.py index dd55ac83..0d78ab59 100644 --- a/commands.py +++ b/commands.py @@ -363,7 +363,7 @@ def _generate_mapping(self, m): def _update_pb_pathnames(self): """ - Change the PB files to use full pathnames + Change the PB files for Python 3 """ pb_files = set() with open(self.source, "r", buffering=1) as csvfile: @@ -378,6 +378,15 @@ def _update_pb_pathnames(self): contents = re.sub(r"riak_pb2", r"riak.pb.riak_pb2", contents) + contents = re.sub(r"serialized_pb='", + r"serialized_pb=b'", + contents) + contents = re.sub(r"\):\n __metaclass__ = (.*)", + r", metaclass=\1):", + contents) + contents = re.sub(r"(_descriptor._ParseOptions\(descriptor_pb2.FileOptions\(\), )'", + r"\1b'", + contents) with open(im, "w", buffering=1) as pbfile: pbfile.write(contents) diff --git a/riak/__init__.py b/riak/__init__.py index 5101d5ba..740931cf 100644 --- a/riak/__init__.py +++ b/riak/__init__.py @@ -19,11 +19,12 @@ operations, and run Linkwalking operations. """ +from riak.riak_error import ConflictError, ListError, RiakError + from riak.bucket import BucketType, RiakBucket from riak.client import RiakClient from riak.mapreduce import RiakKeyFilter, RiakLink, RiakMapReduce from riak.node import RiakNode -from riak.riak_error import ConflictError, ListError, RiakError from riak.riak_object import RiakObject from riak.table import Table diff --git a/riak/datatypes/__init__.py b/riak/datatypes/__init__.py index d5717835..d5637ca1 100644 --- a/riak/datatypes/__init__.py +++ b/riak/datatypes/__init__.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +from .types import TYPES from .counter import Counter from .datatype import Datatype from .errors import ContextRequired @@ -20,7 +21,6 @@ from .map import Map from .register import Register from .set import Set -from .types import TYPES __all__ = [ diff --git a/riak/datatypes/counter.py b/riak/datatypes/counter.py index 181a9364..c60d2412 100644 --- a/riak/datatypes/counter.py +++ b/riak/datatypes/counter.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from riak.datatypes import TYPES from riak.datatypes.datatype import Datatype +from riak.datatypes import TYPES class Counter(Datatype): diff --git a/riak/datatypes/datatype.py b/riak/datatypes/datatype.py index 06d2227d..fcee7b78 100644 --- a/riak/datatypes/datatype.py +++ b/riak/datatypes/datatype.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from . import TYPES from .errors import ContextRequired +from . import TYPES class Datatype(object): diff --git a/riak/pb/messages.py b/riak/pb/messages.py index 8b563371..76c25e82 100644 --- a/riak/pb/messages.py +++ b/riak/pb/messages.py @@ -1,17 +1,3 @@ -# Copyright 2010-present Basho Technologies, Inc. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - # This is a generated file. DO NOT EDIT. """ @@ -183,5 +169,5 @@ MSG_CODE_TS_TTB_MSG: None, MSG_CODE_AUTH_REQ: riak.pb.riak_pb2.RpbAuthReq, MSG_CODE_AUTH_RESP: None, - MSG_CODE_START_TLS: None, + MSG_CODE_START_TLS: None } diff --git a/riak/pb/riak_dt_pb2.py b/riak/pb/riak_dt_pb2.py index aebbadce..a2e2e2ef 100644 --- a/riak/pb/riak_dt_pb2.py +++ b/riak/pb/riak_dt_pb2.py @@ -16,42 +16,45 @@ # source: riak_dt.proto from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pb2 from google.protobuf import message as _message from google.protobuf import reflection as _reflection +from google.protobuf import descriptor_pb2 +# @@protoc_insertion_point(imports) + + -from six import * DESCRIPTOR = _descriptor.FileDescriptor( - name="riak_dt.proto", - package="", - serialized_pb=b'\n\rriak_dt.proto\"\x85\x01\n\x08MapField\x12\x0c\n\x04name\x18\x01 \x02(\x0c\x12$\n\x04type\x18\x02 \x02(\x0e\x32\x16.MapField.MapFieldType\"E\n\x0cMapFieldType\x12\x0b\n\x07\x43OUNTER\x10\x01\x12\x07\n\x03SET\x10\x02\x12\x0c\n\x08REGISTER\x10\x03\x12\x08\n\x04\x46LAG\x10\x04\x12\x07\n\x03MAP\x10\x05\"\x98\x01\n\x08MapEntry\x12\x18\n\x05\x66ield\x18\x01 \x02(\x0b\x32\t.MapField\x12\x15\n\rcounter_value\x18\x02 \x01(\x12\x12\x11\n\tset_value\x18\x03 \x03(\x0c\x12\x16\n\x0eregister_value\x18\x04 \x01(\x0c\x12\x12\n\nflag_value\x18\x05 \x01(\x08\x12\x1c\n\tmap_value\x18\x06 \x03(\x0b\x32\t.MapEntry\"\xcf\x01\n\nDtFetchReq\x12\x0e\n\x06\x62ucket\x18\x01 \x02(\x0c\x12\x0b\n\x03key\x18\x02 \x02(\x0c\x12\x0c\n\x04type\x18\x03 \x02(\x0c\x12\t\n\x01r\x18\x04 \x01(\r\x12\n\n\x02pr\x18\x05 \x01(\r\x12\x14\n\x0c\x62\x61sic_quorum\x18\x06 \x01(\x08\x12\x13\n\x0bnotfound_ok\x18\x07 \x01(\x08\x12\x0f\n\x07timeout\x18\x08 \x01(\r\x12\x15\n\rsloppy_quorum\x18\t \x01(\x08\x12\r\n\x05n_val\x18\n \x01(\r\x12\x1d\n\x0finclude_context\x18\x0b \x01(\x08:\x04true\"x\n\x07\x44tValue\x12\x15\n\rcounter_value\x18\x01 \x01(\x12\x12\x11\n\tset_value\x18\x02 \x03(\x0c\x12\x1c\n\tmap_value\x18\x03 \x03(\x0b\x32\t.MapEntry\x12\x11\n\thll_value\x18\x04 \x01(\x04\x12\x12\n\ngset_value\x18\x05 \x03(\x0c\"\x9a\x01\n\x0b\x44tFetchResp\x12\x0f\n\x07\x63ontext\x18\x01 \x01(\x0c\x12#\n\x04type\x18\x02 \x02(\x0e\x32\x15.DtFetchResp.DataType\x12\x17\n\x05value\x18\x03 \x01(\x0b\x32\x08.DtValue\"<\n\x08\x44\x61taType\x12\x0b\n\x07\x43OUNTER\x10\x01\x12\x07\n\x03SET\x10\x02\x12\x07\n\x03MAP\x10\x03\x12\x07\n\x03HLL\x10\x04\x12\x08\n\x04GSET\x10\x05\"\x1e\n\tCounterOp\x12\x11\n\tincrement\x18\x01 \x01(\x12\"&\n\x05SetOp\x12\x0c\n\x04\x61\x64\x64s\x18\x01 \x03(\x0c\x12\x0f\n\x07removes\x18\x02 \x03(\x0c\"\x16\n\x06GSetOp\x12\x0c\n\x04\x61\x64\x64s\x18\x01 \x03(\x0c\"\x15\n\x05HllOp\x12\x0c\n\x04\x61\x64\x64s\x18\x01 \x03(\x0c\"\xd1\x01\n\tMapUpdate\x12\x18\n\x05\x66ield\x18\x01 \x02(\x0b\x32\t.MapField\x12\x1e\n\ncounter_op\x18\x02 \x01(\x0b\x32\n.CounterOp\x12\x16\n\x06set_op\x18\x03 \x01(\x0b\x32\x06.SetOp\x12\x13\n\x0bregister_op\x18\x04 \x01(\x0c\x12\"\n\x07\x66lag_op\x18\x05 \x01(\x0e\x32\x11.MapUpdate.FlagOp\x12\x16\n\x06map_op\x18\x06 \x01(\x0b\x32\x06.MapOp\"!\n\x06\x46lagOp\x12\n\n\x06\x45NABLE\x10\x01\x12\x0b\n\x07\x44ISABLE\x10\x02\"@\n\x05MapOp\x12\x1a\n\x07removes\x18\x01 \x03(\x0b\x32\t.MapField\x12\x1b\n\x07updates\x18\x02 \x03(\x0b\x32\n.MapUpdate\"\x88\x01\n\x04\x44tOp\x12\x1e\n\ncounter_op\x18\x01 \x01(\x0b\x32\n.CounterOp\x12\x16\n\x06set_op\x18\x02 \x01(\x0b\x32\x06.SetOp\x12\x16\n\x06map_op\x18\x03 \x01(\x0b\x32\x06.MapOp\x12\x16\n\x06hll_op\x18\x04 \x01(\x0b\x32\x06.HllOp\x12\x18\n\x07gset_op\x18\x05 \x01(\x0b\x32\x07.GSetOp\"\xf1\x01\n\x0b\x44tUpdateReq\x12\x0e\n\x06\x62ucket\x18\x01 \x02(\x0c\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\x0c\n\x04type\x18\x03 \x02(\x0c\x12\x0f\n\x07\x63ontext\x18\x04 \x01(\x0c\x12\x11\n\x02op\x18\x05 \x02(\x0b\x32\x05.DtOp\x12\t\n\x01w\x18\x06 \x01(\r\x12\n\n\x02\x64w\x18\x07 \x01(\r\x12\n\n\x02pw\x18\x08 \x01(\r\x12\x1a\n\x0breturn_body\x18\t \x01(\x08:\x05\x66\x61lse\x12\x0f\n\x07timeout\x18\n \x01(\r\x12\x15\n\rsloppy_quorum\x18\x0b \x01(\x08\x12\r\n\x05n_val\x18\x0c \x01(\r\x12\x1d\n\x0finclude_context\x18\r \x01(\x08:\x04true\"\x9b\x01\n\x0c\x44tUpdateResp\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x0f\n\x07\x63ontext\x18\x02 \x01(\x0c\x12\x15\n\rcounter_value\x18\x03 \x01(\x12\x12\x11\n\tset_value\x18\x04 \x03(\x0c\x12\x1c\n\tmap_value\x18\x05 \x03(\x0b\x32\t.MapEntry\x12\x11\n\thll_value\x18\x06 \x01(\x04\x12\x12\n\ngset_value\x18\x07 \x03(\x0c\x42#\n\x17\x63om.basho.riak.protobufB\x08RiakDtPB') # NOQA E501 + name='riak_dt.proto', + package='', + serialized_pb=b'\n\rriak_dt.proto\"\x85\x01\n\x08MapField\x12\x0c\n\x04name\x18\x01 \x02(\x0c\x12$\n\x04type\x18\x02 \x02(\x0e\x32\x16.MapField.MapFieldType\"E\n\x0cMapFieldType\x12\x0b\n\x07\x43OUNTER\x10\x01\x12\x07\n\x03SET\x10\x02\x12\x0c\n\x08REGISTER\x10\x03\x12\x08\n\x04\x46LAG\x10\x04\x12\x07\n\x03MAP\x10\x05\"\x98\x01\n\x08MapEntry\x12\x18\n\x05\x66ield\x18\x01 \x02(\x0b\x32\t.MapField\x12\x15\n\rcounter_value\x18\x02 \x01(\x12\x12\x11\n\tset_value\x18\x03 \x03(\x0c\x12\x16\n\x0eregister_value\x18\x04 \x01(\x0c\x12\x12\n\nflag_value\x18\x05 \x01(\x08\x12\x1c\n\tmap_value\x18\x06 \x03(\x0b\x32\t.MapEntry\"\xcf\x01\n\nDtFetchReq\x12\x0e\n\x06\x62ucket\x18\x01 \x02(\x0c\x12\x0b\n\x03key\x18\x02 \x02(\x0c\x12\x0c\n\x04type\x18\x03 \x02(\x0c\x12\t\n\x01r\x18\x04 \x01(\r\x12\n\n\x02pr\x18\x05 \x01(\r\x12\x14\n\x0c\x62\x61sic_quorum\x18\x06 \x01(\x08\x12\x13\n\x0bnotfound_ok\x18\x07 \x01(\x08\x12\x0f\n\x07timeout\x18\x08 \x01(\r\x12\x15\n\rsloppy_quorum\x18\t \x01(\x08\x12\r\n\x05n_val\x18\n \x01(\r\x12\x1d\n\x0finclude_context\x18\x0b \x01(\x08:\x04true\"x\n\x07\x44tValue\x12\x15\n\rcounter_value\x18\x01 \x01(\x12\x12\x11\n\tset_value\x18\x02 \x03(\x0c\x12\x1c\n\tmap_value\x18\x03 \x03(\x0b\x32\t.MapEntry\x12\x11\n\thll_value\x18\x04 \x01(\x04\x12\x12\n\ngset_value\x18\x05 \x03(\x0c\"\x9a\x01\n\x0b\x44tFetchResp\x12\x0f\n\x07\x63ontext\x18\x01 \x01(\x0c\x12#\n\x04type\x18\x02 \x02(\x0e\x32\x15.DtFetchResp.DataType\x12\x17\n\x05value\x18\x03 \x01(\x0b\x32\x08.DtValue\"<\n\x08\x44\x61taType\x12\x0b\n\x07\x43OUNTER\x10\x01\x12\x07\n\x03SET\x10\x02\x12\x07\n\x03MAP\x10\x03\x12\x07\n\x03HLL\x10\x04\x12\x08\n\x04GSET\x10\x05\"\x1e\n\tCounterOp\x12\x11\n\tincrement\x18\x01 \x01(\x12\"&\n\x05SetOp\x12\x0c\n\x04\x61\x64\x64s\x18\x01 \x03(\x0c\x12\x0f\n\x07removes\x18\x02 \x03(\x0c\"\x16\n\x06GSetOp\x12\x0c\n\x04\x61\x64\x64s\x18\x01 \x03(\x0c\"\x15\n\x05HllOp\x12\x0c\n\x04\x61\x64\x64s\x18\x01 \x03(\x0c\"\xd1\x01\n\tMapUpdate\x12\x18\n\x05\x66ield\x18\x01 \x02(\x0b\x32\t.MapField\x12\x1e\n\ncounter_op\x18\x02 \x01(\x0b\x32\n.CounterOp\x12\x16\n\x06set_op\x18\x03 \x01(\x0b\x32\x06.SetOp\x12\x13\n\x0bregister_op\x18\x04 \x01(\x0c\x12\"\n\x07\x66lag_op\x18\x05 \x01(\x0e\x32\x11.MapUpdate.FlagOp\x12\x16\n\x06map_op\x18\x06 \x01(\x0b\x32\x06.MapOp\"!\n\x06\x46lagOp\x12\n\n\x06\x45NABLE\x10\x01\x12\x0b\n\x07\x44ISABLE\x10\x02\"@\n\x05MapOp\x12\x1a\n\x07removes\x18\x01 \x03(\x0b\x32\t.MapField\x12\x1b\n\x07updates\x18\x02 \x03(\x0b\x32\n.MapUpdate\"\x88\x01\n\x04\x44tOp\x12\x1e\n\ncounter_op\x18\x01 \x01(\x0b\x32\n.CounterOp\x12\x16\n\x06set_op\x18\x02 \x01(\x0b\x32\x06.SetOp\x12\x16\n\x06map_op\x18\x03 \x01(\x0b\x32\x06.MapOp\x12\x16\n\x06hll_op\x18\x04 \x01(\x0b\x32\x06.HllOp\x12\x18\n\x07gset_op\x18\x05 \x01(\x0b\x32\x07.GSetOp\"\xf1\x01\n\x0b\x44tUpdateReq\x12\x0e\n\x06\x62ucket\x18\x01 \x02(\x0c\x12\x0b\n\x03key\x18\x02 \x01(\x0c\x12\x0c\n\x04type\x18\x03 \x02(\x0c\x12\x0f\n\x07\x63ontext\x18\x04 \x01(\x0c\x12\x11\n\x02op\x18\x05 \x02(\x0b\x32\x05.DtOp\x12\t\n\x01w\x18\x06 \x01(\r\x12\n\n\x02\x64w\x18\x07 \x01(\r\x12\n\n\x02pw\x18\x08 \x01(\r\x12\x1a\n\x0breturn_body\x18\t \x01(\x08:\x05\x66\x61lse\x12\x0f\n\x07timeout\x18\n \x01(\r\x12\x15\n\rsloppy_quorum\x18\x0b \x01(\x08\x12\r\n\x05n_val\x18\x0c \x01(\r\x12\x1d\n\x0finclude_context\x18\r \x01(\x08:\x04true\"\x9b\x01\n\x0c\x44tUpdateResp\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12\x0f\n\x07\x63ontext\x18\x02 \x01(\x0c\x12\x15\n\rcounter_value\x18\x03 \x01(\x12\x12\x11\n\tset_value\x18\x04 \x03(\x0c\x12\x1c\n\tmap_value\x18\x05 \x03(\x0b\x32\t.MapEntry\x12\x11\n\thll_value\x18\x06 \x01(\x04\x12\x12\n\ngset_value\x18\x07 \x03(\x0c\x42#\n\x17\x63om.basho.riak.protobufB\x08RiakDtPB') + _MAPFIELD_MAPFIELDTYPE = _descriptor.EnumDescriptor( - name="MapFieldType", - full_name="MapField.MapFieldType", + name='MapFieldType', + full_name='MapField.MapFieldType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( - name="COUNTER", index=0, number=1, + name='COUNTER', index=0, number=1, options=None, type=None), _descriptor.EnumValueDescriptor( - name="SET", index=1, number=2, + name='SET', index=1, number=2, options=None, type=None), _descriptor.EnumValueDescriptor( - name="REGISTER", index=2, number=3, + name='REGISTER', index=2, number=3, options=None, type=None), _descriptor.EnumValueDescriptor( - name="FLAG", index=3, number=4, + name='FLAG', index=3, number=4, options=None, type=None), _descriptor.EnumValueDescriptor( - name="MAP", index=4, number=5, + name='MAP', index=4, number=5, options=None, type=None), ], @@ -62,29 +65,29 @@ ) _DTFETCHRESP_DATATYPE = _descriptor.EnumDescriptor( - name="DataType", - full_name="DtFetchResp.DataType", + name='DataType', + full_name='DtFetchResp.DataType', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( - name="COUNTER", index=0, number=1, + name='COUNTER', index=0, number=1, options=None, type=None), _descriptor.EnumValueDescriptor( - name="SET", index=1, number=2, + name='SET', index=1, number=2, options=None, type=None), _descriptor.EnumValueDescriptor( - name="MAP", index=2, number=3, + name='MAP', index=2, number=3, options=None, type=None), _descriptor.EnumValueDescriptor( - name="HLL", index=3, number=4, + name='HLL', index=3, number=4, options=None, type=None), _descriptor.EnumValueDescriptor( - name="GSET", index=4, number=5, + name='GSET', index=4, number=5, options=None, type=None), ], @@ -95,17 +98,17 @@ ) _MAPUPDATE_FLAGOP = _descriptor.EnumDescriptor( - name="FlagOp", - full_name="MapUpdate.FlagOp", + name='FlagOp', + full_name='MapUpdate.FlagOp', filename=None, file=DESCRIPTOR, values=[ _descriptor.EnumValueDescriptor( - name="ENABLE", index=0, number=1, + name='ENABLE', index=0, number=1, options=None, type=None), _descriptor.EnumValueDescriptor( - name="DISABLE", index=1, number=2, + name='DISABLE', index=1, number=2, options=None, type=None), ], @@ -117,21 +120,21 @@ _MAPFIELD = _descriptor.Descriptor( - name="MapField", - full_name="MapField", + name='MapField', + full_name='MapField', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="name", full_name="MapField.name", index=0, + name='name', full_name='MapField.name', index=0, number=1, type=12, cpp_type=9, label=2, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="type", full_name="MapField.type", index=1, + name='type', full_name='MapField.type', index=1, number=2, type=14, cpp_type=8, label=2, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, @@ -153,49 +156,49 @@ _MAPENTRY = _descriptor.Descriptor( - name="MapEntry", - full_name="MapEntry", + name='MapEntry', + full_name='MapEntry', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="field", full_name="MapEntry.field", index=0, + name='field', full_name='MapEntry.field', index=0, number=1, type=11, cpp_type=10, label=2, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="counter_value", full_name="MapEntry.counter_value", index=1, + name='counter_value', full_name='MapEntry.counter_value', index=1, number=2, type=18, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="set_value", full_name="MapEntry.set_value", index=2, + name='set_value', full_name='MapEntry.set_value', index=2, number=3, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="register_value", full_name="MapEntry.register_value", index=3, + name='register_value', full_name='MapEntry.register_value', index=3, number=4, type=12, cpp_type=9, label=1, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="flag_value", full_name="MapEntry.flag_value", index=4, + name='flag_value', full_name='MapEntry.flag_value', index=4, number=5, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="map_value", full_name="MapEntry.map_value", index=5, + name='map_value', full_name='MapEntry.map_value', index=5, number=6, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -216,84 +219,84 @@ _DTFETCHREQ = _descriptor.Descriptor( - name="DtFetchReq", - full_name="DtFetchReq", + name='DtFetchReq', + full_name='DtFetchReq', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="bucket", full_name="DtFetchReq.bucket", index=0, + name='bucket', full_name='DtFetchReq.bucket', index=0, number=1, type=12, cpp_type=9, label=2, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="key", full_name="DtFetchReq.key", index=1, + name='key', full_name='DtFetchReq.key', index=1, number=2, type=12, cpp_type=9, label=2, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="type", full_name="DtFetchReq.type", index=2, + name='type', full_name='DtFetchReq.type', index=2, number=3, type=12, cpp_type=9, label=2, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="r", full_name="DtFetchReq.r", index=3, + name='r', full_name='DtFetchReq.r', index=3, number=4, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="pr", full_name="DtFetchReq.pr", index=4, + name='pr', full_name='DtFetchReq.pr', index=4, number=5, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="basic_quorum", full_name="DtFetchReq.basic_quorum", index=5, + name='basic_quorum', full_name='DtFetchReq.basic_quorum', index=5, number=6, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="notfound_ok", full_name="DtFetchReq.notfound_ok", index=6, + name='notfound_ok', full_name='DtFetchReq.notfound_ok', index=6, number=7, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="timeout", full_name="DtFetchReq.timeout", index=7, + name='timeout', full_name='DtFetchReq.timeout', index=7, number=8, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="sloppy_quorum", full_name="DtFetchReq.sloppy_quorum", index=8, + name='sloppy_quorum', full_name='DtFetchReq.sloppy_quorum', index=8, number=9, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="n_val", full_name="DtFetchReq.n_val", index=9, + name='n_val', full_name='DtFetchReq.n_val', index=9, number=10, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="include_context", full_name="DtFetchReq.include_context", index=10, + name='include_context', full_name='DtFetchReq.include_context', index=10, number=11, type=8, cpp_type=7, label=1, has_default_value=True, default_value=True, message_type=None, enum_type=None, containing_type=None, @@ -314,42 +317,42 @@ _DTVALUE = _descriptor.Descriptor( - name="DtValue", - full_name="DtValue", + name='DtValue', + full_name='DtValue', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="counter_value", full_name="DtValue.counter_value", index=0, + name='counter_value', full_name='DtValue.counter_value', index=0, number=1, type=18, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="set_value", full_name="DtValue.set_value", index=1, + name='set_value', full_name='DtValue.set_value', index=1, number=2, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="map_value", full_name="DtValue.map_value", index=2, + name='map_value', full_name='DtValue.map_value', index=2, number=3, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="hll_value", full_name="DtValue.hll_value", index=3, + name='hll_value', full_name='DtValue.hll_value', index=3, number=4, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="gset_value", full_name="DtValue.gset_value", index=4, + name='gset_value', full_name='DtValue.gset_value', index=4, number=5, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -370,28 +373,28 @@ _DTFETCHRESP = _descriptor.Descriptor( - name="DtFetchResp", - full_name="DtFetchResp", + name='DtFetchResp', + full_name='DtFetchResp', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="context", full_name="DtFetchResp.context", index=0, + name='context', full_name='DtFetchResp.context', index=0, number=1, type=12, cpp_type=9, label=1, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="type", full_name="DtFetchResp.type", index=1, + name='type', full_name='DtFetchResp.type', index=1, number=2, type=14, cpp_type=8, label=2, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="value", full_name="DtFetchResp.value", index=2, + name='value', full_name='DtFetchResp.value', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, @@ -413,14 +416,14 @@ _COUNTEROP = _descriptor.Descriptor( - name="CounterOp", - full_name="CounterOp", + name='CounterOp', + full_name='CounterOp', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="increment", full_name="CounterOp.increment", index=0, + name='increment', full_name='CounterOp.increment', index=0, number=1, type=18, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, @@ -441,21 +444,21 @@ _SETOP = _descriptor.Descriptor( - name="SetOp", - full_name="SetOp", + name='SetOp', + full_name='SetOp', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="adds", full_name="SetOp.adds", index=0, + name='adds', full_name='SetOp.adds', index=0, number=1, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="removes", full_name="SetOp.removes", index=1, + name='removes', full_name='SetOp.removes', index=1, number=2, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -476,14 +479,14 @@ _GSETOP = _descriptor.Descriptor( - name="GSetOp", - full_name="GSetOp", + name='GSetOp', + full_name='GSetOp', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="adds", full_name="GSetOp.adds", index=0, + name='adds', full_name='GSetOp.adds', index=0, number=1, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -504,14 +507,14 @@ _HLLOP = _descriptor.Descriptor( - name="HllOp", - full_name="HllOp", + name='HllOp', + full_name='HllOp', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="adds", full_name="HllOp.adds", index=0, + name='adds', full_name='HllOp.adds', index=0, number=1, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -532,49 +535,49 @@ _MAPUPDATE = _descriptor.Descriptor( - name="MapUpdate", - full_name="MapUpdate", + name='MapUpdate', + full_name='MapUpdate', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="field", full_name="MapUpdate.field", index=0, + name='field', full_name='MapUpdate.field', index=0, number=1, type=11, cpp_type=10, label=2, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="counter_op", full_name="MapUpdate.counter_op", index=1, + name='counter_op', full_name='MapUpdate.counter_op', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="set_op", full_name="MapUpdate.set_op", index=2, + name='set_op', full_name='MapUpdate.set_op', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="register_op", full_name="MapUpdate.register_op", index=3, + name='register_op', full_name='MapUpdate.register_op', index=3, number=4, type=12, cpp_type=9, label=1, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="flag_op", full_name="MapUpdate.flag_op", index=4, + name='flag_op', full_name='MapUpdate.flag_op', index=4, number=5, type=14, cpp_type=8, label=1, has_default_value=False, default_value=1, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="map_op", full_name="MapUpdate.map_op", index=5, + name='map_op', full_name='MapUpdate.map_op', index=5, number=6, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, @@ -596,21 +599,21 @@ _MAPOP = _descriptor.Descriptor( - name="MapOp", - full_name="MapOp", + name='MapOp', + full_name='MapOp', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="removes", full_name="MapOp.removes", index=0, + name='removes', full_name='MapOp.removes', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="updates", full_name="MapOp.updates", index=1, + name='updates', full_name='MapOp.updates', index=1, number=2, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -631,42 +634,42 @@ _DTOP = _descriptor.Descriptor( - name="DtOp", - full_name="DtOp", + name='DtOp', + full_name='DtOp', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="counter_op", full_name="DtOp.counter_op", index=0, + name='counter_op', full_name='DtOp.counter_op', index=0, number=1, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="set_op", full_name="DtOp.set_op", index=1, + name='set_op', full_name='DtOp.set_op', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="map_op", full_name="DtOp.map_op", index=2, + name='map_op', full_name='DtOp.map_op', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="hll_op", full_name="DtOp.hll_op", index=3, + name='hll_op', full_name='DtOp.hll_op', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="gset_op", full_name="DtOp.gset_op", index=4, + name='gset_op', full_name='DtOp.gset_op', index=4, number=5, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, @@ -687,98 +690,98 @@ _DTUPDATEREQ = _descriptor.Descriptor( - name="DtUpdateReq", - full_name="DtUpdateReq", + name='DtUpdateReq', + full_name='DtUpdateReq', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="bucket", full_name="DtUpdateReq.bucket", index=0, + name='bucket', full_name='DtUpdateReq.bucket', index=0, number=1, type=12, cpp_type=9, label=2, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="key", full_name="DtUpdateReq.key", index=1, + name='key', full_name='DtUpdateReq.key', index=1, number=2, type=12, cpp_type=9, label=1, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="type", full_name="DtUpdateReq.type", index=2, + name='type', full_name='DtUpdateReq.type', index=2, number=3, type=12, cpp_type=9, label=2, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="context", full_name="DtUpdateReq.context", index=3, + name='context', full_name='DtUpdateReq.context', index=3, number=4, type=12, cpp_type=9, label=1, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="op", full_name="DtUpdateReq.op", index=4, + name='op', full_name='DtUpdateReq.op', index=4, number=5, type=11, cpp_type=10, label=2, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="w", full_name="DtUpdateReq.w", index=5, + name='w', full_name='DtUpdateReq.w', index=5, number=6, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="dw", full_name="DtUpdateReq.dw", index=6, + name='dw', full_name='DtUpdateReq.dw', index=6, number=7, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="pw", full_name="DtUpdateReq.pw", index=7, + name='pw', full_name='DtUpdateReq.pw', index=7, number=8, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="return_body", full_name="DtUpdateReq.return_body", index=8, + name='return_body', full_name='DtUpdateReq.return_body', index=8, number=9, type=8, cpp_type=7, label=1, has_default_value=True, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="timeout", full_name="DtUpdateReq.timeout", index=9, + name='timeout', full_name='DtUpdateReq.timeout', index=9, number=10, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="sloppy_quorum", full_name="DtUpdateReq.sloppy_quorum", index=10, + name='sloppy_quorum', full_name='DtUpdateReq.sloppy_quorum', index=10, number=11, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="n_val", full_name="DtUpdateReq.n_val", index=11, + name='n_val', full_name='DtUpdateReq.n_val', index=11, number=12, type=13, cpp_type=3, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="include_context", full_name="DtUpdateReq.include_context", index=12, + name='include_context', full_name='DtUpdateReq.include_context', index=12, number=13, type=8, cpp_type=7, label=1, has_default_value=True, default_value=True, message_type=None, enum_type=None, containing_type=None, @@ -799,56 +802,56 @@ _DTUPDATERESP = _descriptor.Descriptor( - name="DtUpdateResp", - full_name="DtUpdateResp", + name='DtUpdateResp', + full_name='DtUpdateResp', filename=None, file=DESCRIPTOR, containing_type=None, fields=[ _descriptor.FieldDescriptor( - name="key", full_name="DtUpdateResp.key", index=0, + name='key', full_name='DtUpdateResp.key', index=0, number=1, type=12, cpp_type=9, label=1, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="context", full_name="DtUpdateResp.context", index=1, + name='context', full_name='DtUpdateResp.context', index=1, number=2, type=12, cpp_type=9, label=1, has_default_value=False, default_value="", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="counter_value", full_name="DtUpdateResp.counter_value", index=2, + name='counter_value', full_name='DtUpdateResp.counter_value', index=2, number=3, type=18, cpp_type=2, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="set_value", full_name="DtUpdateResp.set_value", index=3, + name='set_value', full_name='DtUpdateResp.set_value', index=3, number=4, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="map_value", full_name="DtUpdateResp.map_value", index=4, + name='map_value', full_name='DtUpdateResp.map_value', index=4, number=5, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="hll_value", full_name="DtUpdateResp.hll_value", index=5, + name='hll_value', full_name='DtUpdateResp.hll_value', index=5, number=6, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, options=None), _descriptor.FieldDescriptor( - name="gset_value", full_name="DtUpdateResp.gset_value", index=6, + name='gset_value', full_name='DtUpdateResp.gset_value', index=6, number=7, type=12, cpp_type=9, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, @@ -867,117 +870,115 @@ serialized_end=1733, ) -_MAPFIELD.fields_by_name["type"].enum_type = _MAPFIELD_MAPFIELDTYPE -_MAPFIELD_MAPFIELDTYPE.containing_type = _MAPFIELD; # NOQA E703 -_MAPENTRY.fields_by_name["field"].message_type = _MAPFIELD -_MAPENTRY.fields_by_name["map_value"].message_type = _MAPENTRY -_DTVALUE.fields_by_name["map_value"].message_type = _MAPENTRY -_DTFETCHRESP.fields_by_name["type"].enum_type = _DTFETCHRESP_DATATYPE -_DTFETCHRESP.fields_by_name["value"].message_type = _DTVALUE -_DTFETCHRESP_DATATYPE.containing_type = _DTFETCHRESP; # NOQA E703 -_MAPUPDATE.fields_by_name["field"].message_type = _MAPFIELD -_MAPUPDATE.fields_by_name["counter_op"].message_type = _COUNTEROP -_MAPUPDATE.fields_by_name["set_op"].message_type = _SETOP -_MAPUPDATE.fields_by_name["flag_op"].enum_type = _MAPUPDATE_FLAGOP -_MAPUPDATE.fields_by_name["map_op"].message_type = _MAPOP -_MAPUPDATE_FLAGOP.containing_type = _MAPUPDATE; # NOQA E703 -_MAPOP.fields_by_name["removes"].message_type = _MAPFIELD -_MAPOP.fields_by_name["updates"].message_type = _MAPUPDATE -_DTOP.fields_by_name["counter_op"].message_type = _COUNTEROP -_DTOP.fields_by_name["set_op"].message_type = _SETOP -_DTOP.fields_by_name["map_op"].message_type = _MAPOP -_DTOP.fields_by_name["hll_op"].message_type = _HLLOP -_DTOP.fields_by_name["gset_op"].message_type = _GSETOP -_DTUPDATEREQ.fields_by_name["op"].message_type = _DTOP -_DTUPDATERESP.fields_by_name["map_value"].message_type = _MAPENTRY -DESCRIPTOR.message_types_by_name["MapField"] = _MAPFIELD -DESCRIPTOR.message_types_by_name["MapEntry"] = _MAPENTRY -DESCRIPTOR.message_types_by_name["DtFetchReq"] = _DTFETCHREQ -DESCRIPTOR.message_types_by_name["DtValue"] = _DTVALUE -DESCRIPTOR.message_types_by_name["DtFetchResp"] = _DTFETCHRESP -DESCRIPTOR.message_types_by_name["CounterOp"] = _COUNTEROP -DESCRIPTOR.message_types_by_name["SetOp"] = _SETOP -DESCRIPTOR.message_types_by_name["GSetOp"] = _GSETOP -DESCRIPTOR.message_types_by_name["HllOp"] = _HLLOP -DESCRIPTOR.message_types_by_name["MapUpdate"] = _MAPUPDATE -DESCRIPTOR.message_types_by_name["MapOp"] = _MAPOP -DESCRIPTOR.message_types_by_name["DtOp"] = _DTOP -DESCRIPTOR.message_types_by_name["DtUpdateReq"] = _DTUPDATEREQ -DESCRIPTOR.message_types_by_name["DtUpdateResp"] = _DTUPDATERESP - - -class MapField(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +_MAPFIELD.fields_by_name['type'].enum_type = _MAPFIELD_MAPFIELDTYPE +_MAPFIELD_MAPFIELDTYPE.containing_type = _MAPFIELD; +_MAPENTRY.fields_by_name['field'].message_type = _MAPFIELD +_MAPENTRY.fields_by_name['map_value'].message_type = _MAPENTRY +_DTVALUE.fields_by_name['map_value'].message_type = _MAPENTRY +_DTFETCHRESP.fields_by_name['type'].enum_type = _DTFETCHRESP_DATATYPE +_DTFETCHRESP.fields_by_name['value'].message_type = _DTVALUE +_DTFETCHRESP_DATATYPE.containing_type = _DTFETCHRESP; +_MAPUPDATE.fields_by_name['field'].message_type = _MAPFIELD +_MAPUPDATE.fields_by_name['counter_op'].message_type = _COUNTEROP +_MAPUPDATE.fields_by_name['set_op'].message_type = _SETOP +_MAPUPDATE.fields_by_name['flag_op'].enum_type = _MAPUPDATE_FLAGOP +_MAPUPDATE.fields_by_name['map_op'].message_type = _MAPOP +_MAPUPDATE_FLAGOP.containing_type = _MAPUPDATE; +_MAPOP.fields_by_name['removes'].message_type = _MAPFIELD +_MAPOP.fields_by_name['updates'].message_type = _MAPUPDATE +_DTOP.fields_by_name['counter_op'].message_type = _COUNTEROP +_DTOP.fields_by_name['set_op'].message_type = _SETOP +_DTOP.fields_by_name['map_op'].message_type = _MAPOP +_DTOP.fields_by_name['hll_op'].message_type = _HLLOP +_DTOP.fields_by_name['gset_op'].message_type = _GSETOP +_DTUPDATEREQ.fields_by_name['op'].message_type = _DTOP +_DTUPDATERESP.fields_by_name['map_value'].message_type = _MAPENTRY +DESCRIPTOR.message_types_by_name['MapField'] = _MAPFIELD +DESCRIPTOR.message_types_by_name['MapEntry'] = _MAPENTRY +DESCRIPTOR.message_types_by_name['DtFetchReq'] = _DTFETCHREQ +DESCRIPTOR.message_types_by_name['DtValue'] = _DTVALUE +DESCRIPTOR.message_types_by_name['DtFetchResp'] = _DTFETCHRESP +DESCRIPTOR.message_types_by_name['CounterOp'] = _COUNTEROP +DESCRIPTOR.message_types_by_name['SetOp'] = _SETOP +DESCRIPTOR.message_types_by_name['GSetOp'] = _GSETOP +DESCRIPTOR.message_types_by_name['HllOp'] = _HLLOP +DESCRIPTOR.message_types_by_name['MapUpdate'] = _MAPUPDATE +DESCRIPTOR.message_types_by_name['MapOp'] = _MAPOP +DESCRIPTOR.message_types_by_name['DtOp'] = _DTOP +DESCRIPTOR.message_types_by_name['DtUpdateReq'] = _DTUPDATEREQ +DESCRIPTOR.message_types_by_name['DtUpdateResp'] = _DTUPDATERESP + +class MapField(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _MAPFIELD + # @@protoc_insertion_point(class_scope:MapField) -class MapEntry(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class MapEntry(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _MAPENTRY + # @@protoc_insertion_point(class_scope:MapEntry) -class DtFetchReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class DtFetchReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _DTFETCHREQ + # @@protoc_insertion_point(class_scope:DtFetchReq) -class DtValue(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class DtValue(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _DTVALUE + # @@protoc_insertion_point(class_scope:DtValue) -class DtFetchResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class DtFetchResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _DTFETCHRESP + # @@protoc_insertion_point(class_scope:DtFetchResp) -class CounterOp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class CounterOp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _COUNTEROP + # @@protoc_insertion_point(class_scope:CounterOp) -class SetOp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class SetOp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _SETOP + # @@protoc_insertion_point(class_scope:SetOp) -class GSetOp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class GSetOp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _GSETOP + # @@protoc_insertion_point(class_scope:GSetOp) -class HllOp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class HllOp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _HLLOP + # @@protoc_insertion_point(class_scope:HllOp) -class MapUpdate(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class MapUpdate(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _MAPUPDATE + # @@protoc_insertion_point(class_scope:MapUpdate) -class MapOp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class MapOp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _MAPOP + # @@protoc_insertion_point(class_scope:MapOp) -class DtOp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class DtOp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _DTOP + # @@protoc_insertion_point(class_scope:DtOp) -class DtUpdateReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class DtUpdateReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _DTUPDATEREQ + # @@protoc_insertion_point(class_scope:DtUpdateReq) -class DtUpdateResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class DtUpdateResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _DTUPDATERESP # @@protoc_insertion_point(class_scope:DtUpdateResp) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\010RiakDtPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\010RiakDtPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/pb/riak_kv_pb2.py b/riak/pb/riak_kv_pb2.py index 542a395b..80e63fcb 100644 --- a/riak/pb/riak_kv_pb2.py +++ b/riak/pb/riak_kv_pb2.py @@ -11,6 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. + # Generated by the protocol buffer compiler. DO NOT EDIT! # source: riak_kv.proto @@ -1793,193 +1794,162 @@ DESCRIPTOR.message_types_by_name['RpbCoverageResp'] = _RPBCOVERAGERESP DESCRIPTOR.message_types_by_name['RpbCoverageEntry'] = _RPBCOVERAGEENTRY -class RpbGetClientIdResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbGetClientIdResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBGETCLIENTIDRESP # @@protoc_insertion_point(class_scope:RpbGetClientIdResp) -class RpbSetClientIdReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbSetClientIdReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBSETCLIENTIDREQ # @@protoc_insertion_point(class_scope:RpbSetClientIdReq) -class RpbGetReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbGetReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBGETREQ # @@protoc_insertion_point(class_scope:RpbGetReq) -class RpbGetResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbGetResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBGETRESP # @@protoc_insertion_point(class_scope:RpbGetResp) -class RpbPutReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbPutReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBPUTREQ # @@protoc_insertion_point(class_scope:RpbPutReq) -class RpbPutResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbPutResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBPUTRESP # @@protoc_insertion_point(class_scope:RpbPutResp) -class RpbDelReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbDelReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBDELREQ # @@protoc_insertion_point(class_scope:RpbDelReq) -class RpbListBucketsReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbListBucketsReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBLISTBUCKETSREQ # @@protoc_insertion_point(class_scope:RpbListBucketsReq) -class RpbListBucketsResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbListBucketsResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBLISTBUCKETSRESP # @@protoc_insertion_point(class_scope:RpbListBucketsResp) -class RpbListKeysReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbListKeysReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBLISTKEYSREQ # @@protoc_insertion_point(class_scope:RpbListKeysReq) -class RpbListKeysResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbListKeysResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBLISTKEYSRESP # @@protoc_insertion_point(class_scope:RpbListKeysResp) -class RpbMapRedReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbMapRedReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBMAPREDREQ # @@protoc_insertion_point(class_scope:RpbMapRedReq) -class RpbMapRedResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbMapRedResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBMAPREDRESP # @@protoc_insertion_point(class_scope:RpbMapRedResp) -class RpbIndexReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbIndexReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBINDEXREQ # @@protoc_insertion_point(class_scope:RpbIndexReq) -class RpbIndexResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbIndexResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBINDEXRESP # @@protoc_insertion_point(class_scope:RpbIndexResp) -class RpbIndexBodyResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbIndexBodyResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBINDEXBODYRESP # @@protoc_insertion_point(class_scope:RpbIndexBodyResp) -class RpbCSBucketReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbCSBucketReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCSBUCKETREQ # @@protoc_insertion_point(class_scope:RpbCSBucketReq) -class RpbCSBucketResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbCSBucketResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCSBUCKETRESP # @@protoc_insertion_point(class_scope:RpbCSBucketResp) -class RpbIndexObject(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbIndexObject(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBINDEXOBJECT # @@protoc_insertion_point(class_scope:RpbIndexObject) -class RpbContent(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbContent(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCONTENT # @@protoc_insertion_point(class_scope:RpbContent) -class RpbLink(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbLink(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBLINK # @@protoc_insertion_point(class_scope:RpbLink) -class RpbCounterUpdateReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbCounterUpdateReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCOUNTERUPDATEREQ # @@protoc_insertion_point(class_scope:RpbCounterUpdateReq) -class RpbCounterUpdateResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbCounterUpdateResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCOUNTERUPDATERESP # @@protoc_insertion_point(class_scope:RpbCounterUpdateResp) -class RpbCounterGetReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbCounterGetReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCOUNTERGETREQ # @@protoc_insertion_point(class_scope:RpbCounterGetReq) -class RpbCounterGetResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbCounterGetResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCOUNTERGETRESP # @@protoc_insertion_point(class_scope:RpbCounterGetResp) -class RpbGetBucketKeyPreflistReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbGetBucketKeyPreflistReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBGETBUCKETKEYPREFLISTREQ # @@protoc_insertion_point(class_scope:RpbGetBucketKeyPreflistReq) -class RpbGetBucketKeyPreflistResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbGetBucketKeyPreflistResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBGETBUCKETKEYPREFLISTRESP # @@protoc_insertion_point(class_scope:RpbGetBucketKeyPreflistResp) -class RpbBucketKeyPreflistItem(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbBucketKeyPreflistItem(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBBUCKETKEYPREFLISTITEM # @@protoc_insertion_point(class_scope:RpbBucketKeyPreflistItem) -class RpbCoverageReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbCoverageReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCOVERAGEREQ # @@protoc_insertion_point(class_scope:RpbCoverageReq) -class RpbCoverageResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbCoverageResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCOVERAGERESP # @@protoc_insertion_point(class_scope:RpbCoverageResp) -class RpbCoverageEntry(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbCoverageEntry(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCOVERAGEENTRY # @@protoc_insertion_point(class_scope:RpbCoverageEntry) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\010RiakKvPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\010RiakKvPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/pb/riak_pb2.py b/riak/pb/riak_pb2.py index 174f6e95..a6cb9a4e 100644 --- a/riak/pb/riak_pb2.py +++ b/riak/pb/riak_pb2.py @@ -722,85 +722,72 @@ DESCRIPTOR.message_types_by_name['RpbBucketProps'] = _RPBBUCKETPROPS DESCRIPTOR.message_types_by_name['RpbAuthReq'] = _RPBAUTHREQ -class RpbErrorResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbErrorResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBERRORRESP # @@protoc_insertion_point(class_scope:RpbErrorResp) -class RpbGetServerInfoResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbGetServerInfoResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBGETSERVERINFORESP # @@protoc_insertion_point(class_scope:RpbGetServerInfoResp) -class RpbPair(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbPair(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBPAIR # @@protoc_insertion_point(class_scope:RpbPair) -class RpbGetBucketReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbGetBucketReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBGETBUCKETREQ # @@protoc_insertion_point(class_scope:RpbGetBucketReq) -class RpbGetBucketResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbGetBucketResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBGETBUCKETRESP # @@protoc_insertion_point(class_scope:RpbGetBucketResp) -class RpbSetBucketReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbSetBucketReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBSETBUCKETREQ # @@protoc_insertion_point(class_scope:RpbSetBucketReq) -class RpbResetBucketReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbResetBucketReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBRESETBUCKETREQ # @@protoc_insertion_point(class_scope:RpbResetBucketReq) -class RpbGetBucketTypeReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbGetBucketTypeReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBGETBUCKETTYPEREQ # @@protoc_insertion_point(class_scope:RpbGetBucketTypeReq) -class RpbSetBucketTypeReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbSetBucketTypeReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBSETBUCKETTYPEREQ # @@protoc_insertion_point(class_scope:RpbSetBucketTypeReq) -class RpbModFun(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbModFun(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBMODFUN # @@protoc_insertion_point(class_scope:RpbModFun) -class RpbCommitHook(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbCommitHook(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBCOMMITHOOK # @@protoc_insertion_point(class_scope:RpbCommitHook) -class RpbBucketProps(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbBucketProps(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBBUCKETPROPS # @@protoc_insertion_point(class_scope:RpbBucketProps) -class RpbAuthReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbAuthReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBAUTHREQ # @@protoc_insertion_point(class_scope:RpbAuthReq) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\006RiakPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\006RiakPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/pb/riak_search_pb2.py b/riak/pb/riak_search_pb2.py index 691b5307..90f8785b 100644 --- a/riak/pb/riak_search_pb2.py +++ b/riak/pb/riak_search_pb2.py @@ -199,25 +199,22 @@ DESCRIPTOR.message_types_by_name['RpbSearchQueryReq'] = _RPBSEARCHQUERYREQ DESCRIPTOR.message_types_by_name['RpbSearchQueryResp'] = _RPBSEARCHQUERYRESP -class RpbSearchDoc(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbSearchDoc(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBSEARCHDOC # @@protoc_insertion_point(class_scope:RpbSearchDoc) -class RpbSearchQueryReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbSearchQueryReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBSEARCHQUERYREQ # @@protoc_insertion_point(class_scope:RpbSearchQueryReq) -class RpbSearchQueryResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbSearchQueryResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBSEARCHQUERYRESP # @@protoc_insertion_point(class_scope:RpbSearchQueryResp) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\014RiakSearchPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\014RiakSearchPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/pb/riak_ts_pb2.py b/riak/pb/riak_ts_pb2.py index 15573751..b74978c9 100644 --- a/riak/pb/riak_ts_pb2.py +++ b/riak/pb/riak_ts_pb2.py @@ -819,115 +819,97 @@ DESCRIPTOR.message_types_by_name['TsCoverageEntry'] = _TSCOVERAGEENTRY DESCRIPTOR.message_types_by_name['TsRange'] = _TSRANGE -class TsQueryReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsQueryReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSQUERYREQ # @@protoc_insertion_point(class_scope:TsQueryReq) -class TsQueryResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsQueryResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSQUERYRESP # @@protoc_insertion_point(class_scope:TsQueryResp) -class TsGetReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsGetReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSGETREQ # @@protoc_insertion_point(class_scope:TsGetReq) -class TsGetResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsGetResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSGETRESP # @@protoc_insertion_point(class_scope:TsGetResp) -class TsPutReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsPutReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSPUTREQ # @@protoc_insertion_point(class_scope:TsPutReq) -class TsPutResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsPutResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSPUTRESP # @@protoc_insertion_point(class_scope:TsPutResp) -class TsDelReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsDelReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSDELREQ # @@protoc_insertion_point(class_scope:TsDelReq) -class TsDelResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsDelResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSDELRESP # @@protoc_insertion_point(class_scope:TsDelResp) -class TsInterpolation(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsInterpolation(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSINTERPOLATION # @@protoc_insertion_point(class_scope:TsInterpolation) -class TsColumnDescription(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsColumnDescription(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSCOLUMNDESCRIPTION # @@protoc_insertion_point(class_scope:TsColumnDescription) -class TsRow(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsRow(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSROW # @@protoc_insertion_point(class_scope:TsRow) -class TsCell(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsCell(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSCELL # @@protoc_insertion_point(class_scope:TsCell) -class TsListKeysReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsListKeysReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSLISTKEYSREQ # @@protoc_insertion_point(class_scope:TsListKeysReq) -class TsListKeysResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsListKeysResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSLISTKEYSRESP # @@protoc_insertion_point(class_scope:TsListKeysResp) -class TsCoverageReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsCoverageReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSCOVERAGEREQ # @@protoc_insertion_point(class_scope:TsCoverageReq) -class TsCoverageResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsCoverageResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSCOVERAGERESP # @@protoc_insertion_point(class_scope:TsCoverageResp) -class TsCoverageEntry(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsCoverageEntry(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSCOVERAGEENTRY # @@protoc_insertion_point(class_scope:TsCoverageEntry) -class TsRange(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class TsRange(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _TSRANGE # @@protoc_insertion_point(class_scope:TsRange) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\010RiakTsPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\010RiakTsPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/pb/riak_yokozuna_pb2.py b/riak/pb/riak_yokozuna_pb2.py index a6a58724..6913d0f7 100644 --- a/riak/pb/riak_yokozuna_pb2.py +++ b/riak/pb/riak_yokozuna_pb2.py @@ -325,61 +325,52 @@ DESCRIPTOR.message_types_by_name['RpbYokozunaSchemaGetReq'] = _RPBYOKOZUNASCHEMAGETREQ DESCRIPTOR.message_types_by_name['RpbYokozunaSchemaGetResp'] = _RPBYOKOZUNASCHEMAGETRESP -class RpbYokozunaIndex(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbYokozunaIndex(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBYOKOZUNAINDEX # @@protoc_insertion_point(class_scope:RpbYokozunaIndex) -class RpbYokozunaIndexGetReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbYokozunaIndexGetReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBYOKOZUNAINDEXGETREQ # @@protoc_insertion_point(class_scope:RpbYokozunaIndexGetReq) -class RpbYokozunaIndexGetResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbYokozunaIndexGetResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBYOKOZUNAINDEXGETRESP # @@protoc_insertion_point(class_scope:RpbYokozunaIndexGetResp) -class RpbYokozunaIndexPutReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbYokozunaIndexPutReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBYOKOZUNAINDEXPUTREQ # @@protoc_insertion_point(class_scope:RpbYokozunaIndexPutReq) -class RpbYokozunaIndexDeleteReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbYokozunaIndexDeleteReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBYOKOZUNAINDEXDELETEREQ # @@protoc_insertion_point(class_scope:RpbYokozunaIndexDeleteReq) -class RpbYokozunaSchema(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbYokozunaSchema(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBYOKOZUNASCHEMA # @@protoc_insertion_point(class_scope:RpbYokozunaSchema) -class RpbYokozunaSchemaPutReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbYokozunaSchemaPutReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBYOKOZUNASCHEMAPUTREQ # @@protoc_insertion_point(class_scope:RpbYokozunaSchemaPutReq) -class RpbYokozunaSchemaGetReq(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbYokozunaSchemaGetReq(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBYOKOZUNASCHEMAGETREQ # @@protoc_insertion_point(class_scope:RpbYokozunaSchemaGetReq) -class RpbYokozunaSchemaGetResp(_message.Message): - __metaclass__ = _reflection.GeneratedProtocolMessageType +class RpbYokozunaSchemaGetResp(_message.Message, metaclass=_reflection.GeneratedProtocolMessageType): DESCRIPTOR = _RPBYOKOZUNASCHEMAGETRESP # @@protoc_insertion_point(class_scope:RpbYokozunaSchemaGetResp) DESCRIPTOR.has_options = True -DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), '\n\027com.basho.riak.protobufB\016RiakYokozunaPB') +DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), b'\n\027com.basho.riak.protobufB\016RiakYokozunaPB') # @@protoc_insertion_point(module_scope) diff --git a/riak/tests/test_2i.py b/riak/tests/test_2i.py index 772734d8..d4d7d5f0 100644 --- a/riak/tests/test_2i.py +++ b/riak/tests/test_2i.py @@ -17,6 +17,9 @@ from riak import RiakError from riak.tests import RUN_INDEXES from riak.tests.base import IntegrationTestBase +import faulthandler +import signal +faulthandler.register(signal.SIGUSR1) class TwoITests(IntegrationTestBase, unittest.TestCase): diff --git a/riak/transports/pool.py b/riak/transports/pool.py index be879aab..d3482614 100644 --- a/riak/transports/pool.py +++ b/riak/transports/pool.py @@ -276,7 +276,6 @@ def __iter__(self): return self def __next__(self): - # Python 2.x version if len(self.targets) == 0: raise StopIteration if len(self.unlocked) == 0: diff --git a/riak/transports/tcp/stream.py b/riak/transports/tcp/stream.py index 6124bcb7..8f581db7 100644 --- a/riak/transports/tcp/stream.py +++ b/riak/transports/tcp/stream.py @@ -88,7 +88,7 @@ class PbufKeyStream(PbufStream): _expect = riak.pb.messages.MSG_CODE_LIST_KEYS_RESP def __next__(self): - response = next(super(PbufKeyStream, self)) + response = super(PbufKeyStream, self).__next__() if response.done and len(response.keys) == 0: raise StopIteration @@ -105,7 +105,7 @@ class PbufMapredStream(PbufStream): _expect = riak.pb.messages.MSG_CODE_MAP_RED_RESP def __next__(self): - response = next(super(PbufMapredStream, self)) + response = super(PbufMapredStream, self).__next__() if response.done and not response.HasField("response"): raise StopIteration @@ -121,7 +121,7 @@ class PbufBucketStream(PbufStream): _expect = riak.pb.messages.MSG_CODE_LIST_BUCKETS_RESP def __next__(self): - response = next(super(PbufBucketStream, self)) + response = super(PbufBucketStream, self).__next__() if response.done and len(response.buckets) == 0: raise StopIteration @@ -143,7 +143,7 @@ def __init__(self, transport, codec, index, return_terms=False): self.return_terms = return_terms def __next__(self): - response = next(super(PbufIndexStream, self)) + response = super(PbufIndexStream, self).__next__() if response.done and not (response.keys or response.results or response.continuation): raise StopIteration @@ -171,7 +171,7 @@ def __init__(self, transport, codec, convert_timestamp=False): self._convert_timestamp = convert_timestamp def __next__(self): - response = next(super(PbufTsKeyStream, self)) + response = super(PbufTsKeyStream, self).__next__() if response.done and len(response.keys) == 0: raise StopIteration diff --git a/setup.py b/setup.py index 422daaac..a13e1405 100755 --- a/setup.py +++ b/setup.py @@ -6,8 +6,8 @@ from version import get_version from commands import setup_timeseries, build_messages -install_requires = ["six >= 1.8.0", "basho_erlastic >= 2.1.1"] -requires = ["six(>=1.8.0)", "basho_erlastic(>= 2.1.1)"] +install_requires = ["basho_erlastic >= 2.1.1"] +requires = ["basho_erlastic(>= 2.1.1)"] install_requires.append("python3_protobuf >=2.4.1, <2.6.0") requires.append("python3_protobuf(>=2.4.1, <2.6.0)") @@ -17,7 +17,7 @@ try: import pypandoc - long_description = pypandoc.convert("README.md", "rst") + long_description = pypandoc.convert_file("README.md", "rst") with codecs.open("README.rst", "w", "utf-8") as f: f.write(long_description) except(IOError, ImportError): From ccb0f14ed6ee019cad69f842dc42b083ba9509af Mon Sep 17 00:00:00 2001 From: Travis Woodruff Date: Thu, 12 Aug 2021 15:41:37 -0500 Subject: [PATCH 07/15] Remove debugging code --- riak/tests/test_2i.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/riak/tests/test_2i.py b/riak/tests/test_2i.py index d4d7d5f0..772734d8 100644 --- a/riak/tests/test_2i.py +++ b/riak/tests/test_2i.py @@ -17,9 +17,6 @@ from riak import RiakError from riak.tests import RUN_INDEXES from riak.tests.base import IntegrationTestBase -import faulthandler -import signal -faulthandler.register(signal.SIGUSR1) class TwoITests(IntegrationTestBase, unittest.TestCase): From 955adb07ae7d2c5a6fd5c54e44b0ca2ca12bb0d4 Mon Sep 17 00:00:00 2001 From: Travis Woodruff Date: Thu, 12 Aug 2021 16:13:58 -0500 Subject: [PATCH 08/15] Remove a few remaining `six` references --- commands.py | 1 - riak/tests/test_timeseries_pbuf.py | 3 +-- riak/tests/test_timeseries_ttb.py | 30 ++++++++++++++---------------- 3 files changed, 15 insertions(+), 19 deletions(-) diff --git a/commands.py b/commands.py index 0d78ab59..afe5f450 100644 --- a/commands.py +++ b/commands.py @@ -248,7 +248,6 @@ def _message_class(self): # NOTE: TO RUN THIS SUCCESSFULLY, YOU NEED TO HAVE THESE # PACKAGES INSTALLED: # protobuf or python3_protobuf -# six # # Run the following command to install them: # python setup.py install diff --git a/riak/tests/test_timeseries_pbuf.py b/riak/tests/test_timeseries_pbuf.py index a5b8d06e..bbda0f55 100644 --- a/riak/tests/test_timeseries_pbuf.py +++ b/riak/tests/test_timeseries_pbuf.py @@ -16,7 +16,6 @@ import unittest import riak.pb.riak_ts_pb2 -import six from riak import RiakError from riak.codecs.pbuf import PbufCodec @@ -509,5 +508,5 @@ def test_store_and_fetch_gh_483(self): row = ts_obj.rows[0] self.assertEqual(len(row), 5) - exp = [six.b("hash1"), six.b("user2"), now, six.b("frazzle"), 12.3] + exp = [b"hash1", b"user2", now, b"frazzle", 12.3] self.assertEqual(row, exp) diff --git a/riak/tests/test_timeseries_ttb.py b/riak/tests/test_timeseries_ttb.py index 0bdc4cc5..ff971f3a 100644 --- a/riak/tests/test_timeseries_ttb.py +++ b/riak/tests/test_timeseries_ttb.py @@ -16,8 +16,6 @@ import logging import unittest -import six - from erlastic import decode, encode from erlastic.types import Atom from riak import RiakError @@ -50,8 +48,8 @@ str0 = "ascii-0" str1 = "ascii-1" -bd0 = six.u("时间序列") -bd1 = six.u("временные ряды") +bd0 = "时间序列" +bd1 = "временные ряды" blob0 = b"\x00\x01\x02\x03\x04\x05\x06\x07" @@ -228,8 +226,8 @@ def test_store_and_fetch_gh_483(self): row = ts_obj.rows[0] self.assertEqual(len(row), 5) - exp = [six.b("hash1"), six.b("user2"), now, - six.b("frazzle"), 12.3] + exp = [b"hash1", b"user2", now, + b"frazzle", 12.3] self.assertEqual(row, exp) def test_store_and_fetch_and_query(self): @@ -250,16 +248,16 @@ def test_store_and_fetch_and_query(self): ] # NB: response data is binary exp_rows = [ - [six.b("hash1"), six.b("user2"), twentyFiveMinsAgo, - six.b("typhoon"), 90.3], - [six.b("hash1"), six.b("user2"), twentyMinsAgo, - six.b("hurricane"), 82.3], - [six.b("hash1"), six.b("user2"), fifteenMinsAgo, - six.b("rain"), 79.0], - [six.b("hash1"), six.b("user2"), fiveMinsAgo, - six.b("wind"), None], - [six.b("hash1"), six.b("user2"), now, - six.b("snow"), 20.1], + [b"hash1", b"user2", twentyFiveMinsAgo, + b"typhoon", 90.3], + [b"hash1", b"user2", twentyMinsAgo, + b"hurricane", 82.3], + [b"hash1", b"user2", fifteenMinsAgo, + b"rain", 79.0], + [b"hash1", b"user2", fiveMinsAgo, + b"wind", None], + [b"hash1", b"user2", now, + b"snow", 20.1], ] ts_obj = table.new(rows) result = ts_obj.store() From 6299e1c5607e4bbd19db434c3948b26dd76e84b1 Mon Sep 17 00:00:00 2001 From: Travis Woodruff Date: Thu, 12 Aug 2021 16:14:18 -0500 Subject: [PATCH 09/15] Fix failing Pool test --- riak/tests/test_pool.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/riak/tests/test_pool.py b/riak/tests/test_pool.py index ac7ce491..0589d49d 100644 --- a/riak/tests/test_pool.py +++ b/riak/tests/test_pool.py @@ -126,7 +126,7 @@ def test_removes_bad_resource(self): resource.append(2) try: with pool.transaction(): - raise BadResource + raise BadResource("bad resource") except BadResource: self.assertEqual(0, len(pool.resources)) with pool.transaction() as goodie: From 67c5356621ce90a30ed868c88ce37fef2cc74b9e Mon Sep 17 00:00:00 2001 From: risktoparkrageram Date: Fri, 13 Aug 2021 10:45:21 +0000 Subject: [PATCH 10/15] point mimetype default test to a file that we can't guess the mimetype of --- riak/tests/test_kv.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/riak/tests/test_kv.py b/riak/tests/test_kv.py index cfb39e97..54b1f2c0 100644 --- a/riak/tests/test_kv.py +++ b/riak/tests/test_kv.py @@ -733,8 +733,9 @@ def test_store_binary_object_from_file(self): def test_store_binary_object_from_file_should_use_default_mimetype(self): bucket = self.client.bucket(self.bucket_name) - filepath = os.path.join(os.path.dirname(os.path.abspath(__file__)), - os.pardir, os.pardir, "README.md") + filepath = os.path.join(os.path.dirname( + os.path.abspath(__file__)), os.pardir, os.pardir, "NOTICE", + ) obj = bucket.new_from_file(self.key_name, filepath) obj.store() obj = bucket.get(self.key_name) From fa46f1d83c4c94a70fce502493c90c15fac4ee18 Mon Sep 17 00:00:00 2001 From: risktoparkrageram Date: Fri, 13 Aug 2021 11:55:50 +0000 Subject: [PATCH 11/15] disable tests that use solr --- .runner | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.runner b/.runner index b5cd2134..c5010c0d 100755 --- a/.runner +++ b/.runner @@ -96,10 +96,10 @@ function export_test_environment_vars export RUN_DATATYPES=1 export RUN_INDEXES=1 export RUN_KV=1 - export RUN_MAPREDUCE=1 + export RUN_MAPREDUCE=0 export RUN_RESOLVE=1 export RUN_TIMESERIES=1 - export RUN_YZ=1 + export RUN_YZ=0 } function unexport_test_environment_vars From eae7acc7ec71f1a2a32e5b6774c7c1d9115b99ea Mon Sep 17 00:00:00 2001 From: Martha Giannoudovardi Date: Fri, 13 Aug 2021 14:24:04 +0100 Subject: [PATCH 12/15] Change next call to __nex__ --- riak/transports/http/stream.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/riak/transports/http/stream.py b/riak/transports/http/stream.py index 39351f7e..37871a45 100644 --- a/riak/transports/http/stream.py +++ b/riak/transports/http/stream.py @@ -141,7 +141,7 @@ class HttpMapReduceStream(HttpMultipartStream): """ def __next__(self): - message = next(super(HttpMapReduceStream, self)) + message = super(HttpMapReduceStream, self).__next__() payload = json.loads(message.get_payload()) return payload["phase"], payload["data"] @@ -157,7 +157,7 @@ def __init__(self, response, index, return_terms): self.return_terms = return_terms def __next__(self): - message = next(super(HttpIndexStream, self)) + message = super(HttpIndexStream, self).__next__() payload = json.loads(message.get_payload()) if "error" in payload: raise RiakError(payload["error"]) From f55cdd2753dc2058308914fa2fe0882904706cce Mon Sep 17 00:00:00 2001 From: Martha Giannoudovardi Date: Fri, 13 Aug 2021 14:44:56 +0100 Subject: [PATCH 13/15] Remove remnants of python 2 --- .runner | 4 ---- .travis.yml | 2 +- Makefile | 6 +++--- build/pyenv-setup | 16 +++------------- 4 files changed, 7 insertions(+), 21 deletions(-) diff --git a/.runner b/.runner index c5010c0d..1fc27286 100755 --- a/.runner +++ b/.runner @@ -60,10 +60,6 @@ function run_tests then tox else - if [[ $have_py2 == "true" ]] - then - python2 setup.py test - fi if [[ $have_py3 == "true" ]] then python3 setup.py test diff --git a/.travis.yml b/.travis.yml index 7c46a5cd..1db82718 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,8 +2,8 @@ sudo: required dist: trusty language: python python: - - '2.7' - '3.6' + - '3.7' - nightly addons: hosts: diff --git a/Makefile b/Makefile index 9f600a77..211d7b08 100644 --- a/Makefile +++ b/Makefile @@ -94,11 +94,11 @@ endif @echo "==> Python 3.5 (bdist_egg)" @python3.5 setup.py build --build-base=py-build/3.5 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) @echo "==> Python 3.6 (bdist_egg)" - @python3.5 setup.py build --build-base=py-build/3.6 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) + @python3.6 setup.py build --build-base=py-build/3.6 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) @echo "==> Python 3.7 (bdist_egg)" - @python3.5 setup.py build --build-base=py-build/3.7 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) + @python3.7 setup.py build --build-base=py-build/3.7 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) @echo "==> Python 3.8 (bdist_egg)" - @python3.5 setup.py build --build-base=py-build/3.8 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) + @python3.8 setup.py build --build-base=py-build/3.8 bdist_egg upload --repository $(PYPI_REPOSITORY) --show-response --sign --identity $(RELEASE_GPG_KEYNAME) .PHONY: unit-test unit-test: diff --git a/build/pyenv-setup b/build/pyenv-setup index 7759d45a..13a35b7e 100755 --- a/build/pyenv-setup +++ b/build/pyenv-setup @@ -50,11 +50,10 @@ fi do_pip_upgrades='false' -# NB: 2.7.8 is special-cased -for pyver in 2.7 3.3 3.4 3.5 3.6 +for pyver in 3.3 3.4 3.5 3.6 3.7 3.8 do riak_py_alias="riak_$pyver" - if ! pyenv versions | fgrep -v 'riak_2.7.8' | fgrep -q "$riak_py_alias" + if ! pyenv versions | fgrep -q "$riak_py_alias" then # Need to install it do_pip_upgrades='true' @@ -68,17 +67,8 @@ do fi done -if ! pyenv versions | fgrep -q 'riak_2.7.8' -then - # Need to install it - do_pip_upgrades='true' - - echo "[INFO] installing Python 2.7.8" - VERSION_ALIAS='riak_2.7.8' pyenv install '2.7.8' -fi - pushd $PROJDIR -pyenv local 'riak_3.6' 'riak_3.5' 'riak_3.4' 'riak_3.3' 'riak_2.7' 'riak_2.7.8' +pyenv local 'riak_3.8' 'riak_3.7' 'riak_3.6' 'riak_3.5' 'riak_3.4' 'riak_3.3' pyenv rehash From aa26c8659ada7773b9769dd95f7fb90a76fd7758 Mon Sep 17 00:00:00 2001 From: Martha Giannoudovardi Date: Fri, 13 Aug 2021 14:54:44 +0100 Subject: [PATCH 14/15] Run tox in 3.3 to 3.8 --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index 3e29001b..ec40a0ad 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ # test suite on all supported python versions. [tox] -envlist = py3 +envlist = py33,py34,py35,py36,py37,py38 [testenv] install_command = pip install --upgrade {packages} From 6f9424a02b0d0bd4ddb8fc2d2db735ac25abba22 Mon Sep 17 00:00:00 2001 From: Germain Chazot Date: Fri, 18 Mar 2022 10:41:33 +0100 Subject: [PATCH 15/15] Fix Submodule URLs to use HTTPS after git:// deprecation by GitHub --- .gitmodules | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index 510fba6e..7c6e1c90 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ [submodule "riak_pb"] path = riak_pb - url = git://github.com/basho/riak_pb.git + url = https://github.com/basho/riak_pb.git [submodule "tools"] path = tools - url = git://github.com/basho/riak-client-tools.git + url = https://github.com/basho/riak-client-tools.git [submodule "docs"] path = docs url = https://github.com/basho/riak-python-client.git