Skip to content

python/deptry

Compares the imports of the project with the dependencies it declares: missing, unused, and transitive ones.

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

An import that works through somebody else’s dependency breaks the day they drop it.

Declare the dependency, or remove the one nothing imports. Turn one rule off with gspot ignore python/deptry --rule <code> --reason "<why>".

An import of a third-party package missing from the project dependencies reports a finding. Declare the package and update the lockfile, or remove the import.

Turn it off for some files, with a reason:

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