Posts Tagged ‘setuptools’

Patch for hg.setuptools to play nice in a virtualenv

Monday, January 7th, 2008

I am using Mercurial to manage the source for some of my newer projects, and hg.setuptools caught my attention as something that would be very useful. I'm used to having the same functionality using Subversion, that is to say, I'm used to setuptools figuring out what files it should include with a distribution based on whether or not they're in the repository.

I use virtualenv to manage my development environments, and I found that when using hg.setuptools 0.2 out of the box, I'd get errors such as the following:

  File "/var/lib/python-support/python2.5/mercurial/demandimport.py", line 70, in __call__
    raise TypeError("'unloaded module' object is not callable")
TypeError: 'unloaded module' object is not callable

I ran across a note that mentioned disabling demandimport, so that is what I did with hg.setuptools. I uploaded a patch that made it work for me. If you're having the same problem, I hope it works for you too!