Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

selfdrive/car: ban imports from external modules #32726

Closed
wants to merge 11 commits into from
Closed

Conversation

sshane
Copy link
Contributor

@sshane sshane commented Jun 12, 2024

requires a fix in import-linter first

batman@workstation-shane:~/openpilot$ lint-imports
=============
Import Linter
=============

---------
Contracts
---------

Analyzed 454 files, 1075 dependencies.
--------------------------------------

Forbid imports from openpilot.selfdrive.car to openpilot.system BROKEN

Contracts: 0 kept, 1 broken.


----------------
Broken contracts
----------------

Forbid imports from openpilot.selfdrive.car to openpilot.system
---------------------------------------------------------------

openpilot.selfdrive.car is not allowed to import openpilot.system:

-   openpilot.selfdrive.car.body.carcontroller -> openpilot.common.realtime (l.3)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.body.interface -> openpilot.common.realtime (l.3)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.car_helpers -> openpilot.common.swaglog (l.12)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.car_helpers -> openpilot.system.version (l.15)

-   openpilot.selfdrive.car.card -> openpilot.common.realtime (l.12)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.card -> openpilot.selfdrive.controls.lib.events (l.17)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.swaglog (l.21)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.chrysler.carcontroller -> openpilot.common.realtime (l.2)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.disable_ecu -> openpilot.common.swaglog (l.3)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.ecu_addrs -> openpilot.common.swaglog (l.10)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.ford.carcontroller -> openpilot.selfdrive.controls.lib.drive_helpers (l.8)
    openpilot.selfdrive.controls.lib.drive_helpers -> openpilot.common.realtime (l.6)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.fw_versions -> openpilot.common.swaglog (l.12)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.gm.carcontroller -> openpilot.common.realtime (l.4)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.gm.interface -> openpilot.selfdrive.controls.lib.drive_helpers (l.13)
    openpilot.selfdrive.controls.lib.drive_helpers -> openpilot.common.realtime (l.6)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.honda.carcontroller -> openpilot.common.realtime (l.5)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.hyundai.carcontroller -> openpilot.common.realtime (l.4)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.interfaces -> openpilot.common.realtime (l.16)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.interfaces -> openpilot.selfdrive.controls.lib.events (l.20)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.swaglog (l.21)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.isotp_parallel_query -> openpilot.common.swaglog (l.6)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.common.realtime (l.9)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.tests.test_lateral_limits -> openpilot.common.realtime (l.8)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.common.realtime (l.15)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.manager.process_config (l.12)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.version (l.14)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.system.hardware.hw (l.24)

-   openpilot.selfdrive.car.toyota.carstate -> openpilot.common.realtime (l.7)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)

-   openpilot.selfdrive.car.vin -> openpilot.common.swaglog (l.8)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.volkswagen.carcontroller -> openpilot.common.realtime (l.5)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

@sshane
Copy link
Contributor Author

sshane commented Jun 12, 2024

Here's everything outside of selfdrive/car:

=============ation-shane:~/openpilot$ lint-imports 
Import Linter
=============

---------
Contracts
---------

Analyzed 454 files, 1075 dependencies.
--------------------------------------

Forbid imports from openpilot.selfdrive.car to openpilot.system BROKEN

Contracts: 0 kept, 1 broken.


----------------
Broken contracts
----------------

Forbid imports from openpilot.selfdrive.car to openpilot.system
---------------------------------------------------------------

openpilot.selfdrive.car is not allowed to import openpilot.system:

-   openpilot.selfdrive.car.body.carcontroller -> openpilot.common.realtime (l.3)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.body.interface -> openpilot.common.realtime (l.3)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.car_helpers -> openpilot.common.swaglog (l.12)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.car_helpers -> openpilot.system.version (l.15)

-   openpilot.selfdrive.car.card -> openpilot.common.realtime (l.12)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.card -> openpilot.selfdrive.controls.lib.events (l.17)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.swaglog (l.21)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.chrysler.carcontroller -> openpilot.common.realtime (l.2)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.disable_ecu -> openpilot.common.swaglog (l.3)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.ecu_addrs -> openpilot.common.swaglog (l.10)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.ford.carcontroller -> openpilot.selfdrive.controls.lib.drive_helpers (l.8)
    openpilot.selfdrive.controls.lib.drive_helpers -> openpilot.common.realtime (l.6)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.fw_versions -> openpilot.common.swaglog (l.12)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.gm.carcontroller -> openpilot.common.realtime (l.4)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.gm.interface -> openpilot.selfdrive.controls.lib.drive_helpers (l.13)
    openpilot.selfdrive.controls.lib.drive_helpers -> openpilot.common.realtime (l.6)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.honda.carcontroller -> openpilot.common.realtime (l.5)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.hyundai.carcontroller -> openpilot.common.realtime (l.4)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.interfaces -> openpilot.common.realtime (l.16)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.interfaces -> openpilot.selfdrive.controls.lib.events (l.20)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.swaglog (l.21)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.isotp_parallel_query -> openpilot.common.swaglog (l.6)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.common.realtime (l.9)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.tests.test_lateral_limits -> openpilot.common.realtime (l.8)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.hardware (l.13)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.manager.process_config (l.12)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.version (l.14)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.system.hardware.hw (l.24)

-   openpilot.selfdrive.car.toyota.carstate -> openpilot.common.realtime (l.7)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)

-   openpilot.selfdrive.car.vin -> openpilot.common.swaglog (l.8)
    openpilot.common.swaglog -> openpilot.system.hardware.hw (l.11)

-   openpilot.selfdrive.car.volkswagen.carcontroller -> openpilot.common.realtime (l.5)
    openpilot.common.realtime -> openpilot.system.hardware (l.9)


openpilot.selfdrive.car is not allowed to import openpilot.common:

-   openpilot.selfdrive.car -> openpilot.common.numpy_fast (l.10)

-   openpilot.selfdrive.car -> openpilot.common.utils (l.11)

-   openpilot.selfdrive.car.body.carcontroller -> openpilot.common.realtime (l.3)

-   openpilot.selfdrive.car.body.carcontroller -> openpilot.selfdrive.controls.lib.pid (l.8)
    openpilot.selfdrive.controls.lib.pid -> openpilot.common.numpy_fast (l.4)

-   openpilot.selfdrive.car.body.interface -> openpilot.common.realtime (l.3)

-   openpilot.selfdrive.car.car_helpers -> openpilot.common.params (l.6)

-   openpilot.selfdrive.car.car_helpers -> openpilot.common.swaglog (l.12)

-   openpilot.selfdrive.car.car_helpers -> openpilot.system.version (l.15)
    openpilot.system.version -> openpilot.common.basedir (l.9)

-   openpilot.selfdrive.car.car_helpers -> openpilot.system.version (l.15)
    openpilot.system.version -> openpilot.common.git (l.11)

-   openpilot.selfdrive.car.card -> openpilot.common.params (l.11)

-   openpilot.selfdrive.car.card -> openpilot.common.realtime (l.12)

-   openpilot.selfdrive.car.card -> openpilot.selfdrive.controls.lib.events (l.17)
    openpilot.selfdrive.controls.lib.events -> openpilot.common.conversions (l.10)

-   openpilot.selfdrive.car.card -> openpilot.selfdrive.controls.lib.events (l.17)
    openpilot.selfdrive.controls.lib.events -> openpilot.common.git (l.11)

-   openpilot.selfdrive.car.card -> openpilot.selfdrive.controls.lib.events (l.17)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.swaglog (l.21)

-   openpilot.selfdrive.car.card -> openpilot.selfdrive.controls.lib.events (l.17)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.transformations.orientation (l.20)

-   openpilot.selfdrive.car.chrysler.carcontroller -> openpilot.common.realtime (l.2)

-   openpilot.selfdrive.car.chrysler.carstate -> openpilot.common.conversions (l.2)

-   openpilot.selfdrive.car.disable_ecu -> openpilot.common.swaglog (l.3)

-   openpilot.selfdrive.car.docs -> openpilot.common.basedir (l.10)

-   openpilot.selfdrive.car.docs_definitions -> openpilot.common.conversions (l.8)

-   openpilot.selfdrive.car.ecu_addrs -> openpilot.common.swaglog (l.10)

-   openpilot.selfdrive.car.ford.carcontroller -> openpilot.common.numpy_fast (l.3)

-   openpilot.selfdrive.car.ford.carcontroller -> openpilot.selfdrive.controls.lib.drive_helpers (l.8)
    openpilot.selfdrive.controls.lib.drive_helpers -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.ford.carcontroller -> openpilot.selfdrive.controls.lib.drive_helpers (l.8)
    openpilot.selfdrive.controls.lib.drive_helpers -> openpilot.common.realtime (l.6)

-   openpilot.selfdrive.car.ford.carstate -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.ford.interface -> openpilot.common.conversions (l.3)

-   openpilot.selfdrive.car.ford.radar_interface -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.fw_versions -> openpilot.common.params (l.11)

-   openpilot.selfdrive.car.fw_versions -> openpilot.common.swaglog (l.12)

-   openpilot.selfdrive.car.gm.carcontroller -> openpilot.common.conversions (l.2)

-   openpilot.selfdrive.car.gm.carcontroller -> openpilot.common.numpy_fast (l.3)

-   openpilot.selfdrive.car.gm.carcontroller -> openpilot.common.realtime (l.4)

-   openpilot.selfdrive.car.gm.carstate -> openpilot.common.conversions (l.3)

-   openpilot.selfdrive.car.gm.carstate -> openpilot.common.numpy_fast (l.4)

-   openpilot.selfdrive.car.gm.interface -> openpilot.common.basedir (l.7)

-   openpilot.selfdrive.car.gm.interface -> openpilot.common.conversions (l.8)

-   openpilot.selfdrive.car.gm.interface -> openpilot.selfdrive.controls.lib.drive_helpers (l.13)
    openpilot.selfdrive.controls.lib.drive_helpers -> openpilot.common.numpy_fast (l.5)

-   openpilot.selfdrive.car.gm.interface -> openpilot.selfdrive.controls.lib.drive_helpers (l.13)
    openpilot.selfdrive.controls.lib.drive_helpers -> openpilot.common.realtime (l.6)

-   openpilot.selfdrive.car.gm.radar_interface -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.honda.carcontroller -> openpilot.common.numpy_fast (l.4)

-   openpilot.selfdrive.car.honda.carcontroller -> openpilot.common.realtime (l.5)

-   openpilot.selfdrive.car.honda.carcontroller -> openpilot.selfdrive.controls.lib.drive_helpers (l.10)
    openpilot.selfdrive.controls.lib.drive_helpers -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.honda.carstate -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.honda.carstate -> openpilot.common.numpy_fast (l.5)

-   openpilot.selfdrive.car.honda.hondacan -> openpilot.common.conversions (l.1)

-   openpilot.selfdrive.car.honda.interface -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.honda.interface -> openpilot.common.numpy_fast (l.5)

-   openpilot.selfdrive.car.honda.values -> openpilot.common.conversions (l.5)

-   openpilot.selfdrive.car.hyundai.carcontroller -> openpilot.common.conversions (l.2)

-   openpilot.selfdrive.car.hyundai.carcontroller -> openpilot.common.numpy_fast (l.3)

-   openpilot.selfdrive.car.hyundai.carcontroller -> openpilot.common.realtime (l.4)

-   openpilot.selfdrive.car.hyundai.carstate -> openpilot.common.conversions (l.6)

-   openpilot.selfdrive.car.hyundai.hyundaicanfd -> openpilot.common.numpy_fast (l.1)

-   openpilot.selfdrive.car.hyundai.values -> openpilot.common.conversions (l.7)

-   openpilot.selfdrive.car.interfaces -> openpilot.common.basedir (l.12)

-   openpilot.selfdrive.car.interfaces -> openpilot.common.conversions (l.13)

-   openpilot.selfdrive.car.interfaces -> openpilot.common.numpy_fast (l.15)

-   openpilot.selfdrive.car.interfaces -> openpilot.common.realtime (l.16)

-   openpilot.selfdrive.car.interfaces -> openpilot.common.simple_kalman (l.14)

-   openpilot.selfdrive.car.interfaces -> openpilot.selfdrive.controls.lib.events (l.20)
    openpilot.selfdrive.controls.lib.events -> openpilot.common.git (l.11)

-   openpilot.selfdrive.car.interfaces -> openpilot.selfdrive.controls.lib.events (l.20)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.params (l.18)

-   openpilot.selfdrive.car.interfaces -> openpilot.selfdrive.controls.lib.events (l.20)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.swaglog (l.21)

-   openpilot.selfdrive.car.interfaces -> openpilot.selfdrive.controls.lib.events (l.20)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.transformations.orientation (l.20)

-   openpilot.selfdrive.car.isotp_parallel_query -> openpilot.common.swaglog (l.6)

-   openpilot.selfdrive.car.mazda.carstate -> openpilot.common.conversions (l.2)

-   openpilot.selfdrive.car.mazda.interface -> openpilot.common.conversions (l.3)

-   openpilot.selfdrive.car.mazda.values -> openpilot.common.conversions (l.5)

-   openpilot.selfdrive.car.nissan.carstate -> openpilot.common.conversions (l.6)

-   openpilot.selfdrive.car.subaru.carcontroller -> openpilot.common.numpy_fast (l.1)

-   openpilot.selfdrive.car.subaru.carstate -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.tesla.carcontroller -> openpilot.common.numpy_fast (l.1)

-   openpilot.selfdrive.car.tesla.carstate -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.tesla.teslacan -> openpilot.common.conversions (l.3)

-   openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.common.realtime (l.9)

-   openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.controls.lib.latcontrol_torque (l.17)
    openpilot.selfdrive.controls.lib.latcontrol_torque -> openpilot.common.numpy_fast (l.4)

-   openpilot.selfdrive.car.tests.test_car_interfaces -> openpilot.selfdrive.controls.lib.longcontrol (l.18)
    openpilot.selfdrive.controls.lib.longcontrol -> openpilot.selfdrive.controls.lib.drive_helpers (l.4)
    openpilot.selfdrive.controls.lib.drive_helpers -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.tests.test_docs -> openpilot.common.basedir (l.6)

-   openpilot.selfdrive.car.tests.test_lateral_limits -> openpilot.common.realtime (l.8)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.common.basedir (l.13)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.common.params (l.14)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.common.realtime (l.15)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.manager.process_config (l.12)
    openpilot.system.manager.process_config -> openpilot.system.manager.process (l.6)
    openpilot.system.manager.process -> openpilot.common.threadname (l.11)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.manager.process_config (l.12)
    openpilot.system.manager.process_config -> openpilot.system.manager.process (l.6)
    openpilot.system.manager.process -> openpilot.system.sentry (l.15)
    openpilot.system.sentry -> openpilot.system.athena.registration (l.7)
    openpilot.system.athena.registration -> openpilot.common.api (l.8)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.manager.process_config (l.12)
    openpilot.system.manager.process_config -> openpilot.system.manager.process (l.6)
    openpilot.system.manager.process -> openpilot.system.sentry (l.15)
    openpilot.system.sentry -> openpilot.system.athena.registration (l.7)
    openpilot.system.athena.registration -> openpilot.common.spinner (l.10)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.manager.process_config (l.12)
    openpilot.system.manager.process_config -> openpilot.system.manager.process (l.6)
    openpilot.system.manager.process -> openpilot.system.sentry (l.15)
    openpilot.system.sentry -> openpilot.system.athena.registration (l.7)
    openpilot.system.athena.registration -> openpilot.selfdrive.controls.lib.alertmanager (l.11)
    openpilot.selfdrive.controls.lib.alertmanager -> openpilot.selfdrive.controls.lib.events (l.9)
    openpilot.selfdrive.controls.lib.events -> openpilot.common.conversions (l.10)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.manager.process_config (l.12)
    openpilot.system.manager.process_config -> openpilot.system.manager.process (l.6)
    openpilot.system.manager.process -> openpilot.system.sentry (l.15)
    openpilot.system.sentry -> openpilot.system.athena.registration (l.7)
    openpilot.system.athena.registration -> openpilot.selfdrive.controls.lib.alertmanager (l.11)
    openpilot.selfdrive.controls.lib.alertmanager -> openpilot.selfdrive.controls.lib.events (l.9)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.transformations.orientation (l.20)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.selfdrive.test.helpers (l.23)
    openpilot.selfdrive.test.helpers -> openpilot.system.version (l.14)
    openpilot.system.version -> openpilot.common.git (l.11)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.system.hardware.hw (l.24)
    openpilot.system.hardware.hw -> openpilot.system.hardware (l.4)
    openpilot.system.hardware -> openpilot.system.hardware.tici.hardware (l.5)
    openpilot.system.hardware.tici.hardware -> openpilot.common.gpio (l.12)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.tools.lib.logreader (l.25)
    openpilot.tools.lib.logreader -> openpilot.common.swaglog (l.18)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.tools.lib.logreader (l.25)
    openpilot.tools.lib.logreader -> openpilot.tools.lib.filereader (l.21)
    openpilot.tools.lib.filereader -> openpilot.tools.lib.url_file (l.5)
    openpilot.tools.lib.url_file -> openpilot.common.file_helpers (l.10)

-   openpilot.selfdrive.car.toyota.carcontroller -> openpilot.common.numpy_fast (l.2)

-   openpilot.selfdrive.car.toyota.carstate -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.toyota.carstate -> openpilot.common.filter_simple (l.6)

-   openpilot.selfdrive.car.toyota.carstate -> openpilot.common.numpy_fast (l.5)

-   openpilot.selfdrive.car.toyota.carstate -> openpilot.common.realtime (l.7)

