Commit 64b1a6fa authored by Jason R. Coombs's avatar Jason R. Coombs

Force fail on Python 2. When doing so, emit an error that directs users to the...

Force fail on Python 2. When doing so, emit an error that directs users to the latest guidance. Fixes #2094.
parent 46dab46d
...@@ -28,6 +28,7 @@ Your first course of action should be to reason about how you managed to get an ...@@ -28,6 +28,7 @@ Your first course of action should be to reason about how you managed to get an
<!-- These are the recommended workarounds for the issue. Please <!-- These are the recommended workarounds for the issue. Please
try them first. --> try them first. -->
- [ ] Read [Python 2 Sunset docs](https://setuptools.readthedocs.io/en/latest/python%202%20sunset.html).
- [ ] Python 2 is required for this application. - [ ] Python 2 is required for this application.
- [ ] I maintain the software that installs Setuptools (if not, please contact that project). - [ ] I maintain the software that installs Setuptools (if not, please contact that project).
- [ ] Setuptools installed with pip 9 or later. - [ ] Setuptools installed with pip 9 or later.
......
...@@ -4,11 +4,6 @@ language: python ...@@ -4,11 +4,6 @@ language: python
jobs: jobs:
fast_finish: true fast_finish: true
include: include:
- &latest_py2
python: 2.7
env: TOXENV=py27
- <<: *latest_py2
env: LANG=C TOXENV=py27
- python: pypy3 - python: pypy3
env: DISABLE_COVERAGE=1 # Don't run coverage on pypy (too slow). env: DISABLE_COVERAGE=1 # Don't run coverage on pypy (too slow).
- python: 3.5 - python: 3.5
......
...@@ -4,18 +4,13 @@ import textwrap ...@@ -4,18 +4,13 @@ import textwrap
msg = textwrap.dedent(""" msg = textwrap.dedent("""
You are running Setuptools on Python 2, which is no longer Encountered a version of Setuptools that no longer supports
supported and this version of Python. Please head to
>>> SETUPTOOLS WILL STOP WORKING <<< https://bit.ly/setuptools-py2-warning for support.
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" pre = "Setuptools no longer works on Python 2\n"
sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60) if sys.version_info < (3,):
warnings.warn(pre + "*" * 60 + msg + "*" * 60)
raise SystemExit(32)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment