Skip to content

Commit

Permalink
Remove stubs packages from stubinfo.py where the runtime package ha…
Browse files Browse the repository at this point in the history
…s added a `py.typed` file (#16226)

All of these stubs packages have been removed from typeshed, due to the
runtime package having added a `py.typed` file.
  • Loading branch information
AlexWaygood authored Oct 4, 2023
1 parent a1df335 commit 10dfafe
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
9 changes: 0 additions & 9 deletions mypy/stubinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,14 @@ def stub_distribution_name(prefix: str) -> str:
"croniter": "types-croniter",
"dataclasses": "types-dataclasses",
"dateparser": "types-dateparser",
"datetimerange": "types-DateTimeRange",
"dateutil": "types-python-dateutil",
"decorator": "types-decorator",
"deprecated": "types-Deprecated",
"docutils": "types-docutils",
"first": "types-first",
"geoip2": "types-geoip2",
"gflags": "types-python-gflags",
"google.protobuf": "types-protobuf",
"markdown": "types-Markdown",
"maxminddb": "types-maxminddb",
"mock": "types-mock",
"OpenSSL": "types-pyOpenSSL",
"paramiko": "types-paramiko",
Expand Down Expand Up @@ -80,8 +77,6 @@ def stub_distribution_name(prefix: str) -> str:
"PIL": "types-Pillow",
"PyInstaller": "types-pyinstaller",
"Xlib": "types-python-xlib",
"annoy": "types-annoy",
"appdirs": "types-appdirs",
"aws_xray_sdk": "types-aws-xray-sdk",
"babel": "types-babel",
"backports.ssl_match_hostname": "types-backports.ssl_match_hostname",
Expand All @@ -96,7 +91,6 @@ def stub_distribution_name(prefix: str) -> str:
"consolemenu": "types-console-menu",
"crontab": "types-python-crontab",
"d3dshot": "types-D3DShot",
"dj_database_url": "types-dj-database-url",
"dockerfile_parse": "types-dockerfile-parse",
"docopt": "types-docopt",
"editdistance": "types-editdistance",
Expand All @@ -111,7 +105,6 @@ def stub_distribution_name(prefix: str) -> str:
"flake8_typing_imports": "types-flake8-typing-imports",
"flask_cors": "types-Flask-Cors",
"flask_migrate": "types-Flask-Migrate",
"flask_sqlalchemy": "types-Flask-SQLAlchemy",
"fpdf": "types-fpdf2",
"gdb": "types-gdb",
"google.cloud.ndb": "types-google-cloud-ndb",
Expand Down Expand Up @@ -162,7 +155,6 @@ def stub_distribution_name(prefix: str) -> str:
"tree_sitter": "types-tree-sitter",
"tree_sitter_languages": "types-tree-sitter-languages",
"ttkthemes": "types-ttkthemes",
"urllib3": "types-urllib3",
"vobject": "types-vobject",
"whatthepatch": "types-whatthepatch",
"win32": "types-pywin32",
Expand All @@ -172,7 +164,6 @@ def stub_distribution_name(prefix: str) -> str:
"win32comext": "types-pywin32",
"win32gui": "types-pywin32",
"xmltodict": "types-xmltodict",
"xxhash": "types-xxhash",
"zxcvbn": "types-zxcvbn",
# Stub packages that are not from typeshed
# Since these can be installed automatically via --install-types, we have a high trust bar
Expand Down
12 changes: 6 additions & 6 deletions test-data/unit/pythoneval.test
Original file line number Diff line number Diff line change
Expand Up @@ -1568,24 +1568,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 maxminddb # Python 3 stubs available for maxminddb
import docutils # Python 3 stubs available for docutils
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 "maxminddb"
_testIgnoreImportIfNoPython3StubAvailable.py:4: note: Hint: "python3 -m pip install types-maxminddb"
_testIgnoreImportIfNoPython3StubAvailable.py:4: error: Library stubs not installed for "docutils"
_testIgnoreImportIfNoPython3StubAvailable.py:4: note: Hint: "python3 -m pip install types-docutils"
_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 maxminddb
import docutils
[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 "maxminddb"
_testNoPython3StubAvailable.py:3: note: Hint: "python3 -m pip install types-maxminddb"
_testNoPython3StubAvailable.py:3: error: Library stubs not installed for "docutils"
_testNoPython3StubAvailable.py:3: note: Hint: "python3 -m pip install types-docutils"
_testNoPython3StubAvailable.py:3: note: (or run "mypy --install-types" to install all missing stub packages)


Expand Down

0 comments on commit 10dfafe

Please sign in to comment.