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.
What to do
Section titled “What to do”Declare the dependency, or remove the one nothing imports. Turn one rule off with gspot ignore python/deptry --rule <code> --reason "<why>".
Example
Section titled “Example”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
Section titled “Turn it off”Turn it off for some files, with a reason:
gspot ignore python/deptry --paths "<glob>" --reason "<why>"