-
-
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
Make mypy test suite pass mypy type-check on Windows #11895
Conversation
Excellent, CI errors in the one test I'm trying to fix. Not sure I really understand them. |
This PR isn't a good solution to this problem. I have an idea for a better solution to the problem, which would involve making changes to typeshed instead. |
I think this PR is a good idea, but we can probably simplify the type of |
Worth a shot, let's see what happens :) |
I think the only way of creating a regression test for this kind of thing would be to run the self-check on Windows as well as Linux in the CI. Is that a change worth making? |
FWIW, these are the changes to typeshed, which I think might be a better solution to this problem: python/typeshed#6812. (EDIT: These typeshed changes have now been merged, so the problem that this PR is solving will go away as soon as mypy's copy of typeshed is synced.) |
Thanks for looking into this! I'd accept a PR that runs self check on Windows. Self check is pretty fast + hopefully helps keep contributor experience good for Windows users. |
Great! I'll close this and open a new PR for that, then, as soon as typeshed is resynced :) |
As discussed in python#11895, mypy's test suite currently does not pass a mypy self-check when run on Windows. This should hopefully be fixed by python/typeshed#6812, but running a self-check on Windows as part of the CI tests should help avoid this issue in the future. This new CI test should hopefully fail until python#11905 is merged, confirming the diagnosis of the problem that I made in python#11895. Once python#11905 is merged, it should hopefully then pass, allowing this PR to be merged.
As discussed in #11895, mypy's test suite currently does not pass a mypy self-check when run on Windows. This should hopefully be fixed by python/typeshed#6812, but running a self-check on Windows as part of the CI tests should help avoid this issue in the future.
Description
Mypy's test suite fails mypy on Windows. This PR fixes that. (This is my first non-docs contribution to mypy, so let me know if I'm doing anything wrong in this PR!)
Here is the error I get if I try running the mypy test suite on my Windows machine:
This error is due to the following lines in
mypy/test/data.py
:mypy/mypy/test/data.py
Lines 38 to 41 in 2676cd8
On linux,
os.path.join
andposixpath.join
have the same signature. However, on Windows,os.path.join
is a reexport ofntpath.join
, which has a different signature toposixpath.join
due to the fact that the first parameter has a different name.Here is how
posixpath.join
is defined in typeshed:Here is how
ntpath.join
is defined in typeshed:Test plan
Not sure. Guidance on this would be appreciated.