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

Use error subcodes to differentiate import errors #14740

Merged
merged 3 commits into from
Aug 10, 2023

Conversation

hauntsaninja
Copy link
Collaborator

@hauntsaninja hauntsaninja commented Feb 20, 2023

Resolves #9789

Users could use --disable-error-code=import-untyped to only ignore errors about libraries not having stubs, but continue to get errors about e.g. typos in an import name.

The error subcode mechanism is new from #14570. Note that users will now get a different error code depending on whether or not a package is installed, and may not know that they can use the parent error code to ignore the issue regardless. I think this is okay, in general type checking results can change if you run them in two different environments. Note also that with --warn-unused-ignore / --strict mypy will complain about not having the most specific error code

Resolves python#9789

Users could use `--disable-error-code=import-untyped` to only ignore
errors about libraries not having stubs, but continue to get errors
about e.g. typos in an import name.

The sub error code mechanism is new. Note that users will now get a
different error code depending on whether or not a package is installed,
and may not know that they can use the parent error code to ignore the
issue regardless. I think this is okay, in general type checking results
can change if you run them in two different environments.
@github-actions

This comment has been minimized.

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

boostedblob (https://github.com/hauntsaninja/boostedblob)
- boostedblob/google_auth.py:165: error: Cannot find implementation or library stub for module named "Cryptodome.Hash"  [import]
+ boostedblob/google_auth.py:165: error: Cannot find implementation or library stub for module named "Cryptodome.Hash"  [import-not-found]
- boostedblob/google_auth.py:166: error: Cannot find implementation or library stub for module named "Cryptodome.PublicKey"  [import]
+ boostedblob/google_auth.py:166: error: Cannot find implementation or library stub for module named "Cryptodome.PublicKey"  [import-not-found]
- boostedblob/google_auth.py:167: error: Cannot find implementation or library stub for module named "Cryptodome.Signature"  [import]
+ boostedblob/google_auth.py:167: error: Cannot find implementation or library stub for module named "Cryptodome.Signature"  [import-not-found]

werkzeug (https://github.com/pallets/werkzeug)
- tests/conftest.py:9: error: Cannot find implementation or library stub for module named "ephemeral_port_reserve"  [import]
+ tests/conftest.py:9: error: Cannot find implementation or library stub for module named "ephemeral_port_reserve"  [import-not-found]

artigraph (https://github.com/artigraph/artigraph)
- src/arti/internal/dispatch.py:5: error: Cannot find implementation or library stub for module named "multimethod"  [import]
+ src/arti/internal/dispatch.py:5: error: Cannot find implementation or library stub for module named "multimethod"  [import-not-found]
- src/arti/fingerprints/__init__.py:8: error: Library stubs not installed for "farmhash"  [import]
+ src/arti/fingerprints/__init__.py:8: error: Library stubs not installed for "farmhash"  [import-untyped]

apprise (https://github.com/caronc/apprise)
- setup.py:38: error: Skipping analyzing "setuptools": module is installed, but missing library stubs or py.typed marker  [import]
+ setup.py:38: error: Skipping analyzing "setuptools": module is installed, but missing library stubs or py.typed marker  [import-untyped]
- setup.py:42: error: Library stubs not installed for "babel.messages"  [import]
+ setup.py:42: error: Library stubs not installed for "babel.messages"  [import-untyped]
- apprise/cli.py:33: error: Cannot find implementation or library stub for module named "click"  [import]
+ apprise/cli.py:33: error: Cannot find implementation or library stub for module named "click"  [import-not-found]
- apprise/plugins/NotifyWindows.py:49: error: Library stubs not installed for "win32api"  [import]
+ apprise/plugins/NotifyWindows.py:49: error: Library stubs not installed for "win32api"  [import-untyped]
- apprise/plugins/NotifyWindows.py:50: error: Library stubs not installed for "win32con"  [import]
+ apprise/plugins/NotifyWindows.py:50: error: Library stubs not installed for "win32con"  [import-untyped]
- apprise/plugins/NotifyWindows.py:51: error: Library stubs not installed for "win32gui"  [import]
+ apprise/plugins/NotifyWindows.py:51: error: Library stubs not installed for "win32gui"  [import-untyped]
- apprise/plugins/NotifyMQTT.py:57: error: Library stubs not installed for "paho.mqtt.client"  [import]
+ apprise/plugins/NotifyMQTT.py:57: error: Library stubs not installed for "paho.mqtt.client"  [import-untyped]
- apprise/plugins/NotifyMQTT.py:57: error: Library stubs not installed for "paho.mqtt"  [import]
+ apprise/plugins/NotifyMQTT.py:57: error: Library stubs not installed for "paho.mqtt"  [import-untyped]
- apprise/plugins/NotifyMQTT.py:57: error: Cannot find implementation or library stub for module named "paho"  [import]
+ apprise/plugins/NotifyMQTT.py:57: error: Cannot find implementation or library stub for module named "paho"  [import-not-found]
- apprise/plugins/NotifyGrowl.py:44: error: Cannot find implementation or library stub for module named "gntp.notifier"  [import]
+ apprise/plugins/NotifyGrowl.py:44: error: Cannot find implementation or library stub for module named "gntp.notifier"  [import-not-found]
- apprise/plugins/NotifyGrowl.py:44: error: Cannot find implementation or library stub for module named "gntp"  [import]
+ apprise/plugins/NotifyGrowl.py:44: error: Cannot find implementation or library stub for module named "gntp"  [import-not-found]
- apprise/plugins/NotifyGnome.py:47: error: Cannot find implementation or library stub for module named "gi"  [import]
+ apprise/plugins/NotifyGnome.py:47: error: Cannot find implementation or library stub for module named "gi"  [import-not-found]
- apprise/plugins/NotifyGnome.py:53: error: Cannot find implementation or library stub for module named "gi.repository"  [import]
+ apprise/plugins/NotifyGnome.py:53: error: Cannot find implementation or library stub for module named "gi.repository"  [import-not-found]
- apprise/plugins/NotifyDBus.py:56: error: Cannot find implementation or library stub for module named "dbus"  [import]
+ apprise/plugins/NotifyDBus.py:56: error: Cannot find implementation or library stub for module named "dbus"  [import-not-found]
- apprise/plugins/NotifyDBus.py:68: error: Cannot find implementation or library stub for module named "dbus.mainloop.glib"  [import]
+ apprise/plugins/NotifyDBus.py:68: error: Cannot find implementation or library stub for module named "dbus.mainloop.glib"  [import-not-found]
- apprise/plugins/NotifyDBus.py:77: error: Cannot find implementation or library stub for module named "dbus.mainloop.qt"  [import]
+ apprise/plugins/NotifyDBus.py:77: error: Cannot find implementation or library stub for module named "dbus.mainloop.qt"  [import-not-found]
- apprise/plugins/NotifyDBus.py:97: error: Cannot find implementation or library stub for module named "gi"  [import]
+ apprise/plugins/NotifyDBus.py:97: error: Cannot find implementation or library stub for module named "gi"  [import-not-found]
- apprise/plugins/NotifyDBus.py:99: error: Cannot find implementation or library stub for module named "gi.repository"  [import]
+ apprise/plugins/NotifyDBus.py:99: error: Cannot find implementation or library stub for module named "gi.repository"  [import-not-found]
- test/test_cli.py:46: error: Cannot find implementation or library stub for module named "click.testing"  [import]
+ test/test_cli.py:46: error: Cannot find implementation or library stub for module named "click.testing"  [import-not-found]
- apprise/plugins/NotifyTwitter.py:39: error: Cannot find implementation or library stub for module named "requests_oauthlib"  [import]
+ apprise/plugins/NotifyTwitter.py:39: error: Cannot find implementation or library stub for module named "requests_oauthlib"  [import-not-found]
- apprise/plugins/NotifyBoxcar.py:41: error: Cannot find implementation or library stub for module named "urlparse"  [import]
+ apprise/plugins/NotifyBoxcar.py:41: error: Cannot find implementation or library stub for module named "urlparse"  [import-not-found]
- test/test_plugin_growl.py:42: error: Cannot find implementation or library stub for module named "gntp"  [import]
+ test/test_plugin_growl.py:42: error: Cannot find implementation or library stub for module named "gntp"  [import-not-found]
- test/test_plugin_glib.py:55: error: Cannot find implementation or library stub for module named "dbus"  [import]
+ test/test_plugin_glib.py:55: error: Cannot find implementation or library stub for module named "dbus"  [import-not-found]

dulwich (https://github.com/dulwich/dulwich)
- dulwich/contrib/requests_vendor.py:34: error: Library stubs not installed for "requests"  [import]
+ dulwich/contrib/requests_vendor.py:34: error: Library stubs not installed for "requests"  [import-untyped]

poetry (https://github.com/python-poetry/poetry)
- src/poetry/vcs/git/system.py:8: error: Cannot find implementation or library stub for module named "dulwich.client"  [import]
+ src/poetry/vcs/git/system.py:8: error: Cannot find implementation or library stub for module named "dulwich.client"  [import-not-found]
- src/poetry/utils/setup_reader.py:9: error: Cannot find implementation or library stub for module named "poetry.core.constraints.version"  [import]
+ src/poetry/utils/setup_reader.py:9: error: Cannot find implementation or library stub for module named "poetry.core.constraints.version"  [import-not-found]
- src/poetry/utils/extras.py:11: error: Cannot find implementation or library stub for module named "packaging.utils"  [import]
+ src/poetry/utils/extras.py:11: error: Cannot find implementation or library stub for module named "packaging.utils"  [import-not-found]
- src/poetry/utils/extras.py:12: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import]
+ src/poetry/utils/extras.py:12: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import-not-found]
- src/poetry/utils/_compat.py:13: error: Cannot find implementation or library stub for module named "tomli"  [import]
+ src/poetry/utils/_compat.py:13: error: Cannot find implementation or library stub for module named "tomli"  [import-not-found]
- src/poetry/repositories/abstract_repository.py:9: error: Cannot find implementation or library stub for module named "poetry.core.constraints.version"  [import]
+ src/poetry/repositories/abstract_repository.py:9: error: Cannot find implementation or library stub for module named "poetry.core.constraints.version"  [import-not-found]
- src/poetry/repositories/abstract_repository.py:10: error: Cannot find implementation or library stub for module named "poetry.core.packages.dependency"  [import]
+ src/poetry/repositories/abstract_repository.py:10: error: Cannot find implementation or library stub for module named "poetry.core.packages.dependency"  [import-not-found]
- src/poetry/repositories/abstract_repository.py:11: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import]
+ src/poetry/repositories/abstract_repository.py:11: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import-not-found]
- src/poetry/packages/dependency_package.py:7: error: Cannot find implementation or library stub for module named "poetry.core.packages.dependency"  [import]
+ src/poetry/packages/dependency_package.py:7: error: Cannot find implementation or library stub for module named "poetry.core.packages.dependency"  [import-not-found]
- src/poetry/packages/dependency_package.py:8: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import]
+ src/poetry/packages/dependency_package.py:8: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import-not-found]
- src/poetry/mixology/result.py:7: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import]
+ src/poetry/mixology/result.py:7: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import-not-found]
- src/poetry/mixology/result.py:8: error: Cannot find implementation or library stub for module named "poetry.core.packages.project_package"  [import]
+ src/poetry/mixology/result.py:8: error: Cannot find implementation or library stub for module named "poetry.core.packages.project_package"  [import-not-found]
- src/poetry/masonry/api.py:3: error: Cannot find implementation or library stub for module named "poetry.core.masonry.api"  [import]
+ src/poetry/masonry/api.py:3: error: Cannot find implementation or library stub for module named "poetry.core.masonry.api"  [import-not-found]
- src/poetry/layouts/layout.py:7: error: Cannot find implementation or library stub for module named "packaging.utils"  [import]
+ src/poetry/layouts/layout.py:7: error: Cannot find implementation or library stub for module named "packaging.utils"  [import-not-found]
- src/poetry/layouts/layout.py:8: error: Cannot find implementation or library stub for module named "poetry.core.pyproject.toml"  [import]
+ src/poetry/layouts/layout.py:8: error: Cannot find implementation or library stub for module named "poetry.core.pyproject.toml"  [import-not-found]
- src/poetry/layouts/layout.py:9: error: Cannot find implementation or library stub for module named "poetry.core.utils.helpers"  [import]
+ src/poetry/layouts/layout.py:9: error: Cannot find implementation or library stub for module named "poetry.core.utils.helpers"  [import-not-found]
- src/poetry/layouts/layout.py:10: error: Cannot find implementation or library stub for module named "tomlkit"  [import]
+ src/poetry/layouts/layout.py:10: error: Cannot find implementation or library stub for module named "tomlkit"  [import-not-found]
- src/poetry/layouts/layout.py:13: error: Cannot find implementation or library stub for module named "tomlkit.toml_document"  [import]
+ src/poetry/layouts/layout.py:13: error: Cannot find implementation or library stub for module named "tomlkit.toml_document"  [import-not-found]
- src/poetry/layouts/layout.py:19: error: Cannot find implementation or library stub for module named "tomlkit.items"  [import]
+ src/poetry/layouts/layout.py:19: error: Cannot find implementation or library stub for module named "tomlkit.items"  [import-not-found]
- src/poetry/installation/base_installer.py:7: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import]
+ src/poetry/installation/base_installer.py:7: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import-not-found]
- src/poetry/installation/operations/operation.py:8: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import]
+ src/poetry/installation/operations/operation.py:8: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import-not-found]
- src/poetry/console/exceptions.py:3: error: Cannot find implementation or library stub for module named "cleo.exceptions"  [import]
+ src/poetry/console/exceptions.py:3: error: Cannot find implementation or library stub for module named "cleo.exceptions"  [import-not-found]
- src/poetry/console/command_loader.py:5: error: Cannot find implementation or library stub for module named "cleo.exceptions"  [import]
+ src/poetry/console/command_loader.py:5: error: Cannot find implementation or library stub for module named "cleo.exceptions"  [import-not-found]
- src/poetry/console/command_loader.py:6: error: Cannot find implementation or library stub for module named "cleo.loaders.factory_command_loader"  [import]
+ src/poetry/console/command_loader.py:6: error: Cannot find implementation or library stub for module named "cleo.loaders.factory_command_loader"  [import-not-found]
- src/poetry/console/command_loader.py:12: error: Cannot find implementation or library stub for module named "cleo.commands.command"  [import]
+ src/poetry/console/command_loader.py:12: error: Cannot find implementation or library stub for module named "cleo.commands.command"  [import-not-found]
- src/poetry/console/io/inputs/run_argv_input.py:5: error: Cannot find implementation or library stub for module named "cleo.io.inputs.argv_input"  [import]
+ src/poetry/console/io/inputs/run_argv_input.py:5: error: Cannot find implementation or library stub for module named "cleo.io.inputs.argv_input"  [import-not-found]
- src/poetry/console/io/inputs/run_argv_input.py:9: error: Cannot find implementation or library stub for module named "cleo.io.inputs.definition"  [import]
+ src/poetry/console/io/inputs/run_argv_input.py:9: error: Cannot find implementation or library stub for module named "cleo.io.inputs.definition"  [import-not-found]
- src/poetry/locations.py:9: error: Cannot find implementation or library stub for module named "platformdirs"  [import]
+ src/poetry/locations.py:9: error: Cannot find implementation or library stub for module named "platformdirs"  [import-not-found]
- src/poetry/utils/source.py:7: error: Cannot find implementation or library stub for module named "tomlkit.items"  [import]
+ src/poetry/utils/source.py:7: error: Cannot find implementation or library stub for module named "tomlkit.items"  [import-not-found]
- src/poetry/utils/source.py:13: error: Cannot find implementation or library stub for module named "tomlkit"  [import]
+ src/poetry/utils/source.py:13: error: Cannot find implementation or library stub for module named "tomlkit"  [import-not-found]
- src/poetry/repositories/repository.py:7: error: Cannot find implementation or library stub for module named "packaging.utils"  [import]
+ src/poetry/repositories/repository.py:7: error: Cannot find implementation or library stub for module named "packaging.utils"  [import-not-found]
- src/poetry/repositories/repository.py:8: error: Cannot find implementation or library stub for module named "poetry.core.constraints.version"  [import]
+ src/poetry/repositories/repository.py:8: error: Cannot find implementation or library stub for module named "poetry.core.constraints.version"  [import-not-found]
- src/poetry/repositories/repository.py:17: error: Cannot find implementation or library stub for module named "poetry.core.packages.dependency"  [import]
+ src/poetry/repositories/repository.py:17: error: Cannot find implementation or library stub for module named "poetry.core.packages.dependency"  [import-not-found]
- src/poetry/repositories/repository.py:18: error: Cannot find implementation or library stub for module named "poetry.core.packages.package"  [import]

... (truncated 595 lines) ...

twine (https://github.com/pypa/twine)
- twine/wininst.py:6: error: Cannot find implementation or library stub for module named "pkginfo"  [import]
+ twine/wininst.py:6: error: Cannot find implementation or library stub for module named "pkginfo"  [import-not-found]
- twine/wheel.py:20: error: Cannot find implementation or library stub for module named "pkginfo"  [import]
+ twine/wheel.py:20: error: Cannot find implementation or library stub for module named "pkginfo"  [import-not-found]
- twine/cli.py:19: error: Cannot find implementation or library stub for module named "rich"  [import]
+ twine/cli.py:19: error: Cannot find implementation or library stub for module named "rich"  [import-not-found]
- twine/cli.py:20: error: Cannot find implementation or library stub for module named "rich.highlighter"  [import]
+ twine/cli.py:20: error: Cannot find implementation or library stub for module named "rich.highlighter"  [import-not-found]
- twine/cli.py:21: error: Cannot find implementation or library stub for module named "rich.logging"  [import]
+ twine/cli.py:21: error: Cannot find implementation or library stub for module named "rich.logging"  [import-not-found]
- twine/cli.py:22: error: Cannot find implementation or library stub for module named "rich.theme"  [import]
+ twine/cli.py:22: error: Cannot find implementation or library stub for module named "rich.theme"  [import-not-found]
- twine/package.py:23: error: Cannot find implementation or library stub for module named "pkginfo"  [import]
+ twine/package.py:23: error: Cannot find implementation or library stub for module named "pkginfo"  [import-not-found]
- twine/package.py:24: error: Cannot find implementation or library stub for module named "rich"  [import]
+ twine/package.py:24: error: Cannot find implementation or library stub for module named "rich"  [import-not-found]
- twine/repository.py:19: error: Cannot find implementation or library stub for module named "rich.progress"  [import]
+ twine/repository.py:19: error: Cannot find implementation or library stub for module named "rich.progress"  [import-not-found]
- twine/repository.py:19: error: Cannot find implementation or library stub for module named "rich"  [import]
+ twine/repository.py:19: error: Cannot find implementation or library stub for module named "rich"  [import-not-found]
- twine/commands/check.py:22: error: Cannot find implementation or library stub for module named "readme_renderer.rst"  [import]
+ twine/commands/check.py:22: error: Cannot find implementation or library stub for module named "readme_renderer.rst"  [import-not-found]
- twine/commands/check.py:22: error: Cannot find implementation or library stub for module named "readme_renderer"  [import]
+ twine/commands/check.py:22: error: Cannot find implementation or library stub for module named "readme_renderer"  [import-not-found]
- twine/commands/check.py:23: error: Cannot find implementation or library stub for module named "rich"  [import]
+ twine/commands/check.py:23: error: Cannot find implementation or library stub for module named "rich"  [import-not-found]
- twine/commands/upload.py:21: error: Cannot find implementation or library stub for module named "rich"  [import]
+ twine/commands/upload.py:21: error: Cannot find implementation or library stub for module named "rich"  [import-not-found]
- twine/commands/register.py:19: error: Cannot find implementation or library stub for module named "rich"  [import]
+ twine/commands/register.py:19: error: Cannot find implementation or library stub for module named "rich"  [import-not-found]

pwndbg (https://github.com/pwndbg/pwndbg)
- pwndbg/color/lexer.py:1: error: Library stubs not installed for "pygments.lexer"  [import]
+ pwndbg/color/lexer.py:1: error: Library stubs not installed for "pygments.lexer"  [import-untyped]
- pwndbg/color/lexer.py:3: error: Library stubs not installed for "pygments.token"  [import]
+ pwndbg/color/lexer.py:3: error: Library stubs not installed for "pygments.token"  [import-untyped]
- pwndbg/gdblib/qemu.py:10: error: Library stubs not installed for "psutil"  [import]
+ pwndbg/gdblib/qemu.py:10: error: Library stubs not installed for "psutil"  [import-untyped]
- pwndbg/color/syntax_highlight.py:6: error: Library stubs not installed for "pygments"  [import]
+ pwndbg/color/syntax_highlight.py:6: error: Library stubs not installed for "pygments"  [import-untyped]
- pwndbg/color/syntax_highlight.py:7: error: Library stubs not installed for "pygments.formatters"  [import]
+ pwndbg/color/syntax_highlight.py:7: error: Library stubs not installed for "pygments.formatters"  [import-untyped]
- pwndbg/color/syntax_highlight.py:8: error: Library stubs not installed for "pygments.lexers"  [import]
+ pwndbg/color/syntax_highlight.py:8: error: Library stubs not installed for "pygments.lexers"  [import-untyped]
- pwndbg/commands/slab.py:8: error: Library stubs not installed for "tabulate"  [import]
+ pwndbg/commands/slab.py:8: error: Library stubs not installed for "tabulate"  [import-untyped]
- pwndbg/commands/misc.py:95: error: Library stubs not installed for "tabulate"  [import]
+ pwndbg/commands/misc.py:95: error: Library stubs not installed for "tabulate"  [import-untyped]

imagehash (https://github.com/JohannesBuchner/imagehash)
- imagehash/__init__.py:272: error: Cannot find implementation or library stub for module named "scipy.fftpack"  [import]
+ imagehash/__init__.py:272: error: Cannot find implementation or library stub for module named "scipy.fftpack"  [import-not-found]
- imagehash/__init__.py:272: error: Cannot find implementation or library stub for module named "scipy"  [import]
+ imagehash/__init__.py:272: error: Cannot find implementation or library stub for module named "scipy"  [import-not-found]
- imagehash/__init__.py:360: error: Cannot find implementation or library stub for module named "pywt"  [import]
+ imagehash/__init__.py:360: error: Cannot find implementation or library stub for module named "pywt"  [import-not-found]

Auto-Split (https://github.com/Avasam/Auto-Split)
- src/utils.py:15: error: Cannot find implementation or library stub for module named "winsdk.windows.ai.machinelearning"  [import]
+ src/utils.py:15: error: Cannot find implementation or library stub for module named "winsdk.windows.ai.machinelearning"  [import-not-found]
- src/utils.py:16: error: Cannot find implementation or library stub for module named "winsdk.windows.media.capture"  [import]
+ src/utils.py:16: error: Cannot find implementation or library stub for module named "winsdk.windows.media.capture"  [import-not-found]
- src/utils.py:18: error: Cannot find implementation or library stub for module named "gen.build_vars"  [import]
+ src/utils.py:18: error: Cannot find implementation or library stub for module named "gen.build_vars"  [import-not-found]
- src/region_selection.py:15: error: Cannot find implementation or library stub for module named "winsdk._winrt"  [import]
+ src/region_selection.py:15: error: Cannot find implementation or library stub for module named "winsdk._winrt"  [import-not-found]
- src/region_selection.py:16: error: Cannot find implementation or library stub for module named "winsdk.windows.foundation"  [import]
+ src/region_selection.py:16: error: Cannot find implementation or library stub for module named "winsdk.windows.foundation"  [import-not-found]
- src/region_selection.py:17: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics.capture"  [import]
+ src/region_selection.py:17: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics.capture"  [import-not-found]
- src/capture_method/WindowsGraphicsCaptureMethod.py:9: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics"  [import]
+ src/capture_method/WindowsGraphicsCaptureMethod.py:9: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics"  [import-not-found]
- src/capture_method/WindowsGraphicsCaptureMethod.py:10: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics.capture"  [import]
+ src/capture_method/WindowsGraphicsCaptureMethod.py:10: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics.capture"  [import-not-found]
- src/capture_method/WindowsGraphicsCaptureMethod.py:11: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics.capture.interop"  [import]
+ src/capture_method/WindowsGraphicsCaptureMethod.py:11: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics.capture.interop"  [import-not-found]
- src/capture_method/WindowsGraphicsCaptureMethod.py:12: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics.directx"  [import]
+ src/capture_method/WindowsGraphicsCaptureMethod.py:12: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics.directx"  [import-not-found]
- src/capture_method/WindowsGraphicsCaptureMethod.py:13: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics.imaging"  [import]
+ src/capture_method/WindowsGraphicsCaptureMethod.py:13: error: Cannot find implementation or library stub for module named "winsdk.windows.graphics.imaging"  [import-not-found]
- src/capture_method/VideoCaptureDeviceCaptureMethod.py:7: error: Cannot find implementation or library stub for module named "pygrabber"  [import]
+ src/capture_method/VideoCaptureDeviceCaptureMethod.py:7: error: Cannot find implementation or library stub for module named "pygrabber"  [import-not-found]
- src/capture_method/__init__.py:9: error: Cannot find implementation or library stub for module named "pygrabber.dshow_graph"  [import]
+ src/capture_method/__init__.py:9: error: Cannot find implementation or library stub for module named "pygrabber.dshow_graph"  [import-not-found]
- src/user_profile.py:11: error: Cannot find implementation or library stub for module named "gen"  [import]
+ src/user_profile.py:11: error: Cannot find implementation or library stub for module named "gen"  [import-not-found]
- src/menu_bar.py:17: error: Cannot find implementation or library stub for module named "gen"  [import]
+ src/menu_bar.py:17: error: Cannot find implementation or library stub for module named "gen"  [import-not-found]
- src/AutoSplit.py:24: error: Cannot find implementation or library stub for module named "gen"  [import]
+ src/AutoSplit.py:24: error: Cannot find implementation or library stub for module named "gen"  [import-not-found]

porcupine (https://github.com/Akuli/porcupine)
- porcupine/plugins/run/windows_run.py:10: error: Library stubs not installed for "colorama"  [import]
+ porcupine/plugins/run/windows_run.py:10: error: Library stubs not installed for "colorama"  [import-untyped]
- porcupine/utils.py:37: error: Cannot find implementation or library stub for module named "dacite"  [import]
+ porcupine/utils.py:37: error: Cannot find implementation or library stub for module named "dacite"  [import-not-found]
- porcupine/__init__.py:12: error: Library stubs not installed for "appdirs"  [import]
+ porcupine/__init__.py:12: error: Library stubs not installed for "appdirs"  [import-untyped]
- porcupine/settings.py:19: error: Cannot find implementation or library stub for module named "dacite"  [import]
+ porcupine/settings.py:19: error: Cannot find implementation or library stub for module named "dacite"  [import-not-found]
- porcupine/settings.py:20: error: Library stubs not installed for "pygments"  [import]
+ porcupine/settings.py:20: error: Library stubs not installed for "pygments"  [import-untyped]
- porcupine/textutils.py:12: error: Library stubs not installed for "pygments"  [import]
+ porcupine/textutils.py:12: error: Library stubs not installed for "pygments"  [import-untyped]
- porcupine/tabs.py:18: error: Library stubs not installed for "pygments.lexer"  [import]
+ porcupine/tabs.py:18: error: Library stubs not installed for "pygments.lexer"  [import-untyped]
- porcupine/tabs.py:19: error: Library stubs not installed for "pygments.lexers"  [import]
+ porcupine/tabs.py:19: error: Library stubs not installed for "pygments.lexers"  [import-untyped]
- porcupine/plugins/longlinemarker.py:8: error: Library stubs not installed for "pygments"  [import]

... (truncated 1136 lines) ...```

Copy link
Collaborator

@97littleleaf11 97littleleaf11 left a comment

Choose a reason for hiding this comment

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

Any test case for import-untyped?

@Avasam
Copy link
Sponsor Contributor

Avasam commented Jun 14, 2023

Tangentially related, this makes me notice extracting only import errors is a good way to look for missing type dependencies in mypy_primer.

@hauntsaninja hauntsaninja merged commit 78339b9 into python:master Aug 10, 2023
@hauntsaninja hauntsaninja deleted the import-code branch August 10, 2023 08:50
hauntsaninja added a commit that referenced this pull request Aug 10, 2023
See #14740

My PR was pretty old and predates the nice check to ensure error codes
are documented.
hauntsaninja added a commit that referenced this pull request Sep 2, 2023
JukkaL pushed a commit that referenced this pull request Oct 10, 2023
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.

Add flag to ignore 'Skipping analyzing ...'
3 participants