diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 3e9f3534a..69aa46b92 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -50,8 +50,8 @@ jobs: level: error # Change the current directory to run mypy command. # mypy command reads setup.cfg or other settings file in this path. - execute_command: uv run --group lint --group dev mypy + execute_command: uv run --group dev --group lint --group tests --extra gdb --extra lldb mypy install_types: false - target: pwndbg + target: pwndbg pwndbginit tests/host filter_mode: nofilter fail_on_error: true diff --git a/lint.sh b/lint.sh index 3e15007e6..a32a2cc2f 100755 --- a/lint.sh +++ b/lint.sh @@ -71,5 +71,5 @@ $UV_RUN_LINT vermin -vvv --no-tips -t=3.10- --eval-annotations --violations ${LI # mypy is run in a separate step on GitHub Actions if [[ -z "$GITHUB_ACTIONS" ]]; then - $UV_RUN_LINT mypy pwndbg pwndbginit tests/host + $UV_RUN_MYPY mypy pwndbg pwndbginit tests/host fi diff --git a/pwndbginit/common.py b/pwndbginit/common.py index 171f92660..98d721c32 100644 --- a/pwndbginit/common.py +++ b/pwndbginit/common.py @@ -34,7 +34,7 @@ def run_uv_install( else: # We don't want to quietly uninstall dependencies by just specifying # `--extra gdb` so we will be conservative and pull all extras in. - command: List[str] = [str(binary_path), "sync", "--all-extras"] + command = [str(binary_path), "sync", "--all-extras"] if dev: command.append("--all-groups") logging.debug(f"Updating deps with command: {' '.join(command)}") diff --git a/pwndbginit/pwndbg_gdb.py b/pwndbginit/pwndbg_gdb.py index 4011be9a0..5207b8348 100755 --- a/pwndbginit/pwndbg_gdb.py +++ b/pwndbginit/pwndbg_gdb.py @@ -21,10 +21,14 @@ def get_gdb_version(path: str) -> Tuple[str, str]: capture_output=True, text=True, ) - return tuple(result.stdout.strip().split(" ", 2)) + arr = result.stdout.strip().split(" ", 1) + if len(arr) != 2: + return "", "" + return arr[0], arr[1] -def get_venv_bin_path(): + +def get_venv_bin_path() -> str: bin_dir = "Scripts" if os.name == "nt" else "bin" return os.path.join(sys.prefix, bin_dir) @@ -54,7 +58,7 @@ def main(): sys.argv = gdb_argv try: - from gdb_for_pwndbg.gdb import main + from gdb_for_pwndbg.gdb import main # type: ignore[import-untyped] main() return diff --git a/scripts/common.sh b/scripts/common.sh index a73af8f05..4fc48a334 100644 --- a/scripts/common.sh +++ b/scripts/common.sh @@ -18,11 +18,13 @@ if [[ "$PWNDBG_NO_UV" == "1" ]]; then UV_RUN_TEST="" UV_RUN_LINT="" UV_RUN_DOCS="" + UV_RUN_MYPY="" else # We are going to use uv. UV="${PWNDBG_VENV_PATH}/bin/uv" UV_RUN="${UV} run" UV_RUN_TEST="${UV_RUN} --group dev --group tests --all-extras" - UV_RUN_LINT="${UV_RUN} --group dev --group lint" + UV_RUN_LINT="${UV_RUN} --group lint" UV_RUN_DOCS="${UV_RUN} --group docs --extra gdb --extra lldb" + UV_RUN_MYPY="${UV_RUN} --group dev --group lint --group tests --extra gdb --extra lldb" fi