Skip to content

Commit 69ca89c

Browse files
authored
Remove stubs no longer in typeshed (#18373)
See #18367 for script See #18366 for additions
1 parent 485b120 commit 69ca89c

File tree

3 files changed

+8
-29
lines changed

3 files changed

+8
-29
lines changed

mypy/stubinfo.py

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,15 @@ def stub_distribution_name(module: str) -> str | None:
3434
legacy_bundled_packages: dict[str, str] = {
3535
"aiofiles": "types-aiofiles",
3636
"bleach": "types-bleach",
37-
"boto": "types-boto",
3837
"cachetools": "types-cachetools",
3938
"click_spinner": "types-click-spinner",
40-
"contextvars": "types-contextvars",
4139
"croniter": "types-croniter",
42-
"dataclasses": "types-dataclasses",
4340
"dateparser": "types-dateparser",
4441
"dateutil": "types-python-dateutil",
4542
"decorator": "types-decorator",
4643
"deprecated": "types-Deprecated",
4744
"docutils": "types-docutils",
4845
"first": "types-first",
49-
"gflags": "types-python-gflags",
5046
"markdown": "types-Markdown",
5147
"mock": "types-mock",
5248
"OpenSSL": "types-pyOpenSSL",
@@ -56,20 +52,14 @@ def stub_distribution_name(module: str) -> str | None:
5652
"pycurl": "types-pycurl",
5753
"pymysql": "types-PyMySQL",
5854
"pyrfc3339": "types-pyRFC3339",
59-
"python2": "types-six",
6055
"pytz": "types-pytz",
61-
"pyVmomi": "types-pyvmomi",
62-
"redis": "types-redis",
6356
"requests": "types-requests",
6457
"retry": "types-retry",
6558
"simplejson": "types-simplejson",
6659
"singledispatch": "types-singledispatch",
6760
"six": "types-six",
68-
"slugify": "types-python-slugify",
6961
"tabulate": "types-tabulate",
7062
"toml": "types-toml",
71-
"typed_ast": "types-typed-ast",
72-
"tzlocal": "types-tzlocal",
7363
"ujson": "types-ujson",
7464
"waitress": "types-waitress",
7565
"yaml": "types-PyYAML",
@@ -92,7 +82,6 @@ def stub_distribution_name(module: str) -> str | None:
9282
"atheris": "types-atheris",
9383
"authlib": "types-Authlib",
9484
"aws_xray_sdk": "types-aws-xray-sdk",
95-
"babel": "types-babel",
9685
"boltons": "types-boltons",
9786
"braintree": "types-braintree",
9887
"bs4": "types-beautifulsoup4",
@@ -112,23 +101,19 @@ def stub_distribution_name(module: str) -> str | None:
112101
"cronlog": "types-python-crontab",
113102
"crontab": "types-python-crontab",
114103
"crontabs": "types-python-crontab",
115-
"d3dshot": "types-D3DShot",
116104
"datemath": "types-python-datemath",
117105
"dateparser_data": "types-dateparser",
118106
"dde": "types-pywin32",
119107
"defusedxml": "types-defusedxml",
120108
"docker": "types-docker",
121109
"dockerfile_parse": "types-dockerfile-parse",
122-
"docopt": "types-docopt",
123110
"editdistance": "types-editdistance",
124111
"entrypoints": "types-entrypoints",
125112
"exifread": "types-ExifRead",
126113
"fanstatic": "types-fanstatic",
127114
"farmhash": "types-pyfarmhash",
128-
"flake8_2020": "types-flake8-2020",
129115
"flake8_builtins": "types-flake8-builtins",
130116
"flake8_docstrings": "types-flake8-docstrings",
131-
"flake8_plugin_utils": "types-flake8-plugin-utils",
132117
"flake8_rst_docstrings": "types-flake8-rst-docstrings",
133118
"flake8_simplify": "types-flake8-simplify",
134119
"flake8_typing_imports": "types-flake8-typing-imports",
@@ -150,7 +135,6 @@ def stub_distribution_name(module: str) -> str | None:
150135
"import_export": "types-django-import-export",
151136
"influxdb_client": "types-influxdb-client",
152137
"inifile": "types-inifile",
153-
"invoke": "types-invoke",
154138
"isapi": "types-pywin32",
155139
"jack": "types-JACK-Client",
156140
"jenkins": "types-python-jenkins",
@@ -189,9 +173,7 @@ def stub_distribution_name(module: str) -> str | None:
189173
"pep8ext_naming": "types-pep8-naming",
190174
"perfmon": "types-pywin32",
191175
"pexpect": "types-pexpect",
192-
"PIL": "types-Pillow",
193176
"playhouse": "types-peewee",
194-
"playsound": "types-playsound",
195177
"portpicker": "types-portpicker",
196178
"psutil": "types-psutil",
197179
"psycopg2": "types-psycopg2",
@@ -230,17 +212,14 @@ def stub_distribution_name(module: str) -> str | None:
230212
"shapely": "types-shapely",
231213
"slumber": "types-slumber",
232214
"sspicon": "types-pywin32",
233-
"stdlib_list": "types-stdlib-list",
234215
"str2bool": "types-str2bool",
235-
"stripe": "types-stripe",
236216
"tensorflow": "types-tensorflow",
237217
"tgcrypto": "types-TgCrypto",
238218
"timer": "types-pywin32",
239219
"toposort": "types-toposort",
240220
"tqdm": "types-tqdm",
241221
"translationstring": "types-translationstring",
242222
"tree_sitter_languages": "types-tree-sitter-languages",
243-
"tree_sitter": "types-tree-sitter",
244223
"ttkthemes": "types-ttkthemes",
245224
"unidiff": "types-unidiff",
246225
"untangle": "types-untangle",

mypy/test/teststubinfo.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ def test_is_legacy_bundled_packages(self) -> None:
1515
assert not is_module_from_legacy_bundled_package("foobar_asdf")
1616
assert not is_module_from_legacy_bundled_package("PIL")
1717
assert is_module_from_legacy_bundled_package("pycurl")
18-
assert is_module_from_legacy_bundled_package("dataclasses")
18+
assert is_module_from_legacy_bundled_package("dateparser")
1919

2020
def test_stub_distribution_name(self) -> None:
2121
assert stub_distribution_name("foobar_asdf") is None
2222
assert stub_distribution_name("pycurl") == "types-pycurl"
23-
assert stub_distribution_name("babel") == "types-babel"
23+
assert stub_distribution_name("bs4") == "types-beautifulsoup4"
2424
assert stub_distribution_name("google.cloud.ndb") == "types-google-cloud-ndb"
2525
assert stub_distribution_name("google.cloud.ndb.submodule") == "types-google-cloud-ndb"
2626
assert stub_distribution_name("google.cloud.unknown") is None

test-data/unit/pythoneval.test

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,24 +1507,24 @@ note: A user-defined top-level module with name "typing" is not supported
15071507
# flags: --ignore-missing-imports
15081508
import scribe # No Python 3 stubs available for scribe
15091509
from scribe import x
1510-
import python2 # Python 3 stubs available for python2
1510+
import pytz # Python 3 stubs available for pytz
15111511
import foobar_asdf
15121512
import jack # This has a stubs package but was never bundled with mypy, so ignoring works
15131513
[out]
1514-
_testIgnoreImportIfNoPython3StubAvailable.py:4: error: Library stubs not installed for "python2"
1515-
_testIgnoreImportIfNoPython3StubAvailable.py:4: note: Hint: "python3 -m pip install types-six"
1514+
_testIgnoreImportIfNoPython3StubAvailable.py:4: error: Library stubs not installed for "pytz"
1515+
_testIgnoreImportIfNoPython3StubAvailable.py:4: note: Hint: "python3 -m pip install types-pytz"
15161516
_testIgnoreImportIfNoPython3StubAvailable.py:4: note: (or run "mypy --install-types" to install all missing stub packages)
15171517
_testIgnoreImportIfNoPython3StubAvailable.py:4: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
15181518

15191519
[case testNoPython3StubAvailable]
15201520
import scribe
15211521
from scribe import x
1522-
import python2
1522+
import pytz
15231523
[out]
15241524
_testNoPython3StubAvailable.py:1: error: Cannot find implementation or library stub for module named "scribe"
15251525
_testNoPython3StubAvailable.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
1526-
_testNoPython3StubAvailable.py:3: error: Library stubs not installed for "python2"
1527-
_testNoPython3StubAvailable.py:3: note: Hint: "python3 -m pip install types-six"
1526+
_testNoPython3StubAvailable.py:3: error: Library stubs not installed for "pytz"
1527+
_testNoPython3StubAvailable.py:3: note: Hint: "python3 -m pip install types-pytz"
15281528
_testNoPython3StubAvailable.py:3: note: (or run "mypy --install-types" to install all missing stub packages)
15291529

15301530

0 commit comments

Comments
 (0)