diff --git a/dev_scripts/codegen/download_aas_core_meta_model.py b/dev_scripts/codegen/download_aas_core_meta_model.py index 5590ffd7..d30391cc 100644 --- a/dev_scripts/codegen/download_aas_core_meta_model.py +++ b/dev_scripts/codegen/download_aas_core_meta_model.py @@ -4,6 +4,7 @@ import os import argparse import sys +from typing import Dict, Union import requests @@ -24,7 +25,7 @@ def _latest_commit_sha_for_path( Uses: GET /repos/{owner}/{repo}/commits?path=...&sha=...&per_page=1 """ url = f"{GITHUB_API}/repos/{owner}/{repo}/commits" - params = {"path": path, "sha": ref, "per_page": 1} + params: Dict[str, Union[str, int]] = {"path": path, "sha": ref, "per_page": 1} resp = requests.get(url, params=params, timeout=timeout) try: resp.raise_for_status() @@ -43,6 +44,7 @@ def _latest_commit_sha_for_path( sha = commits[0].get("sha") if not sha or not isinstance(sha, str): raise RuntimeError("API did not return a valid commit SHA.") + assert isinstance(sha, str) return sha diff --git a/dev_scripts/continuous_integration_of_dev_scripts/precommit.py b/dev_scripts/continuous_integration_of_dev_scripts/precommit.py index a7e9d6ab..0f1cb06e 100644 --- a/dev_scripts/continuous_integration_of_dev_scripts/precommit.py +++ b/dev_scripts/continuous_integration_of_dev_scripts/precommit.py @@ -104,6 +104,8 @@ def main() -> int: if Step.REFORMAT in selects and Step.REFORMAT not in skips: print("Re-formatting...") reformat_targets = [ + "codegen/codegen.py", + "codegen/download_aas_core_meta_model.py", "continuous_integration_of_dev_scripts", "update_to_aas_core_meta_codegen.py", ] @@ -129,6 +131,8 @@ def main() -> int: if Step.MYPY in selects and Step.MYPY not in skips: print("Mypy'ing...") mypy_targets = [ + "codegen/codegen.py", + "codegen/download_aas_core_meta_model.py", "continuous_integration_of_dev_scripts", "update_to_aas_core_meta_codegen.py", ] @@ -147,6 +151,8 @@ def main() -> int: if Step.PYLINT in selects and Step.PYLINT not in skips: print("Pylint'ing...") pylint_targets = [ + "codegen/codegen.py", + "codegen/download_aas_core_meta_model.py", "continuous_integration_of_dev_scripts", "update_to_aas_core_meta_codegen.py", ] diff --git a/dev_scripts/pyproject.toml b/dev_scripts/pyproject.toml index 5747896e..c2f4db7f 100644 --- a/dev_scripts/pyproject.toml +++ b/dev_scripts/pyproject.toml @@ -27,6 +27,7 @@ dev = [ "black==25.9.0", "mypy==1.18.2", "pylint==3.3.8", + "types-requests>=2.32.4", ] [tool.setuptools.packages.find]