title: Python API Compatibility Checker
body: <p>In my current work environment, we produce a large number of Python packages for internal use (10s if not 100s).  Each package has some dependencies, usually on a mixture of internal and external packages, and some of these dependencies are shared.  </p>
  
  <p>As we approach <a href="http://en.wikipedia.org/wiki/Dependency_hell" rel="nofollow">dependency hell</a>, updating dependencies becomes a time consuming process.  While we care about the functional changes a new version might introduce, of equal (if not more) importance are the API changes that break the code.</p>
  
  <p>Although running unit/integration tests against newer versions of a dependency helps us to catch some issues, our coverage is not close enough to 100% to make this a robust strategy.  Release notes and a change log help identify major changes at a high-level, but these rarely exist for internally developed tools or go into enough detail to understand the implications the new version has on the (public) API.  </p>
  
  <p>I am looking at otherways to automate this process.</p>
  
  <p>I would like to be able to automatically compare two versions of a Python package and report the API differences between them.  In particular this would include backwards incompatible changes such as removing functions/methods/classes/modules, adding positional arguments to a function/method/class and changing the number of items a function/method returns.  As a developer, based on the report this generates I should have a greater understanding about the code level implications this version change will introduce, and so the time require to integrate it.</p>
  
  <p>Elsewhere, we use the <a href="http://lvc.github.io/abi-compliance-checker/" rel="nofollow">C++ abi-compliance-checker</a> and are looking at the <a href="https://github.com/lvc/japi-compliance-checker" rel="nofollow">Java api-compliance-checker</a> to help with this process.  Is there a similar tool available for Python?  I have found plenty of lint/analysis/refactor tools but nothing that provides this level of functionality.  I understand that Python's dynamic typing will make a comprehensive report impossible.</p>
  
  <p>If such a tool does not exist, are they any libraries that could help with implementing a solution?  For example, my current approach would be to use an <a href="http://docs.python.org/2/library/ast.html#ast.NodeVisitor" rel="nofollow">ast.NodeVisitor</a> to traverse the package and build a tree where each node represents a module/class/method/function and then compare this tree to that of another version for the same package.</p>
  
  <p><strong>Edit</strong>: since posting the question I have found <a href="https://github.com/yinwang0/psydiff" rel="nofollow">pysdiff</a> which covers some of my requirements, but interested to see alternatives still.</p>
  
  <p><strong>Edit</strong>: also found <a href="http://upstream.rosalinux.ru" rel="nofollow">Upstream-Tracker</a> would is a good example of the sort of information I'd like to end up with.</p>