New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing namespace packages crashes #203
Comments
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?): Please notice pylint 1.2 just got released last week. If the problem still |
Original comment by Thorsten Lockert (BitBucket: tholo, GitHub: @tholo?): Arg, I mis-stated above -- this is with pylint 1.2, with the previous minor issues seeing some false positives with setuptools 3.x (but not with 2.x). To reproduce, create some code that imports from a namespaced package, e.g. zope.deprecation or paste.script (from PasteScript), and run pylint on it. Poof. |
Original comment by Marc Rintsch (BitBucket: blackjack, GitHub: @blackjack?): marrow / marrow.mailer is another example. from marrow.mailer import Mailer, Message Leads to
|
Original comment by Jeff McGee (BitBucket: jeffamcgee, GitHub: @JeffAMcGee?): I'm running into this problem with zope.interface. Here's a small test case that crashes pylint:
|
Original comment by Francois Vanderkelen (BitBucket: sikwan, GitHub: @Sikwan?): I have the exact same issue with one of my company's project. Just found out that when I am running pylint on an empty environement (just containing pylint) and no packages from my namespace, it is running completely. Thing is all dependencies used in the project from the same namespace cannot be installed beforehand. I am not quite sure the results are relevant, since it never worked on my project ... I will check that and keep you posted. |
Original comment by Isis Lovecruft (BitBucket: isislovecruft, GitHub: @isislovecruft?): I am currently experiencing the same issue, while attempting to run For what it's worth, this is the traceback from the crash:
Disabling
which did not fix this issue either. The traceback is always on the However, downgrading to |
Original comment by Francois Vanderkelen (BitBucket: sikwan, GitHub: @Sikwan?): Tried to rollback to 1.1.0 to see what how it was going. The ImportError is indeed not there, but Pylint cannot process some imports. For example : (This is just dummy arborescence typed in, hence the missing init files )
acl.py
Where User is a class declared in user.py. (Not dynamically, just a standard class) Results in : E: 5, 0: No name 'User' in module 'user' (no-name-in-module) So I changed to relative import with a ".", same error. Tried also absolute path which results in : E: 5, 0: No name 'module' in module 'company' (no-name-in-module) Let me know if you want me to put code on Bitbucket so you can run it by yourselves. |
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?): The ImportError is due to a change in the 'import' checker, I don't think pylint/astroid import capabilities changed otherwise. @Sikwan I'm not able to reproduce your problem:
|
Original comment by Sylvain Thénault (BitBucket: sthenault, GitHub: @sthenault?): fix issue #203, we should not let ImportError propagate from the import checker |
Original comment by Francois Vanderkelen (BitBucket: sikwan, GitHub: @Sikwan?): I have to admit my example is not working anymore (I destroyed my virtualenv, so I guess the version of setuptools was different ?). I will try out the fix on my repositories and try to provide an example if this is not working ! Thanks for the fix :) |
Originally reported by: Thorsten Lockert (BitBucket: tholo, GitHub: @tholo?)
It appears that with the pylint 1.2 release one cannot check packages that import from namespace packages anymore.
In some cases previously (particularly since setuptools changed its handling of such packages recently) one would get false positives claiming packages did not exist.
However, with pylint 1.2 one now get "ImportError: No module named x" for the (first) top-level namespace package encountered.
The text was updated successfully, but these errors were encountered: