Skip to content

stubtest: don't error for a missing submodule if the submodule name is private #13417

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

Merged
merged 4 commits into from
Aug 15, 2022

Conversation

AlexWaygood
Copy link
Member

If a module name is private, the contents of that module are likely considered implementation details by the package author. Sometimes we want to include these implementation details in a stub, and sometimes we don't, but in my opinion stubtest probably shouldn't error for these submodules being missing from the stub. This is in keeping with stubtest's approach for class and module attributes, where it generally doesn't emit an error if the attribute name is private.

…rivate

If a module name is private, the contents of that module are likely considered implementation details by the package author. Sometimes we want to include these implementation details in a stub, and sometimes we don't, but in my opinion stubtest probably shouldn't error for these submodules being missing from the stub. This is in keeping with stubtest's approach for class and module attributes, where it generally doesn't emit an error if the attribute name is private.
@AlexWaygood AlexWaygood changed the title stubtest: don't error for a missing submodule if the module name is private stubtest: don't error for a missing submodule if the submodule name is private Aug 15, 2022
Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

I'd prefer doing this in test_module. Doing it here feels fragile; it feels like it would be easy to end up not checking private submodules even if the stub has them.

@AlexWaygood AlexWaygood marked this pull request as draft August 15, 2022 08:04
@AlexWaygood AlexWaygood marked this pull request as ready for review August 15, 2022 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants