# python/import-linter

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

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

Part of the [`python`](/reference/configurations/python/) configuration, at the `recommended` [level](/start/concepts/#levels). It runs at the `commit` [stage](/start/concepts/#stage), once per scope. It runs uv.

## Why

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

## What to do

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

## Example

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

Turn it off for some files, with a reason:

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