Repository: pypa/setuptools

Issue:
[BUG] Messages use dubious link shortener services instead of canonical URLs
### setuptools version

40.8.0

### Python version

3.7.3

### OS

10.13

### Additional environment information

I encounter this when running the Debian packaging scripts, but it is not peculiar to Debian's patched version of setuptools.

### Description

A message of the following form may appear when setuptools is invoked:

```console
Note: Bypassing https://pypi.org/simple/setuptools_scm/ (disallowed host; see http://bit.ly/2hrImnY for details).
```

This text can be found in the following location in the sources:

https://github.com/pypa/setuptools/blob/main/setuptools/package_index.py#L405

### Expected behavior

Link-shortened URLs should not be used. The services involved may not remain available, they may not guarantee that the target URL remain the same, and such services may even be subverted by malicious parties. When someone uses setuptools, their screen space is generally not so limited that they cannot tolerate a full-length URL. Instead, canonical URLs referencing a trusted site should be employed.

### How to Reproduce

Examine the source code to "reproduce" the bug.

### Output

```console
Note: Bypassing https://pypi.org/simple/setuptools_scm/ (disallowed host; see http://bit.ly/2hrImnY for details).
```



Discussion:
Bug #1197 rather makes my point about link stability.
The link is wrong anyway. it resolves to `https://setuptools.readthedocs.io/en/latest/easy_install.html#restricting-downloads-with-allow-hosts` which now redirects to `https://setuptools.pypa.io/en/latest/easy_install.html#restricting-downloads-with-allow-hosts`, and that page doesn't exist (and hasn't since #2097)

Resolving patch:
diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py
--- a/setuptools/command/easy_install.py
+++ b/setuptools/command/easy_install.py
@@ -1845,7 +1845,7 @@ def _update_zipimporter_cache(normalized_path, cache, updater=None):
         #    get/del patterns instead. For more detailed information see the
         #    following links:
         #      https://github.com/pypa/setuptools/issues/202#issuecomment-202913420
-        #      http://bit.ly/2h9itJX
+        #      https://foss.heptapod.net/pypy/pypy/-/blob/144c4e65cb6accb8e592f3a7584ea38265d1873c/pypy/module/zipimport/interp_zipimport.py
         old_entry = cache[p]
         del cache[p]
         new_entry = updater and updater(p, old_entry)
diff --git a/setuptools/config/setupcfg.py b/setuptools/config/setupcfg.py
--- a/setuptools/config/setupcfg.py
+++ b/setuptools/config/setupcfg.py
@@ -786,4 +786,4 @@ def message(cls, **kw):
 
 
 class _DeprecatedConfig(SetuptoolsDeprecationWarning):
-    _SEE_DOCS = "https://setuptools.pypa.io/en/latest/userguide/declarative_config.html"
+    _SEE_DOCS = "userguide/declarative_config.html"
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -402,7 +402,8 @@ def url_ok(self, url, fatal=False):
             return True
         msg = (
             "\nNote: Bypassing %s (disallowed host; see "
-            "http://bit.ly/2hrImnY for details).\n"
+            "https://setuptools.pypa.io/en/latest/deprecated/"
+            "easy_install.html#restricting-downloads-with-allow-hosts for details).\n"
         )
         if fatal:
             raise DistutilsError(msg % url)


Test patch: