seddonym/import-linter

Symlinks are not followed

Closed this issue · 1 comments

I haven't looked into why yet with this library, but symlinks do not seem to be followed properly:

# selfdrive/car/toyota/values.py
from openpilot.system import ...  # this should be banned
openpilot/  # main project directory
├── openpilot/
│   ├── __init__.py
│   ├── selfdrive/
│   │   ├── ... (other files)
│   ├── system/
│   │   ├── ... (other files)
│   ├── selfdrive/ (symlink to ../selfdrive)
│   │   ├── __init__.py
│   │   ├── car/
│   │   │   ├── __init__.py
│   │   │   └── ... (other files)
│   ├── system/ (symlink to ../system)
│       ├── __init__.py
│       └── ... (other files)
├── .importlinter
├── .pre-commit-config.yaml

But the error message I get is:

Missing layer 'openpilot.system': module openpilot.system does not exist.

If I copy the system/ and selfdrive/ folders from the root into the openpilot/openpilot folder such that they aren't symlinks anymore, then it can find it.

# .importlinter
[importlinter]
root_packages=
    openpilot

[importlinter:contract:1]
name = Banned openpilot.system
type = layers
layers=
    openpilot.system
    openpilot.selfdrive.car

Seems to be fixed with seddonym/grimp#152. You can close if you like since it's not this module's problem