diff --git a/requirements-swh.txt b/requirements-swh.txt --- a/requirements-swh.txt +++ b/requirements-swh.txt @@ -1,4 +1,4 @@ -swh.core[db,http] >= 0.14.0 +swh.core[db,http] >= 2.9 swh.model >= 0.0.15 swh.objstorage >= 0.2.2 swh.scheduler >= 0.5.2 diff --git a/swh/indexer/storage/__init__.py b/swh/indexer/storage/__init__.py --- a/swh/indexer/storage/__init__.py +++ b/swh/indexer/storage/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2020 The Software Heritage developers +# Copyright (C) 2015-2022 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -120,7 +120,9 @@ class IndexerStorage: - """SWH Indexer Storage""" + """SWH Indexer Storage Datastore""" + + current_version = 134 def __init__(self, db, min_pool_conns=1, max_pool_conns=10, journal_writer=None): """ @@ -152,10 +154,6 @@ if db is not self._db: db.put_conn() - @db_transaction() - def get_current_version(self, *, db=None, cur=None): - return db.current_version - @timed @db_transaction() def check_config(self, *, check_write, db=None, cur=None): diff --git a/swh/indexer/storage/db.py b/swh/indexer/storage/db.py --- a/swh/indexer/storage/db.py +++ b/swh/indexer/storage/db.py @@ -1,4 +1,4 @@ -# Copyright (C) 2015-2018 The Software Heritage developers +# Copyright (C) 2015-2022 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -16,7 +16,6 @@ """Proxy to the SWH Indexer DB, with wrappers around stored procedures""" content_mimetype_hash_keys = ["id", "indexer_configuration_id"] - current_version = 134 def _missing_from_list( self, table: str, data: Iterable[Dict], hash_keys: List[str], cur=None diff --git a/swh/indexer/tests/conftest.py b/swh/indexer/tests/conftest.py --- a/swh/indexer/tests/conftest.py +++ b/swh/indexer/tests/conftest.py @@ -14,8 +14,7 @@ import yaml from swh.core.db.pytest_plugin import initialize_database_for_module -from swh.indexer.storage import get_indexer_storage -from swh.indexer.storage.db import Db as IndexerDb +from swh.indexer.storage import IndexerStorage, get_indexer_storage from swh.objstorage.factory import get_objstorage from swh.storage import get_storage @@ -33,7 +32,7 @@ partial( initialize_database_for_module, modname="indexer", - version=IndexerDb.current_version, + version=IndexerStorage.current_version, ) ], )