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

Mypy will not automatically check files with multiple dots in their names #9833

Closed
jacksonokuhn opened this issue Dec 23, 2020 · 2 comments
Closed
Labels
bug mypy got something wrong

Comments

@jacksonokuhn
Copy link

Bug Report

Files with names of the form x.y.py don't get checked by mypy.

To Reproduce

mkdir mypy-test
touch mypy-test/a.py
touch mypy-test/a.b.py
mypy mypy-test

Expected Behavior

You'd expect mypy to check two source files with the message Success: no issues found in 2 source files

Actual Behavior

Mypy only checks one source file: Success: no issues found in 1 source file

Your Environment

  • Mypy version used: 0.790
  • Mypy command-line flags: N/A
  • Mypy configuration options from mypy.ini (and other config files): N/A
  • Python version used: 3.7.4
  • Operating system and version: Mac 10.15.7
@jacksonokuhn jacksonokuhn added the bug mypy got something wrong label Dec 23, 2020
@gvanrossum
Copy link
Member

Those are not legal Python file names anyway.

@hauntsaninja
Copy link
Collaborator

As it happens, this is no longer the behaviour on master.
This is a side effect of #9742 making mypy dir/ behave more like mypy file.py. mypy already allowed mypy a.b.py, so it works with the recursive invocation now.

Note that all versions associate the file with the incorrect module name "a.b". I tried to improve this, but it caused a couple issues and I backtracked to keep the PR surface smaller. See point 2 of #9742 (comment)

hauntsaninja pushed a commit to hauntsaninja/mypy that referenced this issue Dec 23, 2020
Note that we deal with the possibility of parent_module containing a
period in _crawl_up_helper

Brought up in python#9833
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

3 participants