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 fails with *-stubs is not a valid Python package name #8229

Closed
c4f3a0ce opened this issue Jan 2, 2020 · 0 comments · Fixed by #9445
Closed

mypy fails with *-stubs is not a valid Python package name #8229

c4f3a0ce opened this issue Jan 2, 2020 · 0 comments · Fixed by #9445

Comments

@c4f3a0ce
Copy link

c4f3a0ce commented Jan 2, 2020

According to PEP 561 stub-only package:

The name of the stub package MUST follow the scheme foopkg-stubs for type stubs for the package named foopkg.

However if we invoke mypy on such package providing only path it fails with

*-stubs is not a valid Python package name

This can be reproduced on the example package:

git clone https://github.com/ethanhs/stub-package
cd stub-package
mypy ./typedpkg-stubs
typedpkg-stubs is not a valid Python package name

Invoking mypy with -p option works

mypy -p typedpkg-stubs
Success: no issues found in 2 source files

but the former behavior is rather confusing.

Expected behavior:

  • mypy should recognize *-stubs paths as roots of stub-only packages.

Tested with:

  • mypy 0.761
  • mypy-0.770+dev.9101707bd0c96624d09cb31fe573d7e25c89a35c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant