Skip to content

Commit

Permalink
Added missing __init__ annotations.
Browse files Browse the repository at this point in the history
Signed-off-by: dblock <[email protected]>
  • Loading branch information
dblock committed May 17, 2022
1 parent 8758428 commit a8832cb
Show file tree
Hide file tree
Showing 21 changed files with 38 additions and 38 deletions.
4 changes: 2 additions & 2 deletions src/build_workflow/build_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


class BuildRecorder:
def __init__(self, target: BuildTarget):
def __init__(self, target: BuildTarget) -> None:
self.build_manifest = self.BuildManifestBuilder(target)
self.target = target
self.name = target.name
Expand Down Expand Up @@ -52,7 +52,7 @@ def write_manifest(self) -> None:
logging.info(f"Created build manifest {manifest_path}")

class BuildManifestBuilder:
def __init__(self, target: BuildTarget):
def __init__(self, target: BuildTarget) -> None:
self.data: Dict[str, Any] = {}
self.data["build"] = {}
self.data["build"]["id"] = target.build_id
Expand Down
2 changes: 1 addition & 1 deletion src/ci_workflow/ci_check_list_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def checkout(self, work_dir: str) -> None:
}

class InvalidCheckError(Exception):
def __init__(self, check: Any):
def __init__(self, check: Any) -> None:
self.check = check
super().__init__(f"Invalid check: {check.name}, must be one of {CiCheckListSource.CHECKS.keys()}.")

Expand Down
6 changes: 3 additions & 3 deletions src/manifests/build/build_manifest_1_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class BuildManifest_1_0(ComponentManifest['BuildManifest_1_0', 'BuildComponents_
},
}

def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.build = self.Build(data["build"])
self.components = BuildComponents_1_0(data.get("components", [])) # type: ignore[assignment]
Expand All @@ -88,7 +88,7 @@ def __to_dict__(self) -> dict:
}

class Build:
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
self.name: str = data["name"]
self.version = data["version"]
self.architecture = data["architecture"]
Expand All @@ -114,7 +114,7 @@ def __create__(self, data: Any) -> 'BuildComponent_1_0':


class BuildComponent_1_0(Component):
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.repository = data["repository"]
self.ref = data["ref"]
Expand Down
6 changes: 3 additions & 3 deletions src/manifests/build/build_manifest_1_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class BuildManifest_1_1(ComponentManifest['BuildManifest_1_1', 'BuildComponents_
},
}

def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.build = self.Build(data["build"])
self.components = BuildComponents_1_1(data.get("components", [])) # type: ignore[assignment]
Expand All @@ -89,7 +89,7 @@ def __to_dict__(self) -> dict:
}

class Build:
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
self.name: str = data["name"]
self.version = data["version"]
self.architecture = data["architecture"]
Expand All @@ -115,7 +115,7 @@ def __create__(self, data: Any) -> 'BuildComponent_1_1':


class BuildComponent_1_1(Component):
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.repository = data["repository"]
self.ref = data["ref"]
Expand Down
6 changes: 3 additions & 3 deletions src/manifests/build_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class BuildManifest(ComponentManifest['BuildManifest', 'BuildComponents']):
},
}

def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.build = self.Build(data["build"])
self.components = BuildComponents(data.get("components", [])) # type: ignore[assignment]
Expand All @@ -102,7 +102,7 @@ def __to_dict__(self) -> dict:
}

class Build:
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
self.name: str = data["name"]
self.version: str = data["version"]
self.platform: str = data["platform"]
Expand Down Expand Up @@ -132,7 +132,7 @@ def __create__(self, data: Any) -> 'BuildComponent':


class BuildComponent(Component):
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.repository = data["repository"]
self.ref = data["ref"]
Expand Down
6 changes: 3 additions & 3 deletions src/manifests/bundle/bundle_manifest_1_0.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class BundleManifest_1_0(ComponentManifest['BundleManifest_1_0', 'BundleComponen
},
}

def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.build = self.Build(data["build"])
self.components = BundleComponents_1_0(data.get("components", [])) # type: ignore[assignment]
Expand All @@ -72,7 +72,7 @@ def __to_dict__(self) -> dict:
}

class Build:
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
self.name = data["name"]
self.version = data["version"]
self.architecture = data["architecture"]
Expand All @@ -96,7 +96,7 @@ def __create__(self, data: Any) -> 'BundleComponent_1_0':


class BundleComponent_1_0(Component):
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.repository = data["repository"]
self.ref = data["ref"]
Expand Down
4 changes: 2 additions & 2 deletions src/manifests/bundle_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def __to_dict__(self) -> dict:
}

class Build:
def __init__(self, data: Dict[str, str]):
def __init__(self, data: Dict[str, str]) -> None:
self.name = data["name"]
self.version = data["version"]
self.platform = data["platform"]
Expand Down Expand Up @@ -110,7 +110,7 @@ def __create__(self, data: Any) -> 'BundleComponent':


class BundleComponent(Component):
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.repository = data["repository"]
self.ref = data["ref"]
Expand Down
2 changes: 1 addition & 1 deletion src/manifests/distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@


class DistributionNotFound(Exception):
def __init__(self, urls: List[str]):
def __init__(self, urls: List[str]) -> None:
self.urls = urls
super().__init__(f"Unable to find a distribution under urls {self.urls}")

Expand Down
12 changes: 6 additions & 6 deletions src/manifests/input_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class InputManifest(ComponentManifest['InputManifest', 'InputComponents']):
},
}

def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)

self.build = self.Build(data["build"])
Expand All @@ -123,14 +123,14 @@ def stable(self) -> 'InputManifest':
return manifest

class Ci:
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
self.image = None if data is None else self.Image(data.get("image", None))

def __to_dict__(self) -> Optional[dict]:
return None if self.image is None else {"image": self.image.__to_dict__()}

class Image:
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
self.name = data["name"]
self.args = data.get("args", None)

Expand All @@ -141,7 +141,7 @@ def __to_dict__(self) -> dict:
}

class Build:
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
self.name: str = data["name"]
self.version = data["version"]
self.qualifier = data.get("qualifier", None)
Expand Down Expand Up @@ -199,7 +199,7 @@ def select(self, focus: List[str] = [], platform: str = None) -> Iterator['Input


class InputComponent(Component):
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.platforms = data.get("platforms", None)
self.checks = list(map(lambda entry: Check(entry), data.get("checks", [])))
Expand Down Expand Up @@ -255,7 +255,7 @@ def __to_dict__(self) -> dict:


class InputComponentFromDist(InputComponent):
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
super().__init__(data)
self.dist = data["dist"]

Expand Down
2 changes: 1 addition & 1 deletion src/manifests/manifests.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


class Manifests(SortedDict, Generic[T]):
def __init__(self, klass: Any, files: List[str]):
def __init__(self, klass: Any, files: List[str]) -> None:
super(Manifests, self).__init__()
self.klass = klass
self.__append__(files)
Expand Down
4 changes: 2 additions & 2 deletions src/manifests/test_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,14 @@ def __to_dict__(self) -> dict:
}

class Ci:
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
self.image = None if data is None else self.Image(data.get("image", None))

def __to_dict__(self) -> Optional[dict]:
return None if self.image is None else {"image": self.image.__to_dict__()}

class Image:
def __init__(self, data: Any):
def __init__(self, data: Any) -> None:
self.name = data["name"]
self.args = data.get("args", None)

Expand Down
2 changes: 1 addition & 1 deletion src/sign_workflow/sign_artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SignArtifacts:
signature_type: str
signer: Signer

def __init__(self, target: Path, components: List[str], artifact_type: str, signature_type: str, signer: Signer):
def __init__(self, target: Path, components: List[str], artifact_type: str, signature_type: str, signer: Signer) -> None:
self.target = target
self.components = components
self.artifact_type = artifact_type
Expand Down
2 changes: 1 addition & 1 deletion src/system/temporary_directory.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def g__handleRemoveReadonly(func: FunctionType, path: str, exc: Any) -> Any:


class TemporaryDirectory:
def __init__(self, keep: bool = False, chdir: bool = False):
def __init__(self, keep: bool = False, chdir: bool = False) -> None:
self.keep = keep
self.name = tempfile.mkdtemp()
if chdir:
Expand Down
2 changes: 1 addition & 1 deletion src/test_workflow/bwc_test/bwc_test_runner_opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

