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

remove 'follow-imports = skip" from mypy config #10720

Open
danieleades opened this issue Jul 29, 2022 · 0 comments
Open

remove 'follow-imports = skip" from mypy config #10720

danieleades opened this issue Jul 29, 2022 · 0 comments
Labels
type:enhancement enhance or introduce a new feature

Comments

@danieleades
Copy link
Contributor

using follow_imports = skip is throwing away type information from imports, and therefore hiding errors. This should be changed to follow_imports = silent so as to use the type information when available, and silence any errors that result from missing annotations.

as of right now, this results in the following (currently hidden) errors-

$ mypy sphinx
sphinx/util/tags.py: note: In member "parse_compare" of class "BooleanParser":
sphinx/util/tags.py:16:5: error: Return type "Node" of "parse_compare" incompatible with return type "Expr" in supertype "Parser"  [override]
sphinx/highlighting.py:91:4: error: Unsupported operand types for >= ("Tuple[int, int, int]" and "None")  [operator]
sphinx/highlighting.py:91:4: note: Left operand is of type "Optional[Tuple[int, ...]]"
sphinx/util/rst.py:21:5: error: Module "jinja2" has no attribute "environmentfilter"  [attr-defined]
sphinx/util/rst.py:21:5: error: Name "pass_environment" already defined (possibly by an import)  [no-redef]
sphinx/util/rst.py: note: In function "heading":
sphinx/util/rst.py:56:39: error: "Environment" has no attribute "language"  [attr-defined]
sphinx/jinja2glue.py:21:5: error: Module "jinja2" has no attribute "contextfunction"  [attr-defined]
sphinx/jinja2glue.py:21:5: error: Name "pass_context" already defined (possibly by an import)  [no-redef]
sphinx/jinja2glue.py: note: In member "init" of class "BuiltinTemplateLoader":
sphinx/jinja2glue.py:191:13: error: "SandboxedEnvironment" has no attribute "install_gettext_translations"  [attr-defined]
sphinx/util/template.py: note: In member "__init__" of class "BaseRenderer":
sphinx/util/template.py:23:9: error: "SandboxedEnvironment" has no attribute "install_gettext_translations"  [attr-defined]
sphinx/testing/fixtures.py: note: In function "app_params":
sphinx/testing/fixtures.py:81:19: error: Module has no attribute "Exception"; maybe "ExceptionInfo"?  [attr-defined]
sphinx/ext/autosummary/generate.py: note: In member "__init__" of class "AutosummaryRenderer":
sphinx/ext/autosummary/generate.py:118:13: error: "SandboxedEnvironment" has no attribute "install_gettext_translations"  [attr-defined]
Found 11 errors in 7 files (checked 174 source files)
@danieleades danieleades added the type:enhancement enhance or introduce a new feature label Jul 29, 2022
@AA-Turner AA-Turner added this to the some future version milestone Sep 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:enhancement enhance or introduce a new feature
Projects
None yet
Development

No branches or pull requests

2 participants