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

Warn about --follow-untyped-imports #18249

Merged
merged 5 commits into from
Dec 7, 2024
Merged

Conversation

hauntsaninja
Copy link
Collaborator

No description provided.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@cdce8p
Copy link
Collaborator

cdce8p commented Dec 5, 2024

Thanks for opening this @hauntsaninja! Does it make sense to add the warning to the Missing library stubs or py.typed marker section as well?

4. To make mypy typecheck imports from modules without stubs or a py.typed
marker, you can set the :option:`--follow-untyped-imports <mypy --follow-untyped-imports>`
command line flag or set the :confval:`follow_untyped_imports` config file option to True,
either in the global section of your mypy config file, or individually on a
per-module basis.

@hauntsaninja
Copy link
Collaborator Author

Sure, added it there as well

Copy link
Collaborator

@cdce8p cdce8p left a comment

Choose a reason for hiding this comment

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

Some last suggestions

docs/source/running_mypy.rst Outdated Show resolved Hide resolved
docs/source/command_line.rst Outdated Show resolved Hide resolved
docs/source/config_file.rst Show resolved Hide resolved
docs/source/config_file.rst Outdated Show resolved Hide resolved
docs/source/command_line.rst Outdated Show resolved Hide resolved
hauntsaninja and others added 2 commits December 6, 2024 16:35
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
@hauntsaninja hauntsaninja merged commit d0ebee4 into python:master Dec 7, 2024
2 checks passed
Comment on lines +290 to +297
# mypy.ini
[mypy-untyped_package.*]
follow_untyped_imports = True

# pyproject.toml
[[tool.mypy.overrides]]
module = ["untyped_package.*"]
follow_untyped_imports = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could use sphinx_inline_tabs for that. Opened #18262 for it.

hauntsaninja added a commit that referenced this pull request Dec 17, 2024
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants