From fcd705d3149906d1fa892c4ae9e5458275007b24 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 20 Dec 2022 07:09:05 +0000 Subject: [PATCH] Update `stubinfo.py` for recent typeshed changes (#14265) Removals from `stubinfo.py`: - `atomicwrites` is archived and deprecated at runtime; stubs were removed from typeshed in https://github.com/python/typeshed/pull/8925 - `attrs` has had inline types for a very long time now - `chardet` recently cut a release with inline types; typeshed's stubs were marked obsolete in https://github.com/python/typeshed/pull/9318 - `cryptography` has had inline types for a very long time now; the only reason why it's still in typeshed is because other typeshed packages need `types-cryptography` as a dependency, and our testing infrastructure therefore can't currently cope with it being removed from typeshed. - `emoji` recently cut a release bundling stubs with the runtime package; typeshed's stubs were marked obsolete in https://github.com/python/typeshed/pull/9051 - `termcolor` recently cut a release with inline types; typeshed's stubs were marked obsolete in https://github.com/python/typeshed/pull/8746 - `prettytable` recently cut a release with inline types; typeshed's stubs were marked obsolete in https://github.com/python/typeshed/pull/9023 Additions: - Stubs for `Xlib` were added in https://github.com/python/typeshed/pull/9279 - Stubs for `consolemenu` were added in https://github.com/python/typeshed/pull/8820 - Stubs for `dockerfile_parse` were added in https://github.com/python/typeshed/pull/9305 - Stubs for `flask_migrate` were added in https://github.com/python/typeshed/pull/8967 - Stubs for `paho.mqtt` were added in https://github.com/python/typeshed/pull/8853 - Stubs for `pycocotools` were added in https://github.com/python/typeshed/pull/9086 - Stubs for many `pywin32` modules were added in https://github.com/python/typeshed/pull/8825, and multiple follow-up PRs - Stubs for `pyscreeze` were added in https://github.com/python/typeshed/pull/8823 --- mypy/stubinfo.py | 28 +++++++++++++++++++++------- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/mypy/stubinfo.py b/mypy/stubinfo.py index b8dea5d0046b..15bd96d9f4b4 100644 --- a/mypy/stubinfo.py +++ b/mypy/stubinfo.py @@ -20,14 +20,11 @@ def stub_package_name(prefix: str) -> str: # Package name can have one or two components ('a' or 'a.b'). legacy_bundled_packages = { "aiofiles": "types-aiofiles", - "atomicwrites": "types-atomicwrites", - "attr": "types-attrs", "backports": "types-backports", "backports_abc": "types-backports_abc", "bleach": "types-bleach", "boto": "types-boto", "cachetools": "types-cachetools", - "chardet": "types-chardet", "click_spinner": "types-click-spinner", "contextvars": "types-contextvars", "croniter": "types-croniter", @@ -38,7 +35,6 @@ def stub_package_name(prefix: str) -> str: "decorator": "types-decorator", "deprecated": "types-Deprecated", "docutils": "types-docutils", - "emoji": "types-emoji", "first": "types-first", "geoip2": "types-geoip2", "gflags": "types-python-gflags", @@ -64,7 +60,6 @@ def stub_package_name(prefix: str) -> str: "six": "types-six", "slugify": "types-python-slugify", "tabulate": "types-tabulate", - "termcolor": "types-termcolor", "toml": "types-toml", "typed_ast": "types-typed-ast", "tzlocal": "types-tzlocal", @@ -83,10 +78,14 @@ def stub_package_name(prefix: str) -> str: # Note that these packages are omitted for now: # sqlalchemy: It's unclear which stub package to suggest. There's also # a mypy plugin available. +# pika: typeshed's stubs are on PyPI as types-pika-ts. +# types-pika already exists on PyPI, and is more complete in many ways, +# but is a non-typeshed stubs package. non_bundled_packages = { "MySQLdb": "types-mysqlclient", "PIL": "types-Pillow", "PyInstaller": "types-pyinstaller", + "Xlib": "types-python-xlib", "annoy": "types-annoy", "appdirs": "types-appdirs", "aws_xray_sdk": "types-aws-xray-sdk", @@ -100,9 +99,11 @@ def stub_package_name(prefix: str) -> str: "chevron": "types-chevron", "colorama": "types-colorama", "commonmark": "types-commonmark", - "cryptography": "types-cryptography", + "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", "entrypoints": "types-entrypoints", @@ -115,6 +116,7 @@ def stub_package_name(prefix: str) -> str: "flake8_simplify": "types-flake8-simplify", "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", @@ -134,22 +136,28 @@ def stub_package_name(prefix: str) -> str: "oauthlib": "types-oauthlib", "openpyxl": "types-openpyxl", "opentracing": "types-opentracing", + "paho.mqtt": "types-paho-mqtt", "parsimonious": "types-parsimonious", "passlib": "types-passlib", "passpy": "types-passpy", + "peewee": "types-peewee", "pep8ext_naming": "types-pep8-naming", "playsound": "types-playsound", - "prettytable": "types-prettytable", "psutil": "types-psutil", "psycopg2": "types-psycopg2", "pyaudio": "types-pyaudio", "pyautogui": "types-PyAutoGUI", + "pycocotools": "types-pycocotools", "pyflakes": "types-pyflakes", "pygments": "types-Pygments", "pyi_splash": "types-pyinstaller", "pynput": "types-pynput", + "pythoncom": "types-pywin32", + "pythonwin": "types-pywin32", + "pyscreeze": "types-PyScreeze", "pysftp": "types-pysftp", "pytest_lazyfixture": "types-pytest-lazy-fixture", + "pywintypes": "types-pywin32", "regex": "types-regex", "send2trash": "types-Send2Trash", "slumber": "types-slumber", @@ -163,6 +171,12 @@ def stub_package_name(prefix: str) -> str: "urllib3": "types-urllib3", "vobject": "types-vobject", "whatthepatch": "types-whatthepatch", + "win32": "types-pywin32", + "win32api": "types-pywin32", + "win32con": "types-pywin32", + "win32com": "types-pywin32", + "win32comext": "types-pywin32", + "win32gui": "types-pywin32", "xmltodict": "types-xmltodict", "xxhash": "types-xxhash", "zxcvbn": "types-zxcvbn",