From 1d3e059cc6f5fa7f3231904b28307029e868045a Mon Sep 17 00:00:00 2001 From: Shane Smiskol Date: Tue, 6 Aug 2024 13:45:05 -0700 Subject: [PATCH] ban cereal and msgq --- .importlinter | 13 +++++++++++++ selfdrive/car/vin.py | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.importlinter b/.importlinter index 3cd74f2b9b..a3825599d4 100644 --- a/.importlinter +++ b/.importlinter @@ -1,6 +1,8 @@ [importlinter] root_packages = openpilot + cereal + capnp [importlinter:contract:1] name = Forbid imports from openpilot.selfdrive.car to openpilot.system @@ -8,6 +10,8 @@ type = forbidden source_modules = openpilot.selfdrive.car forbidden_modules = + cereal + capnp openpilot.common.params openpilot.system openpilot.body @@ -40,4 +44,13 @@ ignore_imports = # these two will still live in openpilot, but require some modification openpilot.selfdrive.car.fw_versions -> openpilot.common.params openpilot.selfdrive.car.ecu_addrs -> openpilot.common.params + openpilot.selfdrive.car.tests.test_models -> capnp + openpilot.selfdrive.car.tests.test_car_interfaces -> cereal + openpilot.selfdrive.car.tests.test_car_interfaces -> cereal.messaging + openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.test.fuzzy_generation + openpilot.selfdrive.car.tests.test_models -> cereal + openpilot.selfdrive.car.tests.test_models -> cereal.messaging + openpilot.selfdrive.car.card -> cereal + openpilot.selfdrive.car.card -> cereal.messaging + openpilot.selfdrive.car.vin -> cereal.messaging unmatched_ignore_imports_alerting = warn diff --git a/selfdrive/car/vin.py b/selfdrive/car/vin.py index d662f9a7de..1d2033e791 100755 --- a/selfdrive/car/vin.py +++ b/selfdrive/car/vin.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import re -import cereal.messaging as messaging from panda.python.uds import get_rx_addr_for_tx_addr, FUNCTIONAL_ADDRS from openpilot.selfdrive.car import carlog from openpilot.selfdrive.car.isotp_parallel_query import IsoTpParallelQuery @@ -63,6 +62,7 @@ def get_vin(logcan, sendcan, buses, timeout=0.1, retry=2, debug=False): if __name__ == "__main__": import argparse import time + import cereal.messaging as messaging parser = argparse.ArgumentParser(description='Get VIN of the car') parser.add_argument('--debug', action='store_true')