diff --git a/swh/__init__.py b/swh/__init__.py index f14e196529632bc4e37f7e7deb0b49db4742a423..e780381ceb98b03e44464c5ccdc01a7f3d5a8a63 100644 --- a/swh/__init__.py +++ b/swh/__init__.py @@ -1,4 +1,4 @@ from pkgutil import extend_path from typing import Iterable -__path__ = extend_path(__path__, __name__) # type: Iterable[str] +__path__: Iterable[str] = extend_path(__path__, __name__) diff --git a/swh/graph/cli.py b/swh/graph/cli.py index 9ea61adf2b37d1dfb3a7205c48e08885cfdc396a..07a75d232e8f909090c4cb98e74ada12d688d875 100644 --- a/swh/graph/cli.py +++ b/swh/graph/cli.py @@ -31,7 +31,7 @@ class PathlibPath(click.Path): return Path(super().convert(value, param, ctx)) -DEFAULT_CONFIG = {"graph": ("dict", {})} # type: Dict[str, Tuple[str, Any]] +DEFAULT_CONFIG: Dict[str, Tuple[str, Any]] = {"graph": ("dict", {})} @click.group(name="graph", context_settings=CONTEXT_SETTINGS, cls=AliasedGroup) diff --git a/swh/graph/webgraph.py b/swh/graph/webgraph.py index 291c04df44bb0f8363670730d0a8dec276b7f251..254803aba78b03e29cfa4994570999b7e626a5fe 100644 --- a/swh/graph/webgraph.py +++ b/swh/graph/webgraph.py @@ -45,7 +45,7 @@ COMP_SEQ = list(CompressionStep) # specified here as lists of tokens that will be joined together only for ease # of line splitting. In commands, {tokens} will be interpolated with # configuration values, see :func:`compress`. -STEP_ARGV = { +STEP_ARGV: Dict[CompressionStep, List[str]] = { CompressionStep.MPH: [ "{java}", "it.unimi.dsi.sux4j.mph.GOVMinimalPerfectHashFunction", @@ -133,7 +133,7 @@ STEP_ARGV = { "{out_dir}/{graph_name}-bv.offsets", "{tmp_dir}", ], -} # type: Dict[CompressionStep, List[str]] +} class StepOption(ParamType): @@ -147,7 +147,7 @@ class StepOption(ParamType): name = "compression step" def convert(self, value, param, ctx) -> Set[CompressionStep]: - steps = set() # type: Set[CompressionStep] + steps: Set[CompressionStep] = set() specs = value.split(",") for spec in specs: