summaryrefslogtreecommitdiff
path: root/pkg_resources/py2_warn.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-05-24 16:40:40 -0400
committerJason R. Coombs <jaraco@jaraco.com>2020-05-24 16:40:40 -0400
commit7306811598b51bfe726850ce4b061a6e389d5b80 (patch)
tree907882aecc017d26f925f70d003371124a507d0f /pkg_resources/py2_warn.py
parent8f1f09b7f93f2fa86bafcd6502ec51d4680b4499 (diff)
parent52c394c1e87b863aec92949e4b494ab01a7cd234 (diff)
downloadpython-setuptools-git-7306811598b51bfe726850ce4b061a6e389d5b80.tar.gz
Merge branch 'master' into docs_ci
Diffstat (limited to 'pkg_resources/py2_warn.py')
-rw-r--r--pkg_resources/py2_warn.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/pkg_resources/py2_warn.py b/pkg_resources/py2_warn.py
new file mode 100644
index 00000000..bfc35234
--- /dev/null
+++ b/pkg_resources/py2_warn.py
@@ -0,0 +1,21 @@
+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 follow up at
+ https://bit.ly/setuptools-py2-warning.
+ """)
+
+pre = "Setuptools will stop working on Python 2\n"
+
+sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)