From c4f322ce2de191a07db992e649f73c128048bb74 Mon Sep 17 00:00:00 2001 From: Justin Newberry Date: Thu, 24 Aug 2023 16:30:54 -0700 Subject: [PATCH] Linter: remove pylint (#29611) remove pylint old-commit-hash: 1ee6ed4b16e2ade0dd887c0687243aee769043e5 --- common/kalman/simple_kalman.py | 1 - common/logging_extra.py | 2 +- common/params.py | 2 +- common/realtime.py | 4 ++-- common/transformations/coordinates.py | 1 - common/transformations/orientation.py | 1 - common/window.py | 4 ++-- docs/conf.py | 1 - scripts/pyqt_demo.py | 2 +- selfdrive/boardd/boardd.py | 2 -- selfdrive/car/tests/test_models.py | 1 - selfdrive/controls/tests/test_cruise_speed.py | 2 +- selfdrive/controls/tests/test_startup.py | 2 +- selfdrive/debug/toyota_eps_factor.py | 2 +- selfdrive/locationd/models/car_kf.py | 4 ++-- selfdrive/locationd/models/gnss_kf.py | 4 ++-- selfdrive/manager/process.py | 6 +++--- selfdrive/modeld/tests/tf_test/pb_loader.py | 2 +- selfdrive/modeld/tests/timing/benchmark.py | 1 - selfdrive/monitoring/test_monitoring.py | 1 - selfdrive/test/ciui.py | 4 ++-- selfdrive/test/openpilotci.py | 4 ++-- selfdrive/test/profiling/lib.py | 4 ++-- selfdrive/test/profiling/profiler.py | 2 +- selfdrive/test/test_valgrind_replay.py | 2 +- selfdrive/test/update_ci_routes.py | 6 +++--- selfdrive/thermald/thermald.py | 4 ++-- selfdrive/tombstoned.py | 4 ++-- selfdrive/ui/qt/python_helpers.py | 2 +- system/hardware/tici/hardware.py | 2 +- system/micd.py | 2 +- system/ubloxd/tests/ublox.py | 1 - system/ubloxd/tests/ubloxd.py | 1 - tools/bodyteleop/bodyav.py | 4 ++-- tools/camerastream/compressed_vipc.py | 2 +- tools/gpstest/fuzzy_testing.py | 2 +- tools/gpstest/rpc_server.py | 4 ++-- tools/lib/auth.py | 2 +- tools/lib/framereader.py | 1 - tools/lib/url_file.py | 2 -- tools/replay/lib/ui_helpers.py | 2 +- tools/replay/ui.py | 4 ++-- tools/replay/unlog_ci_segment.py | 1 - tools/sim/bridge.py | 2 +- tools/sim/lib/can.py | 2 +- tools/sim/lib/manual_ctrl.py | 4 ++-- tools/webcam/front_mount_helper.py | 2 +- tools/webcam/warp_vis.py | 2 +- 48 files changed, 52 insertions(+), 67 deletions(-) diff --git a/common/kalman/simple_kalman.py b/common/kalman/simple_kalman.py index 669da3919..5e1b6ce1f 100644 --- a/common/kalman/simple_kalman.py +++ b/common/kalman/simple_kalman.py @@ -1,4 +1,3 @@ -# pylint: skip-file from openpilot.common.kalman.simple_kalman_impl import KF1D as KF1D assert KF1D import numpy as np diff --git a/common/logging_extra.py b/common/logging_extra.py index e2637d2e0..5e0584c7b 100644 --- a/common/logging_extra.py +++ b/common/logging_extra.py @@ -197,7 +197,7 @@ class SwagLogger(logging.Logger): filename = os.path.normcase(co.co_filename) # TODO: is this pylint exception correct? - if filename == _srcfile: # pylint: disable=comparison-with-callable + if filename == _srcfile: f = f.f_back continue sinfo = None diff --git a/common/params.py b/common/params.py index bc1422dd8..ea8ac7514 100644 --- a/common/params.py +++ b/common/params.py @@ -1,5 +1,5 @@ from openpilot.common.params_pyx import Params, ParamKeyType, UnknownKeyName, put_nonblocking, \ - put_bool_nonblocking # pylint: disable=no-name-in-module, import-error + put_bool_nonblocking assert Params assert ParamKeyType assert UnknownKeyName diff --git a/common/realtime.py b/common/realtime.py index 7549a7ef5..05e19e770 100644 --- a/common/realtime.py +++ b/common/realtime.py @@ -30,12 +30,12 @@ class Priority: def set_realtime_priority(level: int) -> None: if not PC: - os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(level)) # pylint: disable=no-member + os.sched_setscheduler(0, os.SCHED_FIFO, os.sched_param(level)) def set_core_affinity(cores: List[int]) -> None: if not PC: - os.sched_setaffinity(0, cores) # pylint: disable=no-member + os.sched_setaffinity(0, cores) def config_realtime_process(cores: Union[int, List[int]], priority: int) -> None: diff --git a/common/transformations/coordinates.py b/common/transformations/coordinates.py index 7e7b56522..696e7de2e 100644 --- a/common/transformations/coordinates.py +++ b/common/transformations/coordinates.py @@ -1,4 +1,3 @@ -# pylint: skip-file from openpilot.common.transformations.orientation import numpy_wrap from openpilot.common.transformations.transformations import (ecef2geodetic_single, geodetic2ecef_single) diff --git a/common/transformations/orientation.py b/common/transformations/orientation.py index 657a86a57..ce4378738 100644 --- a/common/transformations/orientation.py +++ b/common/transformations/orientation.py @@ -1,4 +1,3 @@ -# pylint: skip-file import numpy as np from typing import Callable diff --git a/common/window.py b/common/window.py index 613b3b201..95886c0c9 100644 --- a/common/window.py +++ b/common/window.py @@ -1,6 +1,6 @@ import sys -import pygame # pylint: disable=import-error -import cv2 # pylint: disable=import-error +import pygame +import cv2 class Window: def __init__(self, w, h, caption="window", double=False, halve=False): diff --git a/docs/conf.py b/docs/conf.py index a4ed00c91..9a8d64669 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,4 @@ # type: ignore -# pylint: skip-file # Configuration file for the Sphinx documentation builder. # diff --git a/scripts/pyqt_demo.py b/scripts/pyqt_demo.py index b73d7dfad..783728bdb 100755 --- a/scripts/pyqt_demo.py +++ b/scripts/pyqt_demo.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -from PyQt5.QtWidgets import QApplication, QLabel # pylint: disable=no-name-in-module, import-error +from PyQt5.QtWidgets import QApplication, QLabel from openpilot.selfdrive.ui.qt.python_helpers import set_main_window diff --git a/selfdrive/boardd/boardd.py b/selfdrive/boardd/boardd.py index 702c46565..0cdaf5e91 100644 --- a/selfdrive/boardd/boardd.py +++ b/selfdrive/boardd/boardd.py @@ -1,5 +1,3 @@ -# pylint: skip-file - # Cython, now uses scons to build from openpilot.selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp assert can_list_to_can_capnp diff --git a/selfdrive/car/tests/test_models.py b/selfdrive/car/tests/test_models.py index 014772529..57b703753 100755 --- a/selfdrive/car/tests/test_models.py +++ b/selfdrive/car/tests/test_models.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# pylint: disable=E1101 import capnp import os import importlib diff --git a/selfdrive/controls/tests/test_cruise_speed.py b/selfdrive/controls/tests/test_cruise_speed.py index c7221cfcf..1d43b49cc 100755 --- a/selfdrive/controls/tests/test_cruise_speed.py +++ b/selfdrive/controls/tests/test_cruise_speed.py @@ -52,7 +52,7 @@ class TestCruiseSpeed(unittest.TestCase): @parameterized_class(('pcm_cruise',), [(False,)]) class TestVCruiseHelper(unittest.TestCase): def setUp(self): - self.CP = car.CarParams(pcmCruise=self.pcm_cruise) # pylint: disable=E1101 + self.CP = car.CarParams(pcmCruise=self.pcm_cruise) self.v_cruise_helper = VCruiseHelper(self.CP) self.reset_cruise_speed_state() diff --git a/selfdrive/controls/tests/test_startup.py b/selfdrive/controls/tests/test_startup.py index 72a5b4b48..6eb803e8a 100755 --- a/selfdrive/controls/tests/test_startup.py +++ b/selfdrive/controls/tests/test_startup.py @@ -6,7 +6,7 @@ from parameterized import parameterized from cereal import log, car import cereal.messaging as messaging from openpilot.common.params import Params -from openpilot.selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp # pylint: disable=no-name-in-module,import-error +from openpilot.selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp from openpilot.selfdrive.car.fingerprints import _FINGERPRINTS from openpilot.selfdrive.car.toyota.values import CAR as TOYOTA from openpilot.selfdrive.car.mazda.values import CAR as MAZDA diff --git a/selfdrive/debug/toyota_eps_factor.py b/selfdrive/debug/toyota_eps_factor.py index e1156c05a..d60d2d372 100755 --- a/selfdrive/debug/toyota_eps_factor.py +++ b/selfdrive/debug/toyota_eps_factor.py @@ -2,7 +2,7 @@ import sys import numpy as np import matplotlib.pyplot as plt -from sklearn import linear_model # pylint: disable=import-error +from sklearn import linear_model from openpilot.selfdrive.car.toyota.values import STEER_THRESHOLD from openpilot.tools.lib.route import Route diff --git a/selfdrive/locationd/models/car_kf.py b/selfdrive/locationd/models/car_kf.py index 6c02257a1..b87c83cac 100755 --- a/selfdrive/locationd/models/car_kf.py +++ b/selfdrive/locationd/models/car_kf.py @@ -15,7 +15,7 @@ if __name__ == '__main__': # Generating sympy import sympy as sp from rednose.helpers.ekf_sym import gen_code else: - from rednose.helpers.ekf_sym_pyx import EKF_sym_pyx # pylint: disable=no-name-in-module, import-error + from rednose.helpers.ekf_sym_pyx import EKF_sym_pyx i = 0 @@ -160,7 +160,7 @@ class CarKalman(KalmanFilter): gen_code(generated_dir, name, f_sym, dt, state_sym, obs_eqs, dim_state, dim_state, global_vars=global_vars) - def __init__(self, generated_dir, steer_ratio=15, stiffness_factor=1, angle_offset=0, P_initial=None): # pylint: disable=super-init-not-called + def __init__(self, generated_dir, steer_ratio=15, stiffness_factor=1, angle_offset=0, P_initial=None): dim_state = self.initial_x.shape[0] dim_state_err = self.P_initial.shape[0] x_init = self.initial_x diff --git a/selfdrive/locationd/models/gnss_kf.py b/selfdrive/locationd/models/gnss_kf.py index f98434c90..c4f3b2e21 100755 --- a/selfdrive/locationd/models/gnss_kf.py +++ b/selfdrive/locationd/models/gnss_kf.py @@ -11,8 +11,8 @@ if __name__ == '__main__': # Generating sympy import sympy as sp from rednose.helpers.ekf_sym import gen_code else: - from rednose.helpers.ekf_sym_pyx import EKF_sym_pyx # pylint: disable=no-name-in-module,import-error - from rednose.helpers.ekf_sym import EKF_sym # pylint: disable=no-name-in-module,import-error + from rednose.helpers.ekf_sym_pyx import EKF_sym_pyx + from rednose.helpers.ekf_sym import EKF_sym class States(): diff --git a/selfdrive/manager/process.py b/selfdrive/manager/process.py index c56ffeab9..82cc8d74a 100644 --- a/selfdrive/manager/process.py +++ b/selfdrive/manager/process.py @@ -8,7 +8,7 @@ from typing import Optional, Callable, List, ValuesView from abc import ABC, abstractmethod from multiprocessing import Process -from setproctitle import setproctitle # pylint: disable=no-name-in-module +from setproctitle import setproctitle from cereal import car, log import cereal.messaging as messaging @@ -96,7 +96,7 @@ class ManagerProcess(ABC): fn = WATCHDOG_FN + str(self.proc.pid) with open(fn, "rb") as f: # TODO: why can't pylint find struct.unpack? - self.last_watchdog_time = struct.unpack('Q', f.read())[0] # pylint: disable=no-member + self.last_watchdog_time = struct.unpack('Q', f.read())[0] except Exception: pass @@ -261,7 +261,7 @@ class DaemonProcess(ManagerProcess): pass cloudlog.info(f"starting daemon {self.name}") - proc = subprocess.Popen(['python', '-m', self.module], # pylint: disable=subprocess-popen-preexec-fn + proc = subprocess.Popen(['python', '-m', self.module], stdin=open('/dev/null'), stdout=open('/dev/null', 'w'), stderr=open('/dev/null', 'w'), diff --git a/selfdrive/modeld/tests/tf_test/pb_loader.py b/selfdrive/modeld/tests/tf_test/pb_loader.py index 78fd33aef..3e476628e 100755 --- a/selfdrive/modeld/tests/tf_test/pb_loader.py +++ b/selfdrive/modeld/tests/tf_test/pb_loader.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 import sys -import tensorflow as tf # pylint: disable=import-error +import tensorflow as tf with open(sys.argv[1], "rb") as f: graph_def = tf.compat.v1.GraphDef() diff --git a/selfdrive/modeld/tests/timing/benchmark.py b/selfdrive/modeld/tests/timing/benchmark.py index 1463342a6..4ab0afacb 100755 --- a/selfdrive/modeld/tests/timing/benchmark.py +++ b/selfdrive/modeld/tests/timing/benchmark.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 # type: ignore -# pylint: skip-file import os import time diff --git a/selfdrive/monitoring/test_monitoring.py b/selfdrive/monitoring/test_monitoring.py index b1011fb30..c02d44849 100755 --- a/selfdrive/monitoring/test_monitoring.py +++ b/selfdrive/monitoring/test_monitoring.py @@ -54,7 +54,6 @@ always_false = [False] * int(TEST_TIMESPAN / DT_DMON) # TODO: this only tests DriverStatus class TestMonitoring(unittest.TestCase): - # pylint: disable=no-member def _run_seq(self, msgs, interaction, engaged, standstill): DS = DriverStatus() events = [] diff --git a/selfdrive/test/ciui.py b/selfdrive/test/ciui.py index ba55f3af2..3f33847b2 100755 --- a/selfdrive/test/ciui.py +++ b/selfdrive/test/ciui.py @@ -5,8 +5,8 @@ import subprocess signal.signal(signal.SIGINT, signal.SIG_DFL) signal.signal(signal.SIGTERM, signal.SIG_DFL) -from PyQt5.QtCore import QTimer # pylint: disable=no-name-in-module, import-error -from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel # pylint: disable=no-name-in-module, import-error +from PyQt5.QtCore import QTimer +from PyQt5.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel from openpilot.selfdrive.ui.qt.python_helpers import set_main_window class Window(QWidget): diff --git a/selfdrive/test/openpilotci.py b/selfdrive/test/openpilotci.py index 3a7868aaa..fe1a0b033 100755 --- a/selfdrive/test/openpilotci.py +++ b/selfdrive/test/openpilotci.py @@ -24,13 +24,13 @@ def get_sas_token(): return sas_token def upload_bytes(data, name): - from azure.storage.blob import BlockBlobService # pylint: disable=import-error + from azure.storage.blob import BlockBlobService service = BlockBlobService(account_name="commadataci", sas_token=get_sas_token()) service.create_blob_from_bytes("openpilotci", name, data) return BASE_URL + name def upload_file(path, name): - from azure.storage.blob import BlockBlobService # pylint: disable=import-error + from azure.storage.blob import BlockBlobService service = BlockBlobService(account_name="commadataci", sas_token=get_sas_token()) service.create_blob_from_path("openpilotci", name, path) return BASE_URL + name diff --git a/selfdrive/test/profiling/lib.py b/selfdrive/test/profiling/lib.py index f28346f3f..843bf5221 100644 --- a/selfdrive/test/profiling/lib.py +++ b/selfdrive/test/profiling/lib.py @@ -34,7 +34,7 @@ class PubSocket(): class SubMaster(messaging.SubMaster): - def __init__(self, msgs, trigger, services, check_averag_freq=False): # pylint: disable=super-init-not-called + def __init__(self, msgs, trigger, services, check_averag_freq=False): self.frame = 0 self.data = {} self.ignore_alive = [] @@ -87,5 +87,5 @@ class SubMaster(messaging.SubMaster): class PubMaster(messaging.PubMaster): - def __init__(self): # pylint: disable=super-init-not-called + def __init__(self): self.sock = defaultdict(PubSocket) diff --git a/selfdrive/test/profiling/profiler.py b/selfdrive/test/profiling/profiler.py index 984907b87..1d380ba5e 100755 --- a/selfdrive/test/profiling/profiler.py +++ b/selfdrive/test/profiling/profiler.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import os import sys -import cProfile # pylint: disable=import-error +import cProfile import pprofile import pyprof2calltree diff --git a/selfdrive/test/test_valgrind_replay.py b/selfdrive/test/test_valgrind_replay.py index dbcf3b18d..a8a346310 100755 --- a/selfdrive/test/test_valgrind_replay.py +++ b/selfdrive/test/test_valgrind_replay.py @@ -53,7 +53,7 @@ class TestValgrind(unittest.TestCase): os.chdir(os.path.join(BASEDIR, cwd)) # Run valgrind on a process command = "valgrind --leak-check=full " + arg - p = subprocess.Popen(command, stderr=subprocess.PIPE, shell=True, preexec_fn=os.setsid) # pylint: disable=W1509 + p = subprocess.Popen(command, stderr=subprocess.PIPE, shell=True, preexec_fn=os.setsid) while not self.replay_done: time.sleep(0.1) diff --git a/selfdrive/test/update_ci_routes.py b/selfdrive/test/update_ci_routes.py index a69eb80ce..dda8568fa 100755 --- a/selfdrive/test/update_ci_routes.py +++ b/selfdrive/test/update_ci_routes.py @@ -3,13 +3,13 @@ from functools import lru_cache import sys import subprocess from tqdm import tqdm -from azure.storage.blob import BlockBlobService # pylint: disable=import-error +from azure.storage.blob import BlockBlobService from openpilot.selfdrive.car.tests.routes import routes as test_car_models_routes from openpilot.selfdrive.locationd.test.test_laikad import UBLOX_TEST_ROUTE, QCOM_TEST_ROUTE from openpilot.selfdrive.test.process_replay.test_processes import source_segments as replay_segments -from xx.chffr.lib import azureutil # pylint: disable=import-error -from xx.chffr.lib.storage import _DATA_ACCOUNT_PRODUCTION, _DATA_ACCOUNT_CI, _DATA_BUCKET_PRODUCTION # pylint: disable=import-error +from xx.chffr.lib import azureutil +from xx.chffr.lib.storage import _DATA_ACCOUNT_PRODUCTION, _DATA_ACCOUNT_CI, _DATA_BUCKET_PRODUCTION SOURCES = [ (_DATA_ACCOUNT_PRODUCTION, _DATA_BUCKET_PRODUCTION), diff --git a/selfdrive/thermald/thermald.py b/selfdrive/thermald/thermald.py index 266b28db0..32cfe11c3 100755 --- a/selfdrive/thermald/thermald.py +++ b/selfdrive/thermald/thermald.py @@ -118,8 +118,8 @@ def hw_state_thread(end_event, hw_queue): # Log modem version once if AGNOS and ((modem_version is None) or (modem_nv is None)): - modem_version = HARDWARE.get_modem_version() # pylint: disable=assignment-from-none - modem_nv = HARDWARE.get_modem_nv() # pylint: disable=assignment-from-none + modem_version = HARDWARE.get_modem_version() + modem_nv = HARDWARE.get_modem_nv() if (modem_version is not None) and (modem_nv is not None): cloudlog.event("modem version", version=modem_version, nv=modem_nv) diff --git a/selfdrive/tombstoned.py b/selfdrive/tombstoned.py index 25f2a61f9..3f99e1683 100755 --- a/selfdrive/tombstoned.py +++ b/selfdrive/tombstoned.py @@ -38,7 +38,7 @@ def clear_apport_folder(): def get_apport_stacktrace(fn): try: cmd = f'apport-retrace -s <(cat <(echo "Package: openpilot") "{fn}")' - return subprocess.check_output(cmd, shell=True, encoding='utf8', timeout=30, executable='/bin/bash') # pylint: disable=unexpected-keyword-arg + return subprocess.check_output(cmd, shell=True, encoding='utf8', timeout=30, executable='/bin/bash') except subprocess.CalledProcessError: return "Error getting stacktrace" except subprocess.TimeoutExpired: @@ -95,7 +95,7 @@ def report_tombstone_apport(fn): try: sig_num = int(line.strip().split(': ')[-1]) - message += " (" + signal.Signals(sig_num).name + ")" # pylint: disable=no-member + message += " (" + signal.Signals(sig_num).name + ")" except ValueError: pass diff --git a/selfdrive/ui/qt/python_helpers.py b/selfdrive/ui/qt/python_helpers.py index 59e51a551..88c36290d 100644 --- a/selfdrive/ui/qt/python_helpers.py +++ b/selfdrive/ui/qt/python_helpers.py @@ -1,7 +1,7 @@ import os from cffi import FFI -import sip # pylint: disable=import-error +import sip from openpilot.common.ffi_wrapper import suffix from openpilot.common.basedir import BASEDIR diff --git a/system/hardware/tici/hardware.py b/system/hardware/tici/hardware.py index 3cd342784..952693dd3 100644 --- a/system/hardware/tici/hardware.py +++ b/system/hardware/tici/hardware.py @@ -97,7 +97,7 @@ def get_device_type(): class Tici(HardwareBase): @cached_property def bus(self): - import dbus # pylint: disable=import-error + import dbus return dbus.SystemBus() @cached_property diff --git a/system/micd.py b/system/micd.py index ae2bf8673..c7af1b0ad 100755 --- a/system/micd.py +++ b/system/micd.py @@ -85,7 +85,7 @@ class Mic: def micd_thread(self): # sounddevice must be imported after forking processes - import sounddevice as sd # pylint: disable=import-outside-toplevel + import sounddevice as sd with sd.InputStream(channels=1, samplerate=SAMPLE_RATE, callback=self.callback) as stream: cloudlog.info(f"micd stream started: {stream.samplerate=} {stream.channels=} {stream.dtype=} {stream.device=}") diff --git a/system/ubloxd/tests/ublox.py b/system/ubloxd/tests/ublox.py index eeb6cde30..3243500e7 100644 --- a/system/ubloxd/tests/ublox.py +++ b/system/ubloxd/tests/ublox.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# pylint: skip-file ''' UBlox binary protocol handling diff --git a/system/ubloxd/tests/ubloxd.py b/system/ubloxd/tests/ubloxd.py index 783eb1eb0..4ee99dc28 100755 --- a/system/ubloxd/tests/ubloxd.py +++ b/system/ubloxd/tests/ubloxd.py @@ -1,6 +1,5 @@ #!/usr/bin/env python3 # type: ignore -# pylint: skip-file from openpilot.selfdrive.locationd.test import ublox import struct diff --git a/tools/bodyteleop/bodyav.py b/tools/bodyteleop/bodyav.py index fc9559f8d..3f11f8d4f 100644 --- a/tools/bodyteleop/bodyav.py +++ b/tools/bodyteleop/bodyav.py @@ -90,12 +90,12 @@ class WebClientSpeaker(MediaBlackhole): self.buffer.write(bio) async def start(self): - for track, task in self._MediaBlackhole__tracks.items(): # pylint: disable=access-member-before-definition + for track, task in self._MediaBlackhole__tracks.items(): if task is None: self._MediaBlackhole__tracks[track] = asyncio.ensure_future(self.consume(track)) async def stop(self): - for task in self._MediaBlackhole__tracks.values(): # pylint: disable=access-member-before-definition + for task in self._MediaBlackhole__tracks.values(): if task is not None: task.cancel() self._MediaBlackhole__tracks = {} diff --git a/tools/camerastream/compressed_vipc.py b/tools/camerastream/compressed_vipc.py index 495397d24..ac7ca2520 100755 --- a/tools/camerastream/compressed_vipc.py +++ b/tools/camerastream/compressed_vipc.py @@ -26,7 +26,7 @@ def decoder(addr, vipc_server, vst, nvidia, debug=False): if nvidia: os.environ["NV_LOW_LATENCY"] = "3" # both bLowLatency and CUVID_PKT_ENDOFPICTURE sys.path += os.environ["LD_LIBRARY_PATH"].split(":") - import PyNvCodec as nvc # pylint: disable=import-error + import PyNvCodec as nvc nvDec = nvc.PyNvDecoder(W, H, nvc.PixelFormat.NV12, nvc.CudaVideoCodec.HEVC, 0) cc1 = nvc.ColorspaceConversionContext(nvc.ColorSpace.BT_709, nvc.ColorRange.JPEG) diff --git a/tools/gpstest/fuzzy_testing.py b/tools/gpstest/fuzzy_testing.py index a2e130342..3bad2770c 100755 --- a/tools/gpstest/fuzzy_testing.py +++ b/tools/gpstest/fuzzy_testing.py @@ -1,7 +1,7 @@ #!/usr/bin/env python3 import argparse import multiprocessing -import rpyc # pylint: disable=import-error +import rpyc from collections import defaultdict from helper import download_rinex, exec_LimeGPS_bin diff --git a/tools/gpstest/rpc_server.py b/tools/gpstest/rpc_server.py index 060446370..cdedd8ea5 100644 --- a/tools/gpstest/rpc_server.py +++ b/tools/gpstest/rpc_server.py @@ -4,8 +4,8 @@ import shutil from datetime import datetime from collections import defaultdict -import rpyc # pylint: disable=import-error -from rpyc.utils.server import ThreadedServer # pylint: disable=import-error +import rpyc +from rpyc.utils.server import ThreadedServer #from openpilot.common.params import Params import cereal.messaging as messaging diff --git a/tools/lib/auth.py b/tools/lib/auth.py index 7fc71b689..997d1f860 100755 --- a/tools/lib/auth.py +++ b/tools/lib/auth.py @@ -54,7 +54,7 @@ class ClientRedirectHandler(BaseHTTPRequestHandler): self.end_headers() self.wfile.write(b'Return to the CLI to continue') - def log_message(self, *args): # pylint: disable=redefined-builtin + def log_message(self, *args): pass # this prevent http server from dumping messages to stdout diff --git a/tools/lib/framereader.py b/tools/lib/framereader.py index 27984514e..cbc931079 100644 --- a/tools/lib/framereader.py +++ b/tools/lib/framereader.py @@ -1,4 +1,3 @@ -# pylint: skip-file import json import os import pickle diff --git a/tools/lib/url_file.py b/tools/lib/url_file.py index c2c7fc9d3..e93f8e715 100644 --- a/tools/lib/url_file.py +++ b/tools/lib/url_file.py @@ -1,5 +1,3 @@ -# pylint: skip-file - import os import time import tempfile diff --git a/tools/replay/lib/ui_helpers.py b/tools/replay/lib/ui_helpers.py index aa1350214..e350b89ba 100644 --- a/tools/replay/lib/ui_helpers.py +++ b/tools/replay/lib/ui_helpers.py @@ -3,7 +3,7 @@ from typing import Any, Dict, Tuple import matplotlib.pyplot as plt import numpy as np -import pygame # pylint: disable=import-error +import pygame from matplotlib.backends.backend_agg import FigureCanvasAgg diff --git a/tools/replay/ui.py b/tools/replay/ui.py index 1659a024a..43195a481 100755 --- a/tools/replay/ui.py +++ b/tools/replay/ui.py @@ -3,9 +3,9 @@ import argparse import os import sys -import cv2 # pylint: disable=import-error +import cv2 import numpy as np -import pygame # pylint: disable=import-error +import pygame import cereal.messaging as messaging from openpilot.common.numpy_fast import clip diff --git a/tools/replay/unlog_ci_segment.py b/tools/replay/unlog_ci_segment.py index 8d69ae954..ae97ad45d 100755 --- a/tools/replay/unlog_ci_segment.py +++ b/tools/replay/unlog_ci_segment.py @@ -1,5 +1,4 @@ #!/usr/bin/env python3 -# pylint: skip-file import argparse import bisect diff --git a/tools/sim/bridge.py b/tools/sim/bridge.py index bacf38296..33fb2c020 100755 --- a/tools/sim/bridge.py +++ b/tools/sim/bridge.py @@ -8,7 +8,7 @@ import time from multiprocessing import Process, Queue from typing import Any -import carla # pylint: disable=import-error +import carla import numpy as np import pyopencl as cl import pyopencl.array as cl_array diff --git a/tools/sim/lib/can.py b/tools/sim/lib/can.py index 4cecbb2a6..db321d319 100755 --- a/tools/sim/lib/can.py +++ b/tools/sim/lib/can.py @@ -2,7 +2,7 @@ import cereal.messaging as messaging from opendbc.can.packer import CANPacker from opendbc.can.parser import CANParser -from openpilot.selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp # pylint: disable=no-name-in-module,import-error +from openpilot.selfdrive.boardd.boardd_api_impl import can_list_to_can_capnp from openpilot.selfdrive.car import crc8_pedal packer = CANPacker("honda_civic_touring_2016_can_generated") diff --git a/tools/sim/lib/manual_ctrl.py b/tools/sim/lib/manual_ctrl.py index 8f1bcc2b5..1687a2e6b 100755 --- a/tools/sim/lib/manual_ctrl.py +++ b/tools/sim/lib/manual_ctrl.py @@ -135,8 +135,8 @@ def wheel_poll_thread(q: 'Queue[str]') -> NoReturn: print('%d buttons found: %s' % (num_buttons, ', '.join(button_map))) # Enable FF - import evdev # pylint: disable=import-error - from evdev import ecodes, InputDevice # pylint: disable=import-error + import evdev + from evdev import ecodes, InputDevice device = evdev.list_devices()[0] evtdev = InputDevice(device) val = 24000 diff --git a/tools/webcam/front_mount_helper.py b/tools/webcam/front_mount_helper.py index d4f7d71b4..0b7b676f6 100755 --- a/tools/webcam/front_mount_helper.py +++ b/tools/webcam/front_mount_helper.py @@ -18,7 +18,7 @@ webcam_intrinsics = np.array([ cam_id = 2 if __name__ == "__main__": - import cv2 # pylint: disable=import-error + import cv2 trans_webcam_to_eon_front = np.dot(eon_dcam_intrinsics, np.linalg.inv(webcam_intrinsics)) diff --git a/tools/webcam/warp_vis.py b/tools/webcam/warp_vis.py index a9ae25ee6..e3f1284a4 100755 --- a/tools/webcam/warp_vis.py +++ b/tools/webcam/warp_vis.py @@ -23,7 +23,7 @@ webcam_intrinsics = np.array([ [ 0., 0., 1.]]) if __name__ == "__main__": - import cv2 # pylint: disable=import-error + import cv2 trans_webcam_to_eon_rear = np.dot(eon_intrinsics, np.linalg.inv(webcam_intrinsics)) trans_webcam_to_eon_front = np.dot(eon_dcam_intrinsics, np.linalg.inv(webcam_intrinsics)) print("trans_webcam_to_eon_rear:\n", trans_webcam_to_eon_rear)