diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2020-01-14 04:14:13 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2020-01-14 04:16:12 -0500 |
| commit | 18a3cae3513818d355dbc8c05ff93bbcee09a6d5 (patch) | |
| tree | 51e15fb569620d313558d606effa96e2e83efced | |
| parent | 71aa3327fdf7ea23d5b9a6a891460330f14ff196 (diff) | |
| download | python-setuptools-git-18a3cae3513818d355dbc8c05ff93bbcee09a6d5.tar.gz | |
Update Python 2 warning to include a minimum sunset date and add a preamble to make referencing the warning more reliable. Ref #1458.
| -rw-r--r-- | changelog.d/1458.change.rst | 1 | ||||
| -rw-r--r-- | pkg_resources/py2_warn.py | 7 |
2 files changed, 6 insertions, 2 deletions
diff --git a/changelog.d/1458.change.rst b/changelog.d/1458.change.rst new file mode 100644 index 00000000..c953127a --- /dev/null +++ b/changelog.d/1458.change.rst @@ -0,0 +1 @@ +Add minimum sunset date and preamble to Python 2 warning. diff --git a/pkg_resources/py2_warn.py b/pkg_resources/py2_warn.py index 1f29851c..1b151956 100644 --- a/pkg_resources/py2_warn.py +++ b/pkg_resources/py2_warn.py @@ -7,7 +7,8 @@ msg = textwrap.dedent(""" You are running Setuptools on Python 2, which is no longer supported and >>> SETUPTOOLS WILL STOP WORKING <<< - in a subsequent release. Please ensure you are installing + 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 @@ -16,4 +17,6 @@ msg = textwrap.dedent(""" about the steps that led to this unsupported combination. """) -sys.version_info < (3,) and warnings.warn("*" * 60 + msg + "*" * 60) +pre = "Setuptools will stop working on Python 2\n" + +sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60) |
