Emacs, pdb, and zip_safe eggs

by Ross Patterson last modified 2008-11-23T04:06:59+02:00
restoring pdbtrack grace to zipped eggs

Eggs are our glory, easy_install is our salvation, and buildout is our Valhalla, yes I know.  But there have been some downsides, most of which from my perspective have been concerning Emacs python-mode's pdbtrack.  If you use emacs and don't know what pdbtrack is, you really should.

The first problem, pdbtrack not being able to follow source files in eggs due to temporary build directories, is easily fixed.  This workaround is even easier if you share eggs between buildouts:

$ find ~/.buildout/eggs -type f -name \*.pyc -delete

Of course this still means that whenever a new egg or version is installed you have to repeat this process.  That's certainly a little annoying especially since I never actually notice it until I'm in pdb and notice I can't step into a module.  Does anyone know of a workaround for this?  Is there some sort of source-only option out there?

There was, however, still the nagging problem of eggs that are installed zipped.  Poor pdbtrack couldn't track into those, nor does the above workaround resolve the temporary build directory problem.  Fear not, there is hope.  Use that workaround then remove all zipped eggs:

$ find ~/.buildout/eggs -type f -name \*.egg -delete

 Now run your buildouts again to re-install the removed eggs and this time they'll be installed unzipped.  Finally, repeat the temporary build workaround above and now *all* your eggs should be pdbtrack compatible.