If you care about code quality you are probably already familiar with linting-tools like flake8 and pylint. These tools automatically check your python code for common code-smells and anti-patterns.
Another excellent tool in this category is import-linter. Import-linter can check that your dependency tree adheres to your chosen architecture. For example, in a Django project, it would be bad practice if your model would import a view or a form. With import-linter, you can specify this as a layer-contract: