summaryrefslogtreecommitdiff
path: root/pkg_resources/py2_warn.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-02-11 22:15:31 -0500
committerJason R. Coombs <jaraco@jaraco.com>2020-02-11 22:15:31 -0500
commitce8e3ee174ed9dee84aa08a461fb174ac1e53535 (patch)
treeda78c024b4491210e61b73e9e2f755d46c8bc1ff /pkg_resources/py2_warn.py
parent53b8523fdfa19173d2e6b11d6b4d175f54b9dfea (diff)
parenta5dec2f14e3414e4ee5dd146bff9c289d573de9a (diff)
downloadpython-setuptools-git-ce8e3ee174ed9dee84aa08a461fb174ac1e53535.tar.gz
Merge branch 'master' into fix/1557
Diffstat (limited to 'pkg_resources/py2_warn.py')
-rw-r--r--pkg_resources/py2_warn.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/pkg_resources/py2_warn.py b/pkg_resources/py2_warn.py
new file mode 100644
index 00000000..1b151956
--- /dev/null
+++ b/pkg_resources/py2_warn.py
@@ -0,0 +1,22 @@
+import sys
+import warnings
+import textwrap
+
+
+msg = textwrap.dedent("""
+ You are running Setuptools on Python 2, which is no longer
+ supported and
+ >>> SETUPTOOLS WILL STOP WORKING <<<
+ in a subsequent release (no sooner than 2020-04-20).
+ Please ensure you are installing
+ Setuptools using pip 9.x or later or pin to `setuptools<45`
+ in your environment.
+ If you have done those things and are still encountering
+ this message, please comment in
+ https://github.com/pypa/setuptools/issues/1458
+ about the steps that led to this unsupported combination.
+ """)
+
+pre = "Setuptools will stop working on Python 2\n"
+
+sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)