👷 Made mypy strict

This commit is contained in:
Nikhil Badyal
2022-10-05 23:03:45 +05:30
parent 31dc22f320
commit 31b98a7edc
5 changed files with 30 additions and 19 deletions
+8 -4
View File
@@ -2,9 +2,11 @@ import subprocess
import sys
from typing import Any, Dict, List, Tuple
from environs import Env
from loguru import logger
from requests import Session
from src.parser import Parser
from src.utils import supported_apps
@@ -23,7 +25,7 @@ class Patches(object):
exit(-1)
logger.debug("Cool!! Java is available")
def fetch_patches(self):
def fetch_patches(self) -> None:
session = Session()
logger.debug("fetching all patches")
@@ -87,7 +89,7 @@ class Patches(object):
n_patches = len(getattr(self, app_id))
logger.debug(f"Total patches in {app_name} are {n_patches}")
def __init__(self, env) -> None:
def __init__(self, env: Env) -> None:
self.env = env
self.apps = env.list("PATCH_APPS", supported_apps)
self.build_extended = env.bool("BUILD_EXTENDED", False)
@@ -118,7 +120,9 @@ class Patches(object):
logger.debug("No recommended version.")
return patches, version
def include_and_exclude_patches(self, app, arg_parser, app_patches) -> None:
def include_and_exclude_patches(
self, app: str, arg_parser: Parser, app_patches: List[Any]
) -> None:
logger.debug(f"Excluding patches for app {app}")
if self.build_extended and app in self.extended_apps:
excluded_patches = self.env.list(
@@ -136,7 +140,7 @@ class Patches(object):
else:
logger.debug(f"No excluded patches for {app}")
def get_app_configs(self, app) -> Any:
def get_app_configs(self, app: str) -> Any:
experiment = False
total_patches, recommended_version = self.get(app=app)
env_version = self.env.str(f"{app}_VERSION".upper(), None)