-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Update fine-grained tests to prep for --namespace-packages support #11259
Conversation
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.
Thanks! Got pretty thrown off by Import of "p.a" ignored
. I just didn't realise that finegrained tests set follow_imports = error by default. Feels like there's a shortage of follow_imports=normal
tests too...
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.
Actually, maybe it's more in the spirit of the testDeletePackage5
and testDeletePackage6
to change the commands, since they are trying to pass p.a
on the command line. E.g., maybe we pass --explicit-package-bases
or switch to specifying -m
instead of files.
We still need to provide I can change them to use |
ca6185c
to
9314294
Compare
Yes, agreed on passing
since when the command is e.g. To that end, I was suggesting something like:
with the hope of changing that middle error message. It looks to me like even with that change we still ignore I might be missing something obvious though :-) |
9314294
to
a9ae7a6
Compare
I see your point! With namespace packages, |
Okay, so this is the diff I'm playing around with now. That is, I think at least some of the problem is that the test fixtures were passing in
Unfortunately, mypy now silently passes once we delete |
Ok - so I confirmed that there's a bug in mypy daemon when using Repro steps: Initial conditions:
We expect Note that if the initial conditions are
Then it is handled! It has to do with the update logic in mypy daemon. I spent several hours trying to understand update.py and fix this bug and really struggled. |
These tests were deleting package files, but not the empty directory, causing those directories to be interpreted as namespace packages in python#9636
a9ae7a6
to
202fa3f
Compare
@@ -884,52 +883,55 @@ main:2: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missin | |||
main:2: error: Cannot find implementation or library stub for module named "p" | |||
|
|||
[case testDeletePackage4] | |||
# flags: --no-namespace-packages |
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 filed #11322 to convert these in the future.
Hiya friends (@hauntsaninja)! Wanted to bump this one. |
Hiya again! (@hauntsaninja)! Wanted to bump this one. |
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.
Thanks, I think I left this dangling in the hope that I could quickly fix #11322. Clearly that hasn't happened in the last month, so merge it is :-) Thanks for pushing on this!
Also merged master into #9636 |
These tests were deleting package files, but not the empty
directory, causing those directories to be interpreted as
namespace packages in #9636
Test Plan
Tried these out on top of #9636 and confirmed they all work. A couple changed error messages - so I needed to add flags for
--namespace-packages
, but figured that's the future anyway, so this is a good thing.