py2_warn.py 655 B

123456789101112131415161718192021
  1. import sys
  2. import warnings
  3. import textwrap
  4. msg = textwrap.dedent("""
  5. You are running Setuptools on Python 2, which is no longer
  6. supported and
  7. >>> SETUPTOOLS WILL STOP WORKING <<<
  8. in a subsequent release (no sooner than 2020-04-20).
  9. Please ensure you are installing
  10. Setuptools using pip 9.x or later or pin to `setuptools<45`
  11. in your environment.
  12. If you have done those things and are still encountering
  13. this message, please follow up at
  14. https://bit.ly/setuptools-py2-warning.
  15. """)
  16. pre = "Setuptools will stop working on Python 2\n"
  17. sys.version_info < (3,) and warnings.warn(pre + "*" * 60 + msg + "*" * 60)