[Python-projects] setuptools patches for common, astng and pylint
Alexandre Fayolle
alexandre.fayolle at logilab.fr
Tue Aug 22 07:39:21 CEST 2006
On Tue, Aug 22, 2006 at 03:42:05AM +0200, Victor Stinner wrote:
> Le mardi 22 août 2006 02:55, Victor Stinner a écrit :
> > Hi,
> >
> > I wrote patched for logilab.common, logilab.astng, logilab.pylint for make
> > them use setuptools in setup.py.
>
> Oooops, I was so happy to see setup.py bdist_egg working, that I
> forget to try
> to run pylint... And it doesn't work :-(
Typical packaging test that one forgets and bites back... :-)
>
> File "(...)/astng-0.16.0-py2.4.egg/logilab/astng/__init__.py", line 51, in ?
> from logilab.common.compat import chain, imap
> ImportError: No module named common.compat
>
> There is a problem with "logilab." module prefix: astng needs
> logilab.common.compat, but because of egg system (or something else?) python
> is unable to locate this module.
The problem is probably related to the shared logilab package : common
and astng both install in the same logilab directory with a shared
(empty) __init__.py. My understanding of eggs is that each egg is
installed in a separate directory which is somehow added to sys.path,
and this does not work here because from inside logilab.astng, the
logilab package is different from the one in logilab.common.
If there is no way of working around that directly in distutils, you
will have to patch logilab/__init__.py to look into the other eggs
and check if there are other parts of the package lying around. This
should be doable by updating the __path__ variable in
logilab/__init__.py [1]. Module pkgutil from the standard library may be
of help.
[1] http://www.python.org/doc/essays/packages.html
--
Alexandre Fayolle LOGILAB, Paris (France)
Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations
Développement logiciel sur mesure: http://www.logilab.fr/services
Informatique scientifique: http://www.logilab.fr/science
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 481 bytes
Desc: Digital signature
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20060822/eb9e2f18/attachment.pgp
More information about the Python-Projects
mailing list