Skip to content
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

stubtest --custom-typeshed-dir broken on master and 0.980 #13654

Closed
AlexWaygood opened this issue Sep 12, 2022 · 0 comments · Fixed by #13656
Closed

stubtest --custom-typeshed-dir broken on master and 0.980 #13654

AlexWaygood opened this issue Sep 12, 2022 · 0 comments · Fixed by #13656
Labels
affects-typeshed Anything that blocks a typeshed change bug mypy got something wrong priority-0-high topic-stubtest

Comments

@AlexWaygood
Copy link
Member

Bug Report

c0372cc appears to have broken stubtest if you use it with --custom-typeshed-dir. Attempting to use stubtest with --custom-typeshed-dir pointing to a local clone of typeshed will result in the following message (or something like it):

error: not checking stubs due to failed mypy compile:
mypy: "..\typeshed\stdlib\builtins.pyi" shadows library module "builtins"
note: A user-defined top-level module with name "builtins" is not supported

Notes on the bug:

  • I haven't been able to reproduce this using "mypy core", only with stubtest.
  • The bug exists on both mypy master and mypy release-0.980.
  • The bug exists if you use a relative path or an absolute path to point to a clone of typeshed.
  • The bug exists if you use the --check-typeshed flag, as well as if you don't.
  • I bisected to c0372cc (Fix custom typeshed dir handling by is_typeshed_file() #13629)

Cc. @ilevkivskyi, @jhance, @hauntsaninja

To Reproduce

Any of the following will reproduce:

  • (venv) python -m mypy.stubtest typed_ast --custom-typeshed-dir relative/path/to/typeshed
  • (venv) python -m mypy.stubtest typed_ast --custom-typeshed-dir absolute/path/to/typeshed
  • (venv) python -m mypy.stubtest --check-typeshed --custom-typeshed-dir relative/path/to/typeshed
  • (venv) python -m mypy.stubtest --check-typeshed --custom-typeshed-dir absolute/path/to/typeshed

Expected Behavior

Stubtest with --custom-typeshed-dir would work on mypy master.

Actual Behavior

Stubtest with --custom-typeshed-dir did not work on mypy master.

Your Environment

  • Python version used: 3.10.6
  • Operating system and version: Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-typeshed Anything that blocks a typeshed change bug mypy got something wrong priority-0-high topic-stubtest
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant