diff --git a/mypy/stubinfo.py b/mypy/stubinfo.py index 56d66e00f0bf..77426bb09b7b 100644 --- a/mypy/stubinfo.py +++ b/mypy/stubinfo.py @@ -34,19 +34,15 @@ def stub_distribution_name(module: str) -> str | None: legacy_bundled_packages: dict[str, str] = { "aiofiles": "types-aiofiles", "bleach": "types-bleach", - "boto": "types-boto", "cachetools": "types-cachetools", "click_spinner": "types-click-spinner", - "contextvars": "types-contextvars", "croniter": "types-croniter", - "dataclasses": "types-dataclasses", "dateparser": "types-dateparser", "dateutil": "types-python-dateutil", "decorator": "types-decorator", "deprecated": "types-Deprecated", "docutils": "types-docutils", "first": "types-first", - "gflags": "types-python-gflags", "markdown": "types-Markdown", "mock": "types-mock", "OpenSSL": "types-pyOpenSSL", @@ -56,20 +52,14 @@ def stub_distribution_name(module: str) -> str | None: "pycurl": "types-pycurl", "pymysql": "types-PyMySQL", "pyrfc3339": "types-pyRFC3339", - "python2": "types-six", "pytz": "types-pytz", - "pyVmomi": "types-pyvmomi", - "redis": "types-redis", "requests": "types-requests", "retry": "types-retry", "simplejson": "types-simplejson", "singledispatch": "types-singledispatch", "six": "types-six", - "slugify": "types-python-slugify", "tabulate": "types-tabulate", "toml": "types-toml", - "typed_ast": "types-typed-ast", - "tzlocal": "types-tzlocal", "ujson": "types-ujson", "waitress": "types-waitress", "yaml": "types-PyYAML", @@ -92,7 +82,6 @@ def stub_distribution_name(module: str) -> str | None: "atheris": "types-atheris", "authlib": "types-Authlib", "aws_xray_sdk": "types-aws-xray-sdk", - "babel": "types-babel", "boltons": "types-boltons", "braintree": "types-braintree", "bs4": "types-beautifulsoup4", @@ -112,23 +101,19 @@ def stub_distribution_name(module: str) -> str | None: "cronlog": "types-python-crontab", "crontab": "types-python-crontab", "crontabs": "types-python-crontab", - "d3dshot": "types-D3DShot", "datemath": "types-python-datemath", "dateparser_data": "types-dateparser", "dde": "types-pywin32", "defusedxml": "types-defusedxml", "docker": "types-docker", "dockerfile_parse": "types-dockerfile-parse", - "docopt": "types-docopt", "editdistance": "types-editdistance", "entrypoints": "types-entrypoints", "exifread": "types-ExifRead", "fanstatic": "types-fanstatic", "farmhash": "types-pyfarmhash", - "flake8_2020": "types-flake8-2020", "flake8_builtins": "types-flake8-builtins", "flake8_docstrings": "types-flake8-docstrings", - "flake8_plugin_utils": "types-flake8-plugin-utils", "flake8_rst_docstrings": "types-flake8-rst-docstrings", "flake8_simplify": "types-flake8-simplify", "flake8_typing_imports": "types-flake8-typing-imports", @@ -150,7 +135,6 @@ def stub_distribution_name(module: str) -> str | None: "import_export": "types-django-import-export", "influxdb_client": "types-influxdb-client", "inifile": "types-inifile", - "invoke": "types-invoke", "isapi": "types-pywin32", "jack": "types-JACK-Client", "jenkins": "types-python-jenkins", @@ -189,9 +173,7 @@ def stub_distribution_name(module: str) -> str | None: "pep8ext_naming": "types-pep8-naming", "perfmon": "types-pywin32", "pexpect": "types-pexpect", - "PIL": "types-Pillow", "playhouse": "types-peewee", - "playsound": "types-playsound", "portpicker": "types-portpicker", "psutil": "types-psutil", "psycopg2": "types-psycopg2", @@ -230,9 +212,7 @@ def stub_distribution_name(module: str) -> str | None: "shapely": "types-shapely", "slumber": "types-slumber", "sspicon": "types-pywin32", - "stdlib_list": "types-stdlib-list", "str2bool": "types-str2bool", - "stripe": "types-stripe", "tensorflow": "types-tensorflow", "tgcrypto": "types-TgCrypto", "timer": "types-pywin32", @@ -240,7 +220,6 @@ def stub_distribution_name(module: str) -> str | None: "tqdm": "types-tqdm", "translationstring": "types-translationstring", "tree_sitter_languages": "types-tree-sitter-languages", - "tree_sitter": "types-tree-sitter", "ttkthemes": "types-ttkthemes", "unidiff": "types-unidiff", "untangle": "types-untangle", diff --git a/mypy/test/teststubinfo.py b/mypy/test/teststubinfo.py index 518194d35e1d..e90c72335bf8 100644 --- a/mypy/test/teststubinfo.py +++ b/mypy/test/teststubinfo.py @@ -15,12 +15,12 @@ def test_is_legacy_bundled_packages(self) -> None: assert not is_module_from_legacy_bundled_package("foobar_asdf") assert not is_module_from_legacy_bundled_package("PIL") assert is_module_from_legacy_bundled_package("pycurl") - assert is_module_from_legacy_bundled_package("dataclasses") + assert is_module_from_legacy_bundled_package("dateparser") def test_stub_distribution_name(self) -> None: assert stub_distribution_name("foobar_asdf") is None assert stub_distribution_name("pycurl") == "types-pycurl" - assert stub_distribution_name("babel") == "types-babel" + assert stub_distribution_name("bs4") == "types-beautifulsoup4" assert stub_distribution_name("google.cloud.ndb") == "types-google-cloud-ndb" assert stub_distribution_name("google.cloud.ndb.submodule") == "types-google-cloud-ndb" assert stub_distribution_name("google.cloud.unknown") is None diff --git a/test-data/unit/pythoneval.test b/test-data/unit/pythoneval.test index 66ceafb91370..ab9624619b76 100644 --- a/test-data/unit/pythoneval.test +++ b/test-data/unit/pythoneval.test @@ -1507,24 +1507,24 @@ note: A user-defined top-level module with name "typing" is not supported # flags: --ignore-missing-imports import scribe # No Python 3 stubs available for scribe from scribe import x -import python2 # Python 3 stubs available for python2 +import pytz # Python 3 stubs available for pytz import foobar_asdf import jack # This has a stubs package but was never bundled with mypy, so ignoring works [out] -_testIgnoreImportIfNoPython3StubAvailable.py:4: error: Library stubs not installed for "python2" -_testIgnoreImportIfNoPython3StubAvailable.py:4: note: Hint: "python3 -m pip install types-six" +_testIgnoreImportIfNoPython3StubAvailable.py:4: error: Library stubs not installed for "pytz" +_testIgnoreImportIfNoPython3StubAvailable.py:4: note: Hint: "python3 -m pip install types-pytz" _testIgnoreImportIfNoPython3StubAvailable.py:4: note: (or run "mypy --install-types" to install all missing stub packages) _testIgnoreImportIfNoPython3StubAvailable.py:4: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports [case testNoPython3StubAvailable] import scribe from scribe import x -import python2 +import pytz [out] _testNoPython3StubAvailable.py:1: error: Cannot find implementation or library stub for module named "scribe" _testNoPython3StubAvailable.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports -_testNoPython3StubAvailable.py:3: error: Library stubs not installed for "python2" -_testNoPython3StubAvailable.py:3: note: Hint: "python3 -m pip install types-six" +_testNoPython3StubAvailable.py:3: error: Library stubs not installed for "pytz" +_testNoPython3StubAvailable.py:3: note: Hint: "python3 -m pip install types-pytz" _testNoPython3StubAvailable.py:3: note: (or run "mypy --install-types" to install all missing stub packages)