Skip to content

python/import-linter

Runs project import contracts from setup.cfg, .importlinter, or pyproject.toml.

Part of the python configuration, at the recommended level. It runs at the commit stage, once per scope. It runs uv.

A layer that imports the layer above it turns an architecture into a diagram nobody follows.

Move the import to the side the contract allows, or change the contract.

A module that imports from a forbidden layer reports a broken contract. Move the shared code to an allowed layer, and update the import.

Turn it off for some files, with a reason:

gspot ignore python/import-linter --paths "<glob>" --reason "<why>"