pylint #8878 fails on a relative import [resolved]
**** module storage.formats.swap F: 26: Unable to import 'devicelibs' (No module named devicelibs)
The import line in question is:
"from ..devicelibs import swap"
Note that we have the following dir hierarchy:
storage storage/__init__.py storage/errors.py storage/<other>.py storage/devicelibs/__init__.py storage/devicelibs/<other>.py storage/formats/__init__.py storage/formats/<other>.py
Right above the failing import from devicelibs, we have:
"from ..errors import *"
pylint does sucessfully handle this, but the relative import of the devicelibs (sub)package seems to confuse it.
To get the anaconda sourcecode do the following:
git clone http://git.fedorahosted.org/git/anaconda.git <go get some coffee, it contains years of history> cd anaconda
If you want to reproduce the problem, you may need to take a few other steps to be able to run pylint successfully on the storage package:
Here is how I run pylint:
sudo pylint --init-hook='import sys; sys.path.insert(1, "isys")' --disable-msg-cat=CRW -r n storage
|closed by||<not specified>|