'Detect diff in usage of local python module within a repo

I have a large python repo called REPO. Within REPO is a module MODULE that is imported and used throughout REPO. I'm trying to find a way to automatically detect whenever one of the following happens:

  1. Someone adds an instance of importing MODULE to their file in REPO
  2. Someone removes/changes an instance of importing MODULE in their file in REPO
  3. Someone changes the way they are using an import of MODULE in their file.


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source