[Distutils] Buildout + namespace packages + Django management commands?

Kyle MacFarlane kylemacfarlane at gmail.com
Sun Sep 20 16:45:36 CEST 2009


2009/9/20 Kyle MacFarlane <kylemacfarlane at gmail.com>

> 2009/9/19 P.J. Eby <pje at telecommunity.com>
> > If they use the package's __path__ attribute, they'll find its contents,
> whether someone is using pkgutil.extend_path, .pth files, or setuptools.
>  They don't have to support setuptools to support namespace packages, just
> pay attention to the __path__ variable that's part of standard Python.
>
> I was hoping more if anybody knew a recipe to get round my problem but
> I had a look inside Django to see how it looks through packages.
>
> The problem is caused by line 58 at this link raising an ImportError:
>
> http://code.djangoproject.com/browser/django/trunk/django/core/management/__init__.py
>
> It doesn't matter what order find_module is called on various paths,
> it still relies entirely on the order in sys.path. Calling find_module
> on second_app before first_app will still fail if first_app is the
> first app on sys.path (which suggests that something has been done
> wrong even before line 58 or find_module itself doesn't support
> namespaces?).
>
> Unfortunately I've never dealt with the imp module before. What would
> I need to do? Import the package (which is actually "path" in this
> code), get __path__ from it and then do find_module again but with
> __path__ instead?
>

I've almost got to the bottom of this by using collective.recipe.omelette
and by putting the following in buildout.cfg:

[easy_install]
zip_ok = 0

But I have one (I hope) remaining problem. When buildout is run the first
thing it does is install zc.buildout and setuptools and totally ignores any
custom settings when doing so. How can I have setuptools install without
being zipped? I've tried "unzip = true" in buildout.cfg but that is ignored
too.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/distutils-sig/attachments/20090920/0d718530/attachment.htm>


More information about the Distutils-SIG mailing list