-   openpilot.selfdrive.car.toyota.values -> openpilot.common.conversions (l.7)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.common.api (l.33)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.common.file_helpers (l.34)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.common.params (l.35)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.common.realtime (l.36)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.common.swaglog (l.39)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.system.camerad.snapshot.snapshot (l.536)
    openpilot.system.camerad.snapshot.snapshot -> openpilot.selfdrive.controls.lib.alertmanager (l.13)
    openpilot.selfdrive.controls.lib.alertmanager -> openpilot.selfdrive.controls.lib.events (l.9)
    openpilot.selfdrive.controls.lib.events -> openpilot.selfdrive.locationd.calibrationd (l.13)
    openpilot.selfdrive.locationd.calibrationd -> openpilot.common.transformations.orientation (l.20)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.system.camerad.snapshot.snapshot (l.536)
    openpilot.system.camerad.snapshot.snapshot -> openpilot.system.manager.process_config (l.14)
    openpilot.system.manager.process_config -> openpilot.system.manager.process (l.6)
    openpilot.system.manager.process -> openpilot.common.threadname (l.11)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.system.camerad.snapshot.snapshot (l.536)
    openpilot.system.camerad.snapshot.snapshot -> openpilot.system.manager.process_config (l.14)
    openpilot.system.manager.process_config -> openpilot.system.manager.process (l.6)
    openpilot.system.manager.process -> openpilot.system.sentry (l.15)
    openpilot.system.sentry -> openpilot.system.athena.registration (l.7)
    openpilot.system.athena.registration -> openpilot.common.spinner (l.10)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.system.hardware (l.37)
    openpilot.system.hardware -> openpilot.system.hardware.tici.hardware (l.5)
    openpilot.system.hardware.tici.hardware -> openpilot.common.gpio (l.12)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.system.version (l.40)
    openpilot.system.version -> openpilot.common.basedir (l.9)

-   openpilot.selfdrive.car.toyota.values -> openpilot.system.athena.athenad (l.12)
    openpilot.system.athena.athenad -> openpilot.system.version (l.40)
    openpilot.system.version -> openpilot.common.git (l.11)

-   openpilot.selfdrive.car.vin -> openpilot.common.swaglog (l.8)

-   openpilot.selfdrive.car.volkswagen.carcontroller -> openpilot.common.conversions (l.4)

-   openpilot.selfdrive.car.volkswagen.carcontroller -> openpilot.common.numpy_fast (l.3)

-   openpilot.selfdrive.car.volkswagen.carcontroller -> openpilot.common.realtime (l.5)

-   openpilot.selfdrive.car.volkswagen.carstate -> openpilot.common.conversions (l.3)

-   openpilot.selfdrive.car.volkswagen.values -> openpilot.common.conversions (l.8)


openpilot.selfdrive.car is not allowed to import openpilot.tools:

-   openpilot.selfdrive.car.tests.test_models -> openpilot.tools.lib.logreader (l.25)

-   openpilot.selfdrive.car.tests.test_models -> openpilot.tools.lib.route (l.26)

Copy link
Contributor

This PR has had no activity for 14 days. It will be automatically closed in 3 days if there is no activity.

@github-actions github-actions bot added stale and removed stale labels Jun 28, 2024
@sshane sshane added this to the 0.9.8 milestone Jul 1, 2024
@adeebshihadeh
Copy link
Contributor

@deanlee maybe you'd be interested in finishing this PR up? The ultimate goal is to move all the car interfacing code into opendbc. We plan to do that in these steps:

  1. merge this PR which blocks adding new imports from openpilot
  2. refactor selfdrive/car/ in-place to not import anything else from openpilot (with small incremental PRs)
  3. once there's no more openpilot imports, mv selfdrive/car/ opendbc/

@deanlee
Copy link
Contributor

deanlee commented Jul 12, 2024

After taking a quick look, it seems like getting this PR to pass lint-imports will need a lot of changes, including refactoring self.car and related tests. This may need to be approached incrementally across multiple PRs.

We also need to sort out some issues #32630 before the refactor, For example, should we put controls.lib.events under car.events just for basic event info like event names? and handle other stuff like text formatting, in selfdrive/controls/lib? or move car.canp to selfdrive/car?
Do we have any solid plans for dealing with these issues at this stage?

@adeebshihadeh
Copy link
Contributor

Yes, there are still a lot of open questions. This PR is just to whitelist the existing imports so we don't add any more. Then, we'll make several PRs to remove each import one by one. There will be some easy ones, and some hard ones like you said.

@sshane sshane closed this Jul 15, 2024
@sshane sshane deleted the lint-imports branch July 15, 2024 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants