From 911fe2c3c031e61eeb503de09cadfd77ffbf6b16 Mon Sep 17 00:00:00 2001 From: Per Held Date: Tue, 11 Nov 2025 09:17:19 +0100 Subject: [PATCH] Add mypy ignore for snakeviz Add a import-untyped for snakeviz in the case it is installed. Signed-off-by: per.held@arm.com Change-Id: Ia951a0013d09e06c0d29a32bdb6b49ae11561d7d --- util/python_profiler.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/util/python_profiler.py b/util/python_profiler.py index c62b0ffafe0..33395afaedf 100644 --- a/util/python_profiler.py +++ b/util/python_profiler.py @@ -1,5 +1,6 @@ # Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. +# Copyright 2025 Arm Limited and/or its affiliates. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. @@ -12,14 +13,17 @@ import re from pstats import Stats -from snakeviz.stats import json_stats, table_rows # type: ignore[import-not-found] +from snakeviz.stats import ( # type: ignore[import-not-found,import-untyped] + json_stats, + table_rows, +) from tornado import template # type: ignore[import-not-found] module_found = True snakeviz_templates_dir: str = "" try: - import snakeviz # type: ignore[import-not-found] + import snakeviz # type: ignore[import-not-found,import-untyped] snakeviz_dir = os.path.dirname(os.path.abspath(snakeviz.__file__)) snakeviz_templates_dir = os.path.join(snakeviz_dir, "templates")