-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implicit namespace packages (PEP420) cause import-error #4057
Comments
I second this one. I set up a simple repo to reproduce the issue:
Somehow it works for me in another repo, but I haven't investigated it further yet. |
At first I thought the issue was related to |
Is the package properly installed? Taken at face value, the top namespace would have to be
Then install with:
Then:
|
I have a similar issue, except it's my namespace package as a whole which fails on new Pylint versions (any >2.4.4). My rcfile has an edited init hook of I couldn't get modern versions to work, and I followed this issue due to the timing of it (it appeared recently with the same subject and was still open). I believe this issue is pointing at a behavior change between Pylint versions, which has been frequent with namespace packages. The way to move forward may be correcting the namespace, something I was unable to do as AFAICT, my namespace was perfect. This issue's does seem incorrect when reading through your comment though. If the actual namespace is incorrect, I'd be curious to know how previous versions responded. I may be best off creating a new issue though. |
@csymeonides-mf thanks for your report. From @bdegreve investigations (thanks by the way :+1) it seems that this is not a pylint bug. |
Is this fixed in the preview release? No
Steps to reproduce
I'm experiencing the same issue as #842.
Trying to use PEP420 Implicit Namespace Packages (i.e. without an
__init__.py
in the top-level package directory). My tree looks like this:and
foo.py
contains:Current behavior
Running
pylint src
works fine, butpylint src/my_namespace/my_package/foo.py
returns animport-error
which is a false positive.Expected behavior
No
import-error
pylint --version output
The text was updated successfully, but these errors were encountered: