[importlinter]
root_package = atlastrack
# Required whenever the forbidden modules are third-party (napari, qtpy, ...):
# without it import-linter 2.x refuses to build the graph and exits with a config
# error, which looks enough like a failed contract to be mistaken for one. The
# contract below was silently not being checked until this was added.
include_external_packages = True

# The single most important architectural rule: the core (registration, atlas,
# probes, landmarks, sectioning, io, viz.plotly3d) must NOT depend on Qt/napari.
# Only atlastrack.gui (and viz.napari3d) may import them.

[importlinter:contract:core-stays-headless]
name = Core modules must not import Qt/napari/magicgui
type = forbidden
source_modules =
    atlastrack.project
    atlastrack.io
    atlastrack.atlas
    atlastrack.sectioning
    atlastrack.landmarks
    atlastrack.registration
    atlastrack.probes
    atlastrack.ephys
    atlastrack.viz.plotly3d
forbidden_modules =
    napari
    qtpy
    magicgui
    PyQt5
    PyQt6
    PySide2
    PySide6
