-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
How should I correctly lint an implicit namespace package? #1361
Comments
Interesting, thank you for reporting this issue! I thought it was solved in the master branch. Why it is not what you want, can you clarify a bit? |
I want to only lint the So if I understand correctly, implicit namespace packages are only supported by the version in the master branch and not the currently released one? |
I'm getting an error for implicit namespace packages on I'll try to work on this issue |
With
I still see the problem. The minimal example from @dalai4git shows
Is this expected to be working in the latest release? |
I also have this problem. It seems to originate from this bit in pylint/utils/utils.py:
I'm not sure what the right behavior should be. I guess if the different package levels are pylint 2.7.4 |
@bdegreve thanks for your report and your analysis. We will work on this ASAP. |
@hippo91 Great! Let me know if I can help ... |
the issue is that when running pylint org
... import-error but not when pylint . so when using . the namespace org.company is found. pylint --init-hook='import sys; sys.path.append(".")' org/ |
@sak96 Thanks! Your workaround works for me. This is suffer, do we have any plan to fix it? or can we have an option to determine if to support the implicit namespace package. |
The original example presented by @dalai4git was fixed very recently in Output of first example in OP no longer has % python -m pylint org.company.package2
************* Module org.company.package2.module
org/company/package2/module.py:2:0: C0305: Trailing newlines (trailing-newlines)
org/company/package2/module.py:1:0: C0114: Missing module docstring (missing-module-docstring)
org/company/package2/module.py:1:0: W0611: Unused Module imported from org.company.package1.module (unused-import)
------------------------------------------------------------------
Your code has been rated at 0.00/10 (previous run: 0.00/10, +0.00) I would be very grateful if those who participated in this discussion would verify if the latest To test, make sure you install Leaving this issue open for the moment to see if we need documentation improvements or test cases in |
I don't see a significant difference with #1667, so I'll close as a duplicate. |
I am trying to lint a namespace package (PEP420), but I can't get it to work without getting
import-error
. I am not sure my approach is correct, so I'd appreciate some pointers. In the example below I just want to lintorg.company.package2
.Steps to reproduce
Current behavior
Specifying the package does not work at all
Specifying the path gives me an
import-error
pylint --version output
With master version of pylint and astroid
This seems to work correctly but is not what I want
This doesn't seem to be doing anything
and this apparently crashes
The text was updated successfully, but these errors were encountered: