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

Suggest additional types-* packages from typeshed #13698

Merged
merged 8 commits into from Sep 21, 2022
Merged

Conversation

JukkaL
Copy link
Collaborator

@JukkaL JukkaL commented Sep 20, 2022

Now we have suggestions for almost all the currently available third-party packages in typeshed that don't have a release that includes PEP 561 type information. sqlalchemy is not included, since it has a few alternatives (some outside typeshed), and I don't know which we should suggest.

These stubs were never bundled with mypy, so --ignore-missing-imports works with these, unlike the existing packages for which we have suggestions.

Here's an example mypy output:

t.py:1: error: Library stubs not installed for "tree_sitter"
t.py:1: note: Hint: "python3 -m pip install types-tree-sitter"
t.py:1: note: (or run "mypy --install-types" to install all missing stub packages)
t.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports

I manually tested that --install-types works for these.

@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:

rclip (https://github.com/yurijmikhalevich/rclip)
- rclip/model.py:6: error: Cannot find implementation or library stub for module named "PIL"
+ rclip/model.py:6: error: Library stubs not installed for "PIL"
- rclip/utils.py:4: error: Cannot find implementation or library stub for module named "PIL"
+ rclip/utils.py:4: error: Library stubs not installed for "PIL"
- rclip/utils.py:6: note: (or run "mypy --install-types" to install all missing stub packages)
- rclip/main.py:8: error: Cannot find implementation or library stub for module named "tqdm"
- rclip/main.py:9: error: Cannot find implementation or library stub for module named "PIL"
+ rclip/main.py:8: error: Library stubs not installed for "tqdm"
+ rclip/main.py:8: note: Hint: "python3 -m pip install types-tqdm"
+ rclip/main.py:8: note: (or run "mypy --install-types" to install all missing stub packages)
+ rclip/main.py:9: error: Library stubs not installed for "PIL"
+ rclip/main.py:9: note: Hint: "python3 -m pip install types-Pillow"

apprise (https://github.com/caronc/apprise)
- setup.py:40: error: Cannot find implementation or library stub for module named "babel.messages"
+ setup.py:40: error: Library stubs not installed for "babel.messages"
+ setup.py:40: note: Hint: "python3 -m pip install types-babel"
+ setup.py:40: note: (or run "mypy --install-types" to install all missing stub packages)

porcupine (https://github.com/Akuli/porcupine)
- porcupine/plugins/run/windows_run.py:10: error: Cannot find implementation or library stub for module named "colorama"  [import]
+ porcupine/plugins/run/windows_run.py:10: error: Library stubs not installed for "colorama"  [import]
+ porcupine/plugins/run/windows_run.py:10: note: Hint: "python3 -m pip install types-colorama"
- porcupine/__init__.py:12: error: Cannot find implementation or library stub for module named "appdirs"  [import]
+ porcupine/__init__.py:12: error: Library stubs not installed for "appdirs"  [import]
+ porcupine/__init__.py:12: note: Hint: "python3 -m pip install types-appdirs"
+ porcupine/__init__.py:12: note: (or run "mypy --install-types" to install all missing stub packages)
- porcupine/settings.py:20: error: Cannot find implementation or library stub for module named "pygments"  [import]
+ porcupine/settings.py:20: error: Library stubs not installed for "pygments"  [import]
- porcupine/textutils.py:12: error: Cannot find implementation or library stub for module named "pygments"  [import]
- porcupine/tabs.py:17: error: Cannot find implementation or library stub for module named "pygments.lexer"  [import]
- porcupine/tabs.py:18: error: Cannot find implementation or library stub for module named "pygments.lexers"  [import]
- porcupine/plugins/longlinemarker.py:8: error: Cannot find implementation or library stub for module named "pygments"  [import]
+ porcupine/textutils.py:12: error: Library stubs not installed for "pygments"  [import]
+ porcupine/tabs.py:17: error: Library stubs not installed for "pygments.lexer"  [import]
+ porcupine/tabs.py:18: error: Library stubs not installed for "pygments.lexers"  [import]
+ porcupine/plugins/longlinemarker.py:8: error: Library stubs not installed for "pygments"  [import]
- porcupine/plugins/highlight/base_highlighter.py:7: error: Cannot find implementation or library stub for module named "pygments"  [import]
+ porcupine/plugins/highlight/base_highlighter.py:7: error: Library stubs not installed for "pygments"  [import]
- porcupine/pluginloader.py:18: error: Cannot find implementation or library stub for module named "toposort"  [import]
- porcupine/plugins/ttk_themes.py:8: error: Cannot find implementation or library stub for module named "ttkthemes"  [import]
- porcupine/plugins/pastebin.py:22: error: Cannot find implementation or library stub for module named "pygments.lexer"  [import]
+ porcupine/pluginloader.py:18: error: Library stubs not installed for "toposort"  [import]
+ porcupine/pluginloader.py:18: note: Hint: "python3 -m pip install types-toposort"
+ porcupine/plugins/ttk_themes.py:8: error: Library stubs not installed for "ttkthemes"  [import]
+ porcupine/plugins/ttk_themes.py:8: note: Hint: "python3 -m pip install types-ttkthemes"
+ porcupine/plugins/pastebin.py:22: error: Library stubs not installed for "pygments.lexer"  [import]
- porcupine/plugins/filetypes.py:14: error: Cannot find implementation or library stub for module named "pygments"  [import]
- porcupine/plugins/filetypes.py:15: error: Cannot find implementation or library stub for module named "pygments.util"  [import]
+ porcupine/plugins/filetypes.py:14: error: Library stubs not installed for "pygments"  [import]
+ porcupine/plugins/filetypes.py:15: error: Library stubs not installed for "pygments.util"  [import]
- porcupine/plugins/highlight/tree_sitter_highlighter.py:11: error: Cannot find implementation or library stub for module named "tree_sitter"  [import]
+ porcupine/plugins/highlight/tree_sitter_highlighter.py:11: error: Library stubs not installed for "tree_sitter"  [import]
+ porcupine/plugins/highlight/tree_sitter_highlighter.py:11: note: Hint: "python3 -m pip install types-tree-sitter"
- porcupine/plugins/highlight/tree_sitter_highlighter.py:12: error: Cannot find implementation or library stub for module named "tree_sitter_languages"  [import]
+ porcupine/plugins/highlight/tree_sitter_highlighter.py:12: error: Library stubs not installed for "tree_sitter_languages"  [import]
+ porcupine/plugins/highlight/tree_sitter_highlighter.py:12: note: Hint: "python3 -m pip install types-tree-sitter-languages"
- porcupine/plugins/highlight/tree_sitter_highlighter.py:13: note: (or run "mypy --install-types" to install all missing stub packages)
- porcupine/plugins/highlight/pygments_highlighter.py:7: error: Cannot find implementation or library stub for module named "pygments.lexer"  [import]
+ porcupine/plugins/highlight/pygments_highlighter.py:7: error: Library stubs not installed for "pygments.lexer"  [import]
- porcupine/plugins/highlight/pygments_highlighter.py:8: error: Cannot find implementation or library stub for module named "pygments.lexers"  [import]
+ porcupine/plugins/highlight/pygments_highlighter.py:8: error: Library stubs not installed for "pygments.lexers"  [import]
- porcupine/plugins/filemanager.py:16: error: Cannot find implementation or library stub for module named "send2trash"  [import]
+ porcupine/plugins/filemanager.py:16: error: Library stubs not installed for "send2trash"  [import]
+ porcupine/plugins/filemanager.py:16: note: Hint: "python3 -m pip install types-Send2Trash"
- porcupine/plugins/highlight/__init__.py:15: error: Cannot find implementation or library stub for module named "pygments.lexer"  [import]
+ porcupine/plugins/highlight/__init__.py:15: error: Library stubs not installed for "pygments.lexer"  [import]
+ porcupine/plugins/highlight/__init__.py:15: note: Hint: "python3 -m pip install types-Pygments"
- porcupine/plugins/run/no_terminal.py:18: error: Cannot find implementation or library stub for module named "psutil"  [import]
+ porcupine/plugins/run/no_terminal.py:18: error: Library stubs not installed for "psutil"  [import]
+ porcupine/plugins/run/no_terminal.py:18: note: Hint: "python3 -m pip install types-psutil"

jax (https://github.com/google/jax)
- jax/_src/debugger/colab_debugger.py:34: error: Cannot find implementation or library stub for module named "pygments"  [import]
+ jax/_src/debugger/colab_debugger.py:34: error: Library stubs not installed for "pygments"  [import]
+ jax/_src/debugger/colab_debugger.py:34: note: Hint: "python3 -m pip install types-Pygments"
+ jax/_src/debugger/colab_debugger.py:34: note: (or run "mypy --install-types" to install all missing stub packages)

prefect (https://github.com/PrefectHQ/prefect)
- src/prefect/orion/utilities/encryption.py:7: error: Cannot find implementation or library stub for module named "cryptography.fernet"
+ src/prefect/orion/utilities/encryption.py:7: error: Library stubs not installed for "cryptography.fernet"
+ src/prefect/orion/utilities/encryption.py:7: note: Hint: "python3 -m pip install types-cryptography"
+ src/prefect/orion/utilities/encryption.py:7: note: (or run "mypy --install-types" to install all missing stub packages)
- src/prefect/software/pip.py:12: note: (or run "mypy --install-types" to install all missing stub packages)
- src/prefect/testing/standard_test_suites/blocks.py:7: error: Cannot find implementation or library stub for module named "PIL"
+ src/prefect/testing/standard_test_suites/blocks.py:7: error: Library stubs not installed for "PIL"
+ src/prefect/testing/standard_test_suites/blocks.py:7: note: Hint: "python3 -m pip install types-Pillow"

artigraph (https://github.com/artigraph/artigraph)
- src/arti/fingerprints/__init__.py:8: error: Cannot find implementation or library stub for module named "farmhash"  [import]
+ src/arti/fingerprints/__init__.py:8: error: Library stubs not installed for "farmhash"  [import]
+ src/arti/fingerprints/__init__.py:8: note: Hint: "python3 -m pip install types-pyfarmhash"
+ src/arti/fingerprints/__init__.py:8: note: (or run "mypy --install-types" to install all missing stub packages)

streamlit (https://github.com/streamlit/streamlit)
- lib/tests/streamlit/elements/image_test.py:17:1: error: Cannot find implementation or library stub for module named "PIL.Image"  [import]
+ lib/tests/streamlit/elements/image_test.py:17:1: error: Library stubs not installed for "PIL.Image"  [import]
+ lib/tests/streamlit/elements/image_test.py:17:1: note: Hint: "python3 -m pip install types-Pillow"
+ lib/tests/streamlit/elements/image_test.py:17:1: note: (or run "mypy --install-types" to install all missing stub packages)

mypy (https://github.com/python/mypy)
- mypy/dmypy_server.py:947: error: Cannot find implementation or library stub for module named "psutil"  [import]
+ mypy/dmypy_server.py:947: error: Library stubs not installed for "psutil"  [import]
+ mypy/dmypy_server.py:947: note: Hint: "python3 -m pip install types-psutil"
+ mypy/dmypy_server.py:947: note: (or run "mypy --install-types" to install all missing stub packages)

zulip (https://github.com/zulip/zulip)
- tools/lib/capitalization.py:4: error: Cannot find implementation or library stub for module named "bs4"  [import]
+ tools/lib/capitalization.py:4: error: Library stubs not installed for "bs4"  [import]
- zerver/migrations/0244_message_copy_pub_date_to_date_sent.py:8: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
+ zerver/migrations/0244_message_copy_pub_date_to_date_sent.py:8: error: Library stubs not installed for "psycopg2.sql"  [import]
- zerver/migrations/0239_usermessage_copy_id_to_bigint_id.py:9: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
+ zerver/migrations/0239_usermessage_copy_id_to_bigint_id.py:9: error: Library stubs not installed for "psycopg2.sql"  [import]
- zerver/migrations/0102_convert_muted_topic.py:6: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
+ zerver/migrations/0102_convert_muted_topic.py:6: error: Library stubs not installed for "psycopg2.sql"  [import]
- zerver/lib/migrate.py:5: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
- zerver/lib/db.py:4: error: Cannot find implementation or library stub for module named "psycopg2.extensions"  [import]
- zerver/lib/db.py:5: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
+ zerver/lib/migrate.py:5: error: Library stubs not installed for "psycopg2.sql"  [import]
+ zerver/lib/db.py:4: error: Library stubs not installed for "psycopg2.extensions"  [import]
+ zerver/lib/db.py:4: note: Hint: "python3 -m pip install types-psycopg2"
+ zerver/lib/db.py:5: error: Library stubs not installed for "psycopg2.sql"  [import]
- zerver/lib/url_preview/parsers/base.py:12: error: Cannot find implementation or library stub for module named "bs4"  [import]
+ zerver/lib/url_preview/parsers/base.py:12: error: Library stubs not installed for "bs4"  [import]
+ zerver/lib/url_preview/parsers/base.py:12: note: Hint: "python3 -m pip install types-beautifulsoup4"
- tools/tests/test_capitalization_checker.py:3: error: Cannot find implementation or library stub for module named "bs4"  [import]
+ tools/tests/test_capitalization_checker.py:3: error: Library stubs not installed for "bs4"  [import]
- zerver/lib/url_preview/parsers/generic.py:4: error: Cannot find implementation or library stub for module named "bs4.element"  [import]
+ zerver/lib/url_preview/parsers/generic.py:4: error: Library stubs not installed for "bs4.element"  [import]
- zerver/lib/markdown/fenced_code.py:87: error: Cannot find implementation or library stub for module named "pygments.lexers"  [import]
- zerver/lib/markdown/fenced_code.py:88: error: Cannot find implementation or library stub for module named "pygments.util"  [import]
- zerver/openapi/openapi.py:14: error: Cannot find implementation or library stub for module named "jsonschema.exceptions"  [import]
+ zerver/lib/markdown/fenced_code.py:87: error: Library stubs not installed for "pygments.lexers"  [import]
+ zerver/lib/markdown/fenced_code.py:87: note: Hint: "python3 -m pip install types-Pygments"
+ zerver/lib/markdown/fenced_code.py:87: note: (or run "mypy --install-types" to install all missing stub packages)
+ zerver/lib/markdown/fenced_code.py:88: error: Library stubs not installed for "pygments.util"  [import]
+ zerver/openapi/openapi.py:14: error: Library stubs not installed for "jsonschema.exceptions"  [import]
+ zerver/openapi/openapi.py:14: note: Hint: "python3 -m pip install types-jsonschema"
- zerver/lib/html_to_text.py:3: error: Cannot find implementation or library stub for module named "bs4"  [import]
+ zerver/lib/html_to_text.py:3: error: Library stubs not installed for "bs4"  [import]
- zerver/lib/user_message.py:4: error: Cannot find implementation or library stub for module named "psycopg2.extras"  [import]
- zerver/lib/user_message.py:5: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
+ zerver/lib/user_message.py:4: error: Library stubs not installed for "psycopg2.extras"  [import]
+ zerver/lib/user_message.py:5: error: Library stubs not installed for "psycopg2.sql"  [import]
- analytics/lib/counts.py:10: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
+ analytics/lib/counts.py:10: error: Library stubs not installed for "psycopg2.sql"  [import]
- zerver/lib/upload.py:29: error: Cannot find implementation or library stub for module named "PIL"  [import]
- zerver/lib/upload.py:30: error: Cannot find implementation or library stub for module named "PIL.Image"  [import]
+ zerver/lib/upload.py:29: error: Library stubs not installed for "PIL"  [import]
+ zerver/lib/upload.py:30: error: Library stubs not installed for "PIL.Image"  [import]
+ zerver/lib/upload.py:30: note: Hint: "python3 -m pip install types-Pillow"
- corporate/lib/stripe.py:11: error: Cannot find implementation or library stub for module named "stripe"  [import]
+ corporate/lib/stripe.py:11: error: Library stubs not installed for "stripe"  [import]
+ corporate/lib/stripe.py:11: note: Hint: "python3 -m pip install types-stripe"
- zerver/lib/retention.py:38: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
+ zerver/lib/retention.py:38: error: Library stubs not installed for "psycopg2.sql"  [import]
- zerver/lib/subscription_info.py:9: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
- zerver/lib/message.py:27: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
- zerver/views/video_calls.py:22: error: Cannot find implementation or library stub for module named "oauthlib.oauth2"  [import]
+ zerver/lib/subscription_info.py:9: error: Library stubs not installed for "psycopg2.sql"  [import]
+ zerver/lib/message.py:27: error: Library stubs not installed for "psycopg2.sql"  [import]
+ zerver/views/video_calls.py:22: error: Library stubs not installed for "oauthlib.oauth2"  [import]
+ zerver/views/video_calls.py:22: note: Hint: "python3 -m pip install types-oauthlib"
- zerver/lib/email_notifications.py:14: error: Cannot find implementation or library stub for module named "bs4"  [import]
+ zerver/lib/email_notifications.py:14: error: Library stubs not installed for "bs4"  [import]
- zproject/backends.py:72: error: Cannot find implementation or library stub for module named "zxcvbn"  [import]
+ zproject/backends.py:72: error: Library stubs not installed for "zxcvbn"  [import]
+ zproject/backends.py:72: note: Hint: "python3 -m pip install types-zxcvbn"
- corporate/views/session.py:4: error: Cannot find implementation or library stub for module named "stripe"  [import]
+ corporate/views/session.py:4: error: Library stubs not installed for "stripe"  [import]
- corporate/tests/test_stripe.py:28: error: Cannot find implementation or library stub for module named "stripe"  [import]
- corporate/tests/test_stripe.py:29: error: Cannot find implementation or library stub for module named "stripe.util"  [import]
+ corporate/tests/test_stripe.py:28: error: Library stubs not installed for "stripe"  [import]
+ corporate/tests/test_stripe.py:29: error: Library stubs not installed for "stripe.util"  [import]
- corporate/lib/stripe_event_handler.py:4: error: Cannot find implementation or library stub for module named "stripe"  [import]
- analytics/tests/test_counts.py:10: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
+ corporate/lib/stripe_event_handler.py:4: error: Library stubs not installed for "stripe"  [import]
+ analytics/tests/test_counts.py:10: error: Library stubs not installed for "psycopg2.sql"  [import]
- tools/setup/generate_integration_bots_avatars.py:20: error: Cannot find implementation or library stub for module named "PIL"  [import]
+ tools/setup/generate_integration_bots_avatars.py:20: error: Library stubs not installed for "PIL"  [import]
- zerver/tests/test_upload.py:19: error: Cannot find implementation or library stub for module named "PIL"  [import]
+ zerver/tests/test_upload.py:19: error: Library stubs not installed for "PIL"  [import]
- zerver/tests/test_middleware.py:5: error: Cannot find implementation or library stub for module named "bs4"  [import]
+ zerver/tests/test_middleware.py:5: error: Library stubs not installed for "bs4"  [import]
- zerver/tests/test_auth_backends.py:35: error: Cannot find implementation or library stub for module named "bs4"  [import]
- zerver/tests/test_auth_backends.py:36: error: Cannot find implementation or library stub for module named "bs4.element"  [import]
+ zerver/tests/test_auth_backends.py:35: error: Library stubs not installed for "bs4"  [import]
+ zerver/tests/test_auth_backends.py:36: error: Library stubs not installed for "bs4.element"  [import]
- zerver/lib/import_realm.py:11: error: Cannot find implementation or library stub for module named "bs4"  [import]
- zerver/lib/import_realm.py:17: error: Cannot find implementation or library stub for module named "psycopg2.extras"  [import]
- zerver/lib/import_realm.py:18: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
- zerver/lib/fix_unreads.py:7: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
- corporate/views/webhook.py:4: error: Cannot find implementation or library stub for module named "stripe"  [import]
- corporate/views/billing_page.py:4: error: Cannot find implementation or library stub for module named "stripe"  [import]
- corporate/views/upgrade.py:5: error: Cannot find implementation or library stub for module named "stripe"  [import]
- tools/lib/provision_inner.py:12: error: Cannot find implementation or library stub for module named "pygments"  [import]
+ zerver/lib/import_realm.py:11: error: Library stubs not installed for "bs4"  [import]
+ zerver/lib/import_realm.py:17: error: Library stubs not installed for "psycopg2.extras"  [import]
+ zerver/lib/import_realm.py:18: error: Library stubs not installed for "psycopg2.sql"  [import]
+ zerver/lib/fix_unreads.py:7: error: Library stubs not installed for "psycopg2.sql"  [import]
+ corporate/views/webhook.py:4: error: Library stubs not installed for "stripe"  [import]
+ corporate/views/billing_page.py:4: error: Library stubs not installed for "stripe"  [import]
+ corporate/views/upgrade.py:5: error: Library stubs not installed for "stripe"  [import]
+ tools/lib/provision_inner.py:12: error: Library stubs not installed for "pygments"  [import]
- analytics/views/realm_activity.py:10: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
+ analytics/views/realm_activity.py:10: error: Library stubs not installed for "psycopg2.sql"  [import]
- analytics/views/installation_activity.py:14: error: Cannot find implementation or library stub for module named "psycopg2.sql"  [import]
+ analytics/views/installation_activity.py:14: error: Library stubs not installed for "psycopg2.sql"  [import]

flake8 (https://github.com/pycqa/flake8)
- src/flake8/plugins/pyflakes.py:11: error: Cannot find implementation or library stub for module named "pyflakes.checker"
- src/flake8/plugins/pyflakes.py:11: error: Cannot find implementation or library stub for module named "pyflakes"
- tests/unit/test_pyflakes_codes.py:6: error: Cannot find implementation or library stub for module named "pyflakes"
+ src/flake8/plugins/pyflakes.py:11: error: Library stubs not installed for "pyflakes.checker"
+ src/flake8/plugins/pyflakes.py:11: note: Hint: "python3 -m pip install types-pyflakes"
+ src/flake8/plugins/pyflakes.py:11: note: (or run "mypy --install-types" to install all missing stub packages)
+ src/flake8/plugins/pyflakes.py:11: error: Library stubs not installed for "pyflakes"
+ tests/unit/test_pyflakes_codes.py:6: error: Library stubs not installed for "pyflakes"

poetry (https://github.com/python-poetry/poetry)
- src/poetry/json/__init__.py:9: error: Cannot find implementation or library stub for module named "jsonschema"  [import]
+ src/poetry/json/__init__.py:9: error: Library stubs not installed for "jsonschema"  [import]
+ src/poetry/json/__init__.py:9: note: Hint: "python3 -m pip install types-jsonschema"
+ src/poetry/json/__init__.py:9: note: (or run "mypy --install-types" to install all missing stub packages)
- src/poetry/repositories/link_sources/html.py:22: error: Cannot find implementation or library stub for module named "html5lib"  [import]
+ src/poetry/repositories/link_sources/html.py:22: error: Library stubs not installed for "html5lib"  [import]
+ src/poetry/repositories/link_sources/html.py:22: note: Hint: "python3 -m pip install types-html5lib"
- src/poetry/repositories/pypi_repository.py:12: error: Cannot find implementation or library stub for module named "html5lib.html5parser"  [import]
+ src/poetry/repositories/pypi_repository.py:12: error: Library stubs not installed for "html5lib.html5parser"  [import]

bokeh (https://github.com/bokeh/bokeh)
- release/ui.py:27:1: error: Cannot find implementation or library stub for module named "colorama"  [import]
- src/bokeh/util/terminal.py:51:1: error: Cannot find implementation or library stub for module named "colorama"  [import]
+ release/ui.py:27:1: error: Library stubs not installed for "colorama"  [import]
+ src/bokeh/util/terminal.py:51:1: error: Library stubs not installed for "colorama"  [import]
+ src/bokeh/util/terminal.py:51:1: note: Hint: "python3 -m pip install types-colorama"
- src/bokeh/util/sampledata.py:105:1: note: (or run "mypy --install-types" to install all missing stub packages)
- src/bokeh/io/export.py:39:1: error: Cannot find implementation or library stub for module named "PIL"  [import]
+ src/bokeh/io/export.py:39:1: error: Library stubs not installed for "PIL"  [import]
+ src/bokeh/io/export.py:39:1: note: Hint: "python3 -m pip install types-Pillow"
+ src/bokeh/io/export.py:39:1: note: (or run "mypy --install-types" to install all missing stub packages)

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

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

I like the better error messages here!

Could we add a way of automatically updating the mappings in stubinfo.py when we do a typeshed sync? I don't like that we have to manually update the existing mapping every time typeshed removes a package. This seems like it might exacerbate that problem, since now we have to manually update stubinfo.py every time typeshed adds a package as well as every time it removes one. We could have a hardcoded excludelist (which would currently have only one entry, sqlalchemy) for packages which the typeshed-sync script shouldn't add to the mapping.

Maybe instead of having these two huge dictionaries in stubinfo.py, we could have a toml or json file somewhere to store this data? That might make it easier for the typeshed-sync script to auto-update the mappings.

Note that typeshed now has a bot that automatically files PRs to mark typeshed packages as obsolete if the upstream source now has inline types. So whether a stubs package is marked as obsolete or not in its METADATA.toml file should be pretty up-to-date information.

bors bot added a commit to microsoft/Qcodes that referenced this pull request Sep 21, 2022
4640: typecheck tqdm against stubs r=jenshnielsen a=jenshnielsen

Removes one more package from the list of not typed packages.

Inspired by the list in python/mypy#13698

Co-authored-by: Jens H. Nielsen <Jens.Nielsen@microsoft.com>
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.

This looks great to me! Alex's suggestion can be done in a later PR (should be easy to just update stubinfo.py in place)

@hauntsaninja hauntsaninja merged commit a677f49 into master Sep 21, 2022
@hauntsaninja hauntsaninja deleted the stub-suggestions branch September 21, 2022 21:33
@AlexWaygood
Copy link
Member

Btw @hauntsaninja does ^ that mypy_primer diff indicate some pip invocations need to be updated over at mypy_primer?

@hauntsaninja
Copy link
Collaborator

Notionally yes, but it's not the biggest deal. For typeshed CI everything is on MYPYPATH.

@AlexWaygood
Copy link
Member

For typeshed CI everything is on MYPYPATH.

Oh of course — I forgot it worked differently in typeshed's CI :)

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.

None yet

3 participants