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

Recognize -stubs directories as valid package directories #9445

Merged
merged 2 commits into from Sep 16, 2020

Conversation

bryanforbes
Copy link
Contributor

Description

Currently, running mypy typedpkg-stubs (or any sub-file contained in the directory) in a project similar to https://github.com/ethanhs/stub-package results in an error:

mypy ./typedpkg-stubs
typedpkg-stubs is not a valid Python package name

This PR allows directories prefixed with -stubs which also contains a valid identifier before the - to be type checked.

Fixes #8229

Copy link
Member

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I have one style nit. Otherwise looks good.

mypy/find_sources.py Outdated Show resolved Hide resolved
Co-authored-by: Guido van Rossum <guido@python.org>
@gvanrossum gvanrossum merged commit b707d29 into python:master Sep 16, 2020
@bryanforbes
Copy link
Contributor Author

Is there any way this can be included in 0.790?

@gvanrossum
Copy link
Member

I very much doubt it -- according to #9290, the release branch was cut quite a while ago, and cherry-picking must be minimized so as not to invalidate the extensive testing that has already been applied to the release branch.

@bryanforbes
Copy link
Contributor Author

@gvanrossum makes sense. Thanks!

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 this pull request may close these issues.

mypy fails with *-stubs is not a valid Python package name
2 participants