Open pylint-bot opened 9 years ago
Original comment by Adam Groszer (BitBucket: agroszer, GitHub: @agroszer?):
I guess I figured the z3c part. It is bad namespace declaration, z3c packages use a variation of
#!python
try:
# Declare this a namespace package if pkg_resources is available.
import pkg_resources
pkg_resources.declare_namespace('z3c')
except ImportError:
pass
zope packages use
# this is a namespace package
try:
import pkg_resources
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
astroid has a workaround that checks for pkgutil.extend_path
but not for pkg_resources.declare_namespace
(in modutils.py def _module_file).
That's why z3c packages are import-error despite being on PYTHONPATH
Added https://bitbucket.org/logilab/astroid/issues/243/modutils-_module_file-ignores for astroid
Originally reported by: Adam Groszer (BitBucket: agroszer, GitHub: @agroszer?)
When running
$ bin/pylint playground.form
The result is:
But when you run
bin/test
the test passes, IOW z3c packages can be imported.I created a repo to repro this:
https://github.com/agroszer/playground