Repository: python/mypy

Issue:
Update set of recognized third party modules
`mypy/moduleinfo.py` contains a hard-coded list of third party modules that mypy uses to generate better error messages in some cases. This list hasn't been updated in a while. Update the list based on up-to-date package popularity information.


Discussion:
👍 
Taking a look at this

Resolving patch:
diff --git a/mypy/moduleinfo.py b/mypy/moduleinfo.py
--- a/mypy/moduleinfo.py
+++ b/mypy/moduleinfo.py
@@ -20,199 +20,196 @@
 
 
 third_party_modules = {
-    # From Python 3 Wall of Superpowers (https://python3wos.appspot.com/)
-    'simplejson',
-    'requests',
-    'six',
+    # From https://hugovk.github.io/top-pypi-packages/
     'pip',
-    'virtualenv',
-    'boto',
-    'setuptools',
+    'urllib3',
+    'six',
+    'botocore',
     'dateutil',
-    'pytz',
-    'pyasn1',
-    'nose',
+    's3transfer',
     'yaml',
-    'lxml',
-    'jinja2',
+    'requests',
+    'pyasn1',
     'docutils',
-    'markupsafe',
-    'paramiko',
-    'Crypto',
+    'jmespath',
+    'certifi',
     'rsa',
-    'django',
-    'coverage',
-    'pika',
+    'setuptools',
+    'idna',
+    'awscli',
+    'concurrent.futures',
     'colorama',
-    'ecdsa',
-    'psycopg2',
-    'httplib2',
-    'mock',
+    'chardet',
+    'wheel',
+    'simplejson',
+    'boto3',
+    'pytz',
+    'numpy',
+    'markupsafe',
+    'jinja2',
+    'cffi',
+    'cryptography',
+    'google.protobuf',
+    'cwlogs',
+    'enum',
     'pycparser',
-    'pep8',
-    'redis',
-    'pymongo',
-    'sqlalchemy',
-    'pygments',
+    'asn1crypto',
+    'attr',
+    'click',
+    'ipaddress',
+    'pytest',
+    'future',
+    'decorator',
+    'pbr',
+    'google.api',
+    'pandas',
     'werkzeug',
-    'selenium',
-    'supervisor',
-    'zc.buildout',
-    'meld3',
-    'PIL',
-    'paste',
+    'pyparsing',
     'flask',
-    '_mysql',
-    'MySQLdb',
-    'greenlet',
-    'carbon',
     'psutil',
-    'paste.deploy',
-    'kombu',
-    'babel',
-    'anyjson',
+    'itsdangerous',
+    'google.cloud',
+    'grpc',
+    'cachetools',
+    'virtualenv',
+    'google.auth',
     'py',
+    'pluggy',
+    'scipy',
+    'boto',
+    'coverage',
+    'mock',
     'OpenSSL',
-    'numpy',
-    'sphinx',
+    'sklearn',
+    'jsonschema',
+    'argparse',
+    'more_itertools',
+    'pygments',
+    'psycopg2',
+    'websocket',
+    'PIL',
+    'googleapiclient',
+    'httplib2',
+    'matplotlib',
+    'oauth2client',
+    'docopt',
     'tornado',
-    'zope.interface',
-    'itsdangerous',
-    'fabric',
-    'amqp',
-    'mako',
-    'pyflakes',
-    'concurrent.futures',
-    'pyparsing',
-    'celery',
-    'unittest2',
-    'setuptools_git',
-    'decorator',
-    'ordereddict',
-    'urllib3',
-    'iso8601',
-    'gunicorn',
-    'prettytable',
-    'webob',
-    'flake8',
-    'pytest',
-    'billiard',
-    'backports.ssl_match_hostname',
-    'south',
+    'funcsigs',
+    'lxml',
+    'prompt_toolkit',
+    'paramiko',
+    'jwt',
+    'IPython',
+    'docker',
+    'dockerpycreds',
+    'oauthlib',
+    'mccabe',
+    'google.resumable_media',
+    'sqlalchemy',
+    'wrapt',
+    'bcrypt',
+    'ptyprocess',
+    'requests_oauthlib',
+    'multidict',
+    'markdown',
+    'pexpect',
+    'atomicwrites',
+    'uritemplate',
+    'nacl',
+    'pycodestyle',
+    'elasticsearch',
+    'absl',
+    'aiohttp',
+    'redis',
+    'sklearn',
     'gevent',
-    'netaddr',
-    'pylint',
-    'logilab.common',
-    'twisted',
-    'msgpack',
-    'blessings',
-    'oauth2client',
+    'pymysql',
+    'wcwidth',
+    'tqdm',
+    'bs4',
+    'functools32',
+    'configparser',
+    'gunicorn',
+    'typing',
     'ujson',
-    'mozrunner',
-    'googleapiclient',
-    'markdown',
-    'pyasn1',
+    'pyflakes',
+    'packaging',
+    'lazy_object_proxy',
+    'ipython_genutils',
+    'toolz',
+    'async_timeout',
+    'traitlets',
+    'kiwisolver',
+    'pathlib2',
+    'greenlet',
+    'networkx',
+    'cv2',
+    'termcolor',
+    'babel',
+    'django',
+    'pymemcache',
+    'skimage',
+    'pickleshare',
+    'flake8',
+    'cycler',
+    'requests_toolbelt',
+    'bleach',
+    'scandir',
+    'selenium',
+    'dask',
+    'websockets',
+    'isort',
+    'h5py',
+    'tabulate',
+    'tensorflow',
     'html5lib',
-    'isodate',
-    'tox',
-    'mozdevice',
-    'cython',
-    'raven',
-    'mozprocess',
-    'mozprofile',
-    'mozinfo',
-    'mozlog',
-    'pandas',
-    'lockfile',
-    'pycurl',
-    'novaclient',
-    'ply',
-    'eventlet',
-    'suds',
+    'pylint',
+    'tensorboard',
+    'compose',
+    'astroid',
+    'trueskill',
+    'webencodings',
+    'defusedxml',
+    'pykube',
+    'pymongo',
+    'retrying',
+    'cached_property',
+    'zope',
+    'singledispatch',
+    'tzlocal',
+    'datadog',
     'zmq',
-    'memcache',
-    'netifaces',
-    'repoze.lru',
-    'testtools',
-    'cups',
-    'oauth2',
-    'scipy',
-    'thrift',
-    'statsd',
-    'BeautifulSoup',
-    'bs4',
-    'sklearn',
-    'cmd2',
-    'alembic',
-    'gflags',
-    'gflags_validators',
-    'sqlparse',
-    'debug_toolbar',
-    'cov_core',
-    'unidecode',
-    'websocket',
-    'webtest',
-    'django_extensions',
-    'networkx',
-    'newrelic',
-    'pymysql',
+    'discord',
+    'apache_beam',
+    'subprocess32',
+    'astor',
+    'entrypoints',
+    'gast',
+    'nose',
+    'smmap',
+    'gitdb',
+    'isodate',
+    'pywt',
+    'simplegeneric',
+    'sortedcontainers',
+    'psycopg2',
     'pytest_cov',
-    'matplotlib',
-    'djcelery',
-    'google.protobuf',
-    'compressor',
-    'aspen',
-    'subunit',
-    'libcloud',
-    'versiontools',
-    'chardet',
-    'blinker',
-    'pystache',
-    'passlib',
-    'xlrd',
-    'pygeoip',
-    'configobj',
-    'cjson',
-    'testrepository',
-    'zc.recipe.egg',
-    'jsonpointer',
-    'amqplib',
-    'rdflib',
-    'SPARQLWrapper',
-    'jsonpatch',
-    'mrjob',
-    'pexpect',
-    'google.apputils',
-    'ansible',
-    'django_nose',
-    'd2to1',
-    'routes',
-    'tempita',
-    'testscenarios',
-    'demjson',
-    'openid',
-    'uwsgidecorators',
-    'wtforms',
-    'dns',
-    'alabaster',
-    'M2Crypto',
-    'reportlab',
-    'feedparser',
-    'ldap',
-    'hgtools',
-    'whoosh',
-    'path',
-    'nosexcover',
-    'iptools',
-    'xlwt',
-    'keyring',
-    'termcolor',
-    'flask_sqlalchemy',
-    'httpretty',
-    'magic',
-    'leaderboard',
-    'sqlobject',
-    'nltk',
+    'hiredis',
+    'elasticsearch_dsl',
+    'dill',
+    'keras',
+    'contextlib2',
+    'hdfs',
+    'jupyter_core',
+    'typed_ast',
+    'croniter',
+    'azure',
+    'nbformat',
+    'xmltodict',
+    'lockfile',
+    'arrow',
+    'parso',
+    'jsonpickle',
 
     # Skipped (name considered too generic):
     # - fixtures


Test patch: