From 4ad3cff415260ad5d833d19d5a9e08a6ae073753 Mon Sep 17 00:00:00 2001 From: Barbara Miller Date: Thu, 18 May 2023 17:16:04 -0700 Subject: [PATCH] updates for rethinkdb 2.4.9 --- doublethink/orm.py | 6 ++++-- doublethink/rethinker.py | 6 ++++-- doublethink/services.py | 6 ++++-- setup.py | 4 ++-- tests/test_cli.py | 6 ++++-- tests/test_misc.py | 4 +++- tests/test_orm.py | 6 ++++-- tests/test_rethinker.py | 6 ++++-- tests/test_svcreg.py | 6 ++++-- 9 files changed, 33 insertions(+), 17 deletions(-) diff --git a/doublethink/orm.py b/doublethink/orm.py index 4e50189..d782777 100644 --- a/doublethink/orm.py +++ b/doublethink/orm.py @@ -1,7 +1,7 @@ ''' doublethink/orm.py - rethinkdb ORM -Copyright (C) 2017-2019 Internet Archive +Copyright (C) 2017-2023 Internet Archive Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,10 +16,12 @@ See the License for the specific language governing permissions and limitations under the License. ''' -import rethinkdb as r +import rethinkdb as rdb import logging import doublethink +r = rdb.RethinkDB() + class classproperty(object): def __init__(self, fget): self.fget = fget diff --git a/doublethink/rethinker.py b/doublethink/rethinker.py index 61f1b64..d17b532 100644 --- a/doublethink/rethinker.py +++ b/doublethink/rethinker.py @@ -1,7 +1,7 @@ ''' doublethink/rethinker.py - rethinkdb connection-manager -Copyright (C) 2015-2018 Internet Archive +Copyright (C) 2015-2023 Internet Archive Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,13 +16,15 @@ See the License for the specific language governing permissions and limitations under the License. ''' -import rethinkdb as r +import rethinkdb as rdb import logging import random import time import types import re +r = rdb.RethinkDB() + class RethinkerWrapper(object): logger = logging.getLogger('doublethink.RethinkerWrapper') def __init__(self, rr, wrapped): diff --git a/doublethink/services.py b/doublethink/services.py index f0f4e71..81d3b9f 100644 --- a/doublethink/services.py +++ b/doublethink/services.py @@ -1,7 +1,7 @@ ''' doublethink/services.py - rethinkdb service registry -Copyright (C) 2015-2017 Internet Archive +Copyright (C) 2015-2023 Internet Archive Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -16,12 +16,14 @@ See the License for the specific language governing permissions and limitations under the License. ''' -import rethinkdb as r +import rethinkdb as rdb import logging import socket import os import doublethink +r = rdb.RethinkDB() + class ServiceRegistry(object): ''' Simple rethinkdb service registry. diff --git a/setup.py b/setup.py index eb995b6..515b231 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ except: setuptools.setup( name='doublethink', - version='0.3.0', + version='0.4.0', packages=['doublethink'], classifiers=[ 'Programming Language :: Python :: 2.7', @@ -19,7 +19,7 @@ setuptools.setup( 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], - install_requires=['rethinkdb>=2.3,<2.4'], + install_requires=['rethinkdb>=2.4,<2.5'], extras_require={'test': test_deps}, url='https://github.com/internetarchive/doublethink', author='Noah Levitt', diff --git a/tests/test_cli.py b/tests/test_cli.py index f26c6bd..0821baf 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,7 +1,7 @@ ''' test_cli.py - unit tests for doublethink CLI -Copyright (C) 2015-2017 Internet Archive +Copyright (C) 2015-2023 Internet Archive Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -21,9 +21,11 @@ import doublethink.cli import logging import sys import pytest -import rethinkdb as r +import rethinkdb as rdb import pkg_resources +r = rdb.RethinkDB() + logging.basicConfig(stream=sys.stderr, level=logging.INFO, format="%(asctime)s %(process)d %(levelname)s %(threadName)s %(name)s.%(funcName)s(%(filename)s:%(lineno)d) %(message)s") diff --git a/tests/test_misc.py b/tests/test_misc.py index 4502bd4..994a267 100644 --- a/tests/test_misc.py +++ b/tests/test_misc.py @@ -20,9 +20,11 @@ import doublethink import logging import sys import pytest -import rethinkdb as r +import rethinkdb as rdb from doublethink import parse_rethinkdb_url +r = rdb.RethinkDB() + logging.basicConfig( stream=sys.stderr, level=logging.INFO, format=( '%(asctime)s %(process)d %(levelname)s %(threadName)s ' diff --git a/tests/test_orm.py b/tests/test_orm.py index 65ca292..89c1b50 100644 --- a/tests/test_orm.py +++ b/tests/test_orm.py @@ -1,7 +1,7 @@ ''' tests_orm.py - unit tests for doublethink ORM -Copyright (C) 2015-2017 Internet Archive +Copyright (C) 2015-2023 Internet Archive Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -20,7 +20,9 @@ import doublethink import logging import sys import pytest -import rethinkdb as r +import rethinkdb as rdb + +r = rdb.RethinkDB() logging.basicConfig(stream=sys.stderr, level=logging.INFO, format="%(asctime)s %(process)d %(levelname)s %(threadName)s %(name)s.%(funcName)s(%(filename)s:%(lineno)d) %(message)s") diff --git a/tests/test_rethinker.py b/tests/test_rethinker.py index 7926c47..be3cb8c 100644 --- a/tests/test_rethinker.py +++ b/tests/test_rethinker.py @@ -1,7 +1,7 @@ ''' tests_rethinker.py - unit tests for doublethink connection manager -Copyright (C) 2015-2018 Internet Archive +Copyright (C) 2015-2023 Internet Archive Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,13 +22,15 @@ import sys import types import gc import pytest -import rethinkdb as r +import rethinkdb as rdb import datetime try: from unittest import mock except: import mock +r = rdb.RethinkDB() + logging.basicConfig(stream=sys.stderr, level=logging.INFO, format="%(asctime)s %(process)d %(levelname)s %(threadName)s %(name)s.%(funcName)s(%(filename)s:%(lineno)d) %(message)s") diff --git a/tests/test_svcreg.py b/tests/test_svcreg.py index 380d115..6d91862 100644 --- a/tests/test_svcreg.py +++ b/tests/test_svcreg.py @@ -1,7 +1,7 @@ ''' tests_rethinker.py - unit tests for doublethink -Copyright (C) 2015-2017 Internet Archive +Copyright (C) 2015-2023 Internet Archive Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,12 +22,14 @@ import sys import types import gc import pytest -import rethinkdb as r +import rethinkdb as rdb import time import socket import os import datetime +r = rdb.RethinkDB() + logging.basicConfig(stream=sys.stderr, level=logging.INFO, format="%(asctime)s %(process)d %(levelname)s %(threadName)s %(name)s.%(funcName)s(%(filename)s:%(lineno)d) %(message)s")