-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Silence modules in site-packages and typeshed #5303
Changes from 6 commits
2525e12
611232e
a59a635
645fd6d
c5b3697
2fca7a8
644ab2a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -751,15 +751,16 @@ main:1: note: (Perhaps setting MYPYPATH or using the "--ignore-missing-imports" | |
main:2: error: Incompatible types in assignment (expression has type "int", variable has type "str") | ||
|
||
[case testAddFileWhichImportsLibModuleWithErrors] | ||
# flags: --no-silence-site-packages | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this necessary here? Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since opening this, I also implemented silencing typeshed, which |
||
import a | ||
a.x = 0 | ||
[file a.py.2] | ||
import broken | ||
x = broken.x | ||
z | ||
[out] | ||
main:1: error: Cannot find module named 'a' | ||
main:1: note: (Perhaps setting MYPYPATH or using the "--ignore-missing-imports" flag would help) | ||
main:2: error: Cannot find module named 'a' | ||
main:2: note: (Perhaps setting MYPYPATH or using the "--ignore-missing-imports" flag would help) | ||
== | ||
a.py:3: error: Name 'z' is not defined | ||
<ROOT>/test-data/unit/lib-stub/broken.pyi:2: error: Name 'y' is not defined | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the general algorithm here? As I understand we essentially only need something like
is_sub_path(p1, p2)
. Not that I think it is important, but maybe it will allow to simplify code?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was originally hoping to eventually use
os.path.commonpath
once we drop support for 3.4, but I think you are right it would be better to do this ourselves. I will change this when I have time later.