Blog of Rob Galanakis (@robgalanakis)

Pynocle update

New pynocle uploaded to google code (not PyPI yet). In this is a much better dependency graph rendering, module filename resolution, optimizations (such as only calculating dependency data and filename resolutions once), replacing imports with AST, and other improvements. However I took out the ability to run pynocle over more than just a single directory :( Hopefully this can be added back in. I really need to refactor and test some of this code, though, since it’s becoming quite hairy. The python import machinery is the first thing I’ve truly hated about python.

Next up is probably a substantial refactor of the entire system to work from a relational DB (or maybe even a python mapping pickle), rather than the ad-hoc method it uses right now.  This should allow richer metrics and more flexibility in their use.

The big backend problems right now are exactly that lack of relational data (which I can hopefully solve with a rewrite), and the difficulty in testing the module import mechanisms.  Trying to test it thoroughly meaning practically rewriting and testing all of python’s module import resolution, and then creating a sample of test data that can replicate all of the hundreds of edge-cases (paths with mixed slashes, relative paths, absolute paths with relative pieces, builtin modules with no files, modules not available on the test machine, modules in god knows where in the sys path, etc.).  I’ve done myself a disservice by not building enough tests where I can build them, though (post about this in a few days).  Anyway, I’ll update when I can.

See current metrics here: http://pynocle.googlecode.com/hg/exampleoutput/index.html

Dependency graph here:
http://pynocle.googlecode.com/hg/exampleoutput/depgraph.png

One thought on “Pynocle update

  1. Damon Smith says:

    Rob, there’s a great opportunity here to use an icon of a Python with a monocle

Leave a Reply