[Python-projects] Fwd: Re: Pylint Installation
Tom Crawley
tcrawley at beacon-cs.com
Tue Jan 20 18:44:04 CET 2009
Hi Sylvain,
I sent this to Sylvain's email by mistake.
Thanks for your quick reply.
I have attached the pylintrc which is just a copy of the .pylintrc file which is used to configure pylint
I don't know whether you are using distutils or setuptools to construct the tar.gz archives which you distribute for astng and commons and
I don't know whether using easy_install to install the archives is correct but this may be causing the problem.
The issue relates to 'Namespace Packages'. Namespace packages are empty packages which contain other packages. Several software distributions
may use the same Namespace package. 'logilab' is the namespace package for astng and commons. See the following:
>>>>
[root at tom64 tmp]# ls -alt /usr/local/lib/python2.5/site-packages/logilab*
/usr/local/lib/python2.5/site-packages/logilab_astng-0.17.4-py2.5.egg:
total 20
drwxr-xr-x 60 root root 4096 Jan 15 15:08 ..
drwxr-xr-x 3 root root 4096 Jan 15 15:04 logilab
drwxr-xr-x 4 root root 4096 Jan 15 14:46 .
drwxr-xr-x 2 root root 4096 Jan 15 14:46 EGG-INFO
/usr/local/lib/python2.5/site-packages/logilab_common-0.37.1-py2.5.egg:
total 20
drwxr-xr-x 60 root root 4096 Jan 15 15:08 ..
drwxr-xr-x 3 root root 4096 Jan 15 15:03 logilab
drwxr-xr-x 4 root root 4096 Jan 15 14:45 .
drwxr-xr-x 3 root root 4096 Jan 15 14:45 EGG-INFO
[root at tom64 tmp]# ls -alt /usr/local/lib/python2.5/site-packages/logilab_astng-0.17.4-py2.5.egg/
total 20
drwxr-xr-x 60 root root 4096 Jan 15 15:08 ..
drwxr-xr-x 3 root root 4096 Jan 15 15:04 logilab
drwxr-xr-x 4 root root 4096 Jan 15 14:46 .
drwxr-xr-x 2 root root 4096 Jan 15 14:46 EGG-INFO
[root at tom64 tmp]# ls -alt /usr/local/lib/python2.5/site-packages/logilab_common-0.37.1-py2.5.egg/
total 20
drwxr-xr-x 60 root root 4096 Jan 15 15:08 ..
drwxr-xr-x 3 root root 4096 Jan 15 15:03 logilab
drwxr-xr-x 4 root root 4096 Jan 15 14:45 .
drwxr-xr-x 3 root root 4096 Jan 15 14:45 EGG-INFO
[root at tom64 tmp]#
<<<<
In this case there are two physical location for the logilab package. One in each egg directory.
The __init__.py file in each of the logilab packages must contain the text which I enclosed and
which I repeat here.
__import__('pkg_resources').declare_namespace(__name__)
>>>>>
[root at tom64 tmp]# cat /usr/local/lib/python2.5/site-packages/logilab_common-0.37.1-py2.5.egg/logilab/__init__.py
"""generated file, don't modify or your data will be lost"""
__import__('pkg_resources').declare_namespace(__name__)
[root at tom64 tmp]# ls -alt /usr/local/lib/python2.5/site-packages/logilab_common-0.37.1-py2.5.egg/logilab/__init__.py
-rwxr-xr-x 1 root root 117 Jan 15 15:03 /usr/local/lib/python2.5/site-packages/logilab_common-0.37.1-py2.5.egg/logilab/__init__.py
[root at tom64 tmp]# cat /usr/local/lib/python2.5/site-packages/logilab_common-0.37.1-py2.5.egg/logilab/__init__.py
"""generated file, don't modify or your data will be lost"""
__import__('pkg_resources').declare_namespace(__name__)
[root at tom64 tmp]#
<<<<<
otherwise the astng package is not found on my machine.
See: http://peak.telecommunity.com/DevCenter/setuptools#namespace-packages for more details.
If you are not using setuptools/easy_install to build your seperate installations then this may be the root of your problems as
distutils does not support namespace packages.
I will use 'easy_install pylint' in future. But I have been using easy_install to install the updates for astng and commons.
Once again, thank you for Pylint and all your efforts.
Sincerely
Tom
On Friday 16 January 2009 03:26, you wrote:
> Le Thursday 15 January 2009 21:12:41 Tom Crawley, vous avez écrit :
> > Hi,
>
> Hi,
>
> > Is the correct email address for Pylint related issues ?
>
> it is :)
>
> > I cannot get pylint to work.
> > I get the following error:
> >
> > Traceback (most recent call last):
> [snip]
> > "/usr/local/lib/python2.5/site-packages/logilab_common-0.37.1-py2.5.egg/log
> >ilab/common/configuration.py", line 700, in set_option raise
> > UnsupportedAction(action)
> > logilab.common.configuration.UnsupportedAction: callback
>
> I'll take a look at this if you can send me the pylintrc file causing this
> crash as seen in another mail.
>
> > Pylint is a great tool but it is extremely frustrating to use because of
> > installation problems etc.
>
> well, we're using debian so we've no installation problems. Have you tried
> Tarek Ziade installer, which makes pylint installable using easy_install ?
>
> > I sent an email discussing the use of namespace package etc but this seems
> > to have been ignored.
>
> huum, sorry I've probably missed it.
>
> > The line:
> >
> > __import__('pkg_resources').declare_namespace(__name__)
> >
> > must be added to the setup.py files for the logilab package __init__.py in
> > astng and commons distributions.
>
> huum, it's unclear to me why this should be added... Could you tell us more
> about what this would fix ?
>
> > Does anyone have any idea what is causing this problem ?
>
> You're talking about the pylintrc pb, right?
>
-------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pylintrc
Type: text/x-java
Size: 9055 bytes
Desc: not available
Url : http://lists.logilab.org/pipermail/python-projects/attachments/20090120/d769656a/attachment.java
More information about the Python-Projects
mailing list