Skip to content
Snippets Groups Projects
Commit 6159faa2 authored by Stefano Zacchiroli's avatar Stefano Zacchiroli
Browse files

mypy: add typing annotations for novel lister abstractions

parent 7dfd811e
No related branches found
No related tags found
No related merge requests found
......@@ -5,8 +5,9 @@
import logging
from swh.core import utils
from typing import Any, List
from swh.core import utils
from .lister_base import ListerBase
......@@ -20,7 +21,7 @@ class SimpleLister(ListerBase):
information and stores those in db
"""
def list_packages(self, *args):
def list_packages(self, response: Any) -> List[Any]:
"""Listing packages method.
"""
......
......@@ -77,7 +77,7 @@ class CRANLister(SimpleLister):
"""
return None
def list_packages(self, *args) -> List[Mapping[str, str]]:
def list_packages(self, response) -> List[Mapping[str, str]]:
"""Runs R script which uses inbuilt API to return a json response
containing data about the R packages.
......
......@@ -3,13 +3,13 @@
# License: GNU General Public License version 3, or any later version
# See top-level LICENSE file for more information
from typing import Any, Mapping, Optional
from typing import Any, List, Mapping, Optional
def debian_init(db_engine, lister=None,
override_conf: Optional[Mapping[str, Any]] = None,
distributions: Optional[str] = ['stretch', 'buster'],
area_names: Optional[str] = ['main', 'contrib', 'non-free']):
distributions: List[str] = ['stretch', 'buster'],
area_names: List[str] = ['main', 'contrib', 'non-free']):
"""Initialize the debian data model.
Args:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment