Skip to content

heumsi/python-dependency-linter

Repository files navigation

python-dependency-linter

A dependency linter for Python projects. Define rules for which modules can depend on what, and catch violations.

Installation

pip install python-dependency-linter

Or with uv:

uv add python-dependency-linter

Quick Start

Create .python-dependency-linter.yaml in your project root:

rules:
  - name: domain-isolation
    modules: contexts.*.domain
    description: Domain layer must not depend on application or infrastructure
    allow:
      standard_library: [dataclasses, typing]
      third_party: [pydantic]
      local: [contexts.*.domain]

Run:

pdl check

Documentation

For full documentation, visit heumsi.github.io/python-dependency-linter.

License

MIT