From: "Michael R. Crusoe" <crusoe@debian.org>
Date: Wed, 14 Aug 2024 15:44:10 +0200
Subject: point to python3-typeshed package for missing types

Co-authored-by: Markus Demleitner <msdemlei@fsfe.org>
Forwarded: not-needed
---
 mypy/modulefinder.py                     | 4 +++-
 test-data/unit/check-modules.test        | 4 ++--
 test-data/unit/fine-grained-modules.test | 4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/mypy/modulefinder.py b/mypy/modulefinder.py
index 49c39a9..056136d 100644
--- a/mypy/modulefinder.py
+++ b/mypy/modulefinder.py
@@ -84,7 +84,9 @@ class ModuleNotFoundReason(Enum):
             notes = [doc_link]
         elif self is ModuleNotFoundReason.APPROVED_STUBS_NOT_INSTALLED:
             msg = 'Library stubs not installed for "{module}"'
-            notes = ['Hint: "python3 -m pip install {stub_dist}"']
+            notes = ['Hint: On Debian systems, you can install the python3-typeshed package to '
+                     'provide mypy with stubs for many popular libraries. '
+                     'In virtual Python environments, you can instead run "python3 -m pip install {stub_dist}".']
             if not daemon:
                 notes.append(
                     '(or run "mypy --install-types" to install all missing stub packages)'
diff --git a/test-data/unit/check-modules.test b/test-data/unit/check-modules.test
index 5fd4857..4b4493a 100644
--- a/test-data/unit/check-modules.test
+++ b/test-data/unit/check-modules.test
@@ -3130,7 +3130,7 @@ import google.non_existent  # E: Cannot find implementation or library stub for
 from google.non_existent import x
 
 import google.cloud.ndb  # E: Library stubs not installed for "google.cloud.ndb" \
-                         # N: Hint: "python3 -m pip install types-google-cloud-ndb" \
+                         # N: Hint: On Debian systems, you can install the python3-typeshed package to provide mypy with stubs for many popular libraries. In virtual Python environments, you can instead run "python3 -m pip install types-google-cloud-ndb". \
                          # N: (or run "mypy --install-types" to install all missing stub packages) \
                          # N: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
 from google.cloud import ndb
@@ -3141,7 +3141,7 @@ from bleach.abc import fgh
 [file bleach/__init__.pyi]
 [out]
 main:1: error: Library stubs not installed for "bleach.xyz"
-main:1: note: Hint: "python3 -m pip install types-bleach"
+main:1: note: Hint: On Debian systems, you can install the python3-typeshed package to provide mypy with stubs for many popular libraries. In virtual Python environments, you can instead run "python3 -m pip install types-bleach".
 main:1: note: (or run "mypy --install-types" to install all missing stub packages)
 main:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
 main:2: error: Library stubs not installed for "bleach.abc"
diff --git a/test-data/unit/fine-grained-modules.test b/test-data/unit/fine-grained-modules.test
index f28dbaa..6273fbf 100644
--- a/test-data/unit/fine-grained-modules.test
+++ b/test-data/unit/fine-grained-modules.test
@@ -2199,12 +2199,12 @@ import requests
 import jack
 [out]
 a.py:1: error: Library stubs not installed for "requests"
-a.py:1: note: Hint: "python3 -m pip install types-requests"
+a.py:1: note: Hint: On Debian systems, you can install the python3-typeshed package to provide mypy with stubs for many popular libraries. In virtual Python environments, you can instead run "python3 -m pip install types-requests".
 a.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
 ==
 ==
 a.py:1: error: Library stubs not installed for "jack"
-a.py:1: note: Hint: "python3 -m pip install types-JACK-Client"
+a.py:1: note: Hint: On Debian systems, you can install the python3-typeshed package to provide mypy with stubs for many popular libraries. In virtual Python environments, you can instead run "python3 -m pip install types-JACK-Client".
 a.py:1: note: See https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-imports
 
 [case testIgnoreErrorsFromTypeshed]