class BwcTestRunnerOpenSearch(BwcTestRunner):

def __init__(self, args: TestArgs, test_manifest: TestManifest):
def __init__(self, args: TestArgs, test_manifest: TestManifest) -> None:
self.properties = BwcTestStartPropertiesOpenSearch(args.paths.get("opensearch", os.getcwd()))
super().__init__(args, test_manifest, self.properties.build_manifest.components)
logging.info("Entering BWC test for OpenSearch")
Expand Down
2 changes: 1 addition & 1 deletion src/test_workflow/dependency_installer_opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

class DependencyInstallerOpenSearch(DependencyInstaller):

def __init__(self, root_url: str, build_manifest: BuildManifest, bundle_manifest: BundleManifest):
def __init__(self, root_url: str, build_manifest: BuildManifest, bundle_manifest: BundleManifest) -> None:
super().__init__(root_url, build_manifest, bundle_manifest)

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@

class DependencyInstallerOpenSearchDashboards(DependencyInstaller):

def __init__(self, root_url: str, build_manifest: BuildManifest, bundle_manifest: BundleManifest):
def __init__(self, root_url: str, build_manifest: BuildManifest, bundle_manifest: BundleManifest) -> None:
super().__init__(root_url, build_manifest, bundle_manifest)
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class IntegTestRunnerOpenSearchDashboards(IntegTestRunner):
properties: IntegTestStartPropertiesOpenSearchDashboards
properties_dependency: IntegTestStartPropertiesOpenSearch

def __init__(self, args: TestArgs, test_manifest: TestManifest):
def __init__(self, args: TestArgs, test_manifest: TestManifest) -> None:
self.properties_dependency = IntegTestStartPropertiesOpenSearch(args.paths.get("opensearch", os.getcwd()))
self.properties = IntegTestStartPropertiesOpenSearchDashboards(args.paths.get("opensearch-dashboards", os.getcwd()))
super().__init__(args, test_manifest, self.properties.build_manifest.components)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
class IntegTestStartPropertiesOpenSearch(IntegTestStartProperties):
dependency_installer: DependencyInstallerOpenSearch

def __init__(self, path: str):
def __init__(self, path: str) -> None:
super().__init__(path, "builds/opensearch/manifest.yml", "dist/opensearch/manifest.yml")
self.dependency_installer = DependencyInstallerOpenSearch(self.path, self.build_manifest, self.bundle_manifest)
2 changes: 1 addition & 1 deletion src/test_workflow/perf_test/perf_test_cluster_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PerfTestClusterConfig():
"""
Maintains the cluster level configuration.
"""
def __init__(self, security: bool = False, data_nodes: int = 1, master_nodes: int = 0, ingest_nodes: int = 0, client_nodes: int = 0):
def __init__(self, security: bool = False, data_nodes: int = 1, master_nodes: int = 0, ingest_nodes: int = 0, client_nodes: int = 0) -> None:
self.security = security
self.data_nodes = data_nodes
self.master_nodes = master_nodes
Expand Down
4 changes: 2 additions & 2 deletions src/test_workflow/test_recorder/test_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def save_test_result_data(self, test_result_data: TestResultData) -> None:
class RemoteClusterLogs(LogRecorder):
parent_class: TestRecorder

def __init__(self, parent_class: TestRecorder):
def __init__(self, parent_class: TestRecorder) -> None:
self.parent_class = parent_class

def save_test_result_data(self, test_result_data: TestResultData) -> None:
Expand All @@ -107,7 +107,7 @@ def save_test_result_data(self, test_result_data: TestResultData) -> None:
class TestResultsLogs(LogRecorder):
parent_class: TestRecorder

def __init__(self, parent_class: TestRecorder):
def __init__(self, parent_class: TestRecorder) -> None:
self.parent_class = parent_class

def save_test_result_data(self, test_result_data: TestResultData) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/test_workflow/test_result/test_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class TestResult:
config: dict
status: int

def __init__(self, component: str, config: dict, status: int):
def __init__(self, component: str, config: dict, status: int) -> None:
self.component = component
self.config = config
self.status = status
Expand Down

0 comments on commit a8832cb

Please sign in to comment.