Remove no longer used legacy Lister API and update CLI options
Legacy Lister classes from the swh.lister.core mdule are no longer used in swh-lister codebase so it is time to remove them. Also remove lister CLI options related to legacy Lister API. As a consequence, the following requirements are no longer needed: arrow, SQLAlchemy, sqlalchemy-stubs and testing.postgresql. Closes T2442
This commit is contained in:
parent
ff05191b7d
commit
8933544521
18 changed files with 8 additions and 1730 deletions
|
@ -1,4 +1,4 @@
|
|||
# Copyright (C) 2019-2020 The Software Heritage developers
|
||||
# Copyright (C) 2019-2021 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
|
||||
|
@ -7,8 +7,6 @@ import pytest
|
|||
|
||||
from swh.lister.cli import SUPPORTED_LISTERS, get_lister
|
||||
|
||||
from .test_utils import init_db
|
||||
|
||||
lister_args = {
|
||||
"cgit": {"url": "https://git.eclipse.org/c/",},
|
||||
"phabricator": {
|
||||
|
@ -33,13 +31,11 @@ def test_get_lister(swh_scheduler_config):
|
|||
"""Instantiating a supported lister should be ok
|
||||
|
||||
"""
|
||||
db_url = init_db().url()
|
||||
# Drop launchpad lister from the lister to check, its test setup is more involved
|
||||
# than the other listers and it's not currently done here
|
||||
for lister_name in SUPPORTED_LISTERS:
|
||||
lst = get_lister(
|
||||
lister_name,
|
||||
db_url,
|
||||
scheduler={"cls": "local", **swh_scheduler_config},
|
||||
**lister_args.get(lister_name, {}),
|
||||
)
|
||||
|
|
|
@ -6,7 +6,6 @@ import pytest
|
|||
import requests
|
||||
from requests.status_codes import codes
|
||||
from tenacity.wait import wait_fixed
|
||||
from testing.postgresql import Postgresql
|
||||
|
||||
from swh.lister.utils import (
|
||||
MAX_NUMBER_ATTEMPTS,
|
||||
|
@ -37,18 +36,6 @@ def test_split_range_errors(total_pages, nb_pages):
|
|||
next(split_range(total_pages, nb_pages))
|
||||
|
||||
|
||||
def init_db():
|
||||
"""Factorize the db_url instantiation
|
||||
|
||||
Returns:
|
||||
db object to ease db manipulation
|
||||
|
||||
"""
|
||||
initdb_args = Postgresql.DEFAULT_SETTINGS["initdb_args"]
|
||||
initdb_args = " ".join([initdb_args, "-E UTF-8"])
|
||||
return Postgresql(initdb_args=initdb_args)
|
||||
|
||||
|
||||
TEST_URL = "https://example.og/api/repositories"
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue