aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2020-01-11 23:32:24 -0500
committerGitHub <noreply@github.com>2020-01-11 23:32:24 -0500
commit6449c5b745b2e664b05a4ac88ed8776d6d4f2a42 (patch)
tree35ee4efb65a320eabc36ddabd9b8eeffb7b8ec13
parent70b3ec0bf0f61d6b7de1beff4bad4b845d836100 (diff)
parent79f1694b05a66cc0fbbbf4e72d63d0a340cf6d84 (diff)
downloadexternal_python_setuptools-6449c5b745b2e664b05a4ac88ed8776d6d4f2a42.tar.gz
external_python_setuptools-6449c5b745b2e664b05a4ac88ed8776d6d4f2a42.tar.bz2
external_python_setuptools-6449c5b745b2e664b05a4ac88ed8776d6d4f2a42.zip
Merge pull request #1955 from pypa/drop-py2
Require Python 3.5 or later, dropping support for Python 2.
-rw-r--r--.travis.yml8
-rw-r--r--appveyor.yml4
-rw-r--r--changelog.d/1458.breaking.rst1
-rw-r--r--pkg_resources/__init__.py1
-rw-r--r--pkg_resources/py2_warn.py19
-rw-r--r--setup.cfg4
6 files changed, 25 insertions, 12 deletions
diff --git a/.travis.yml b/.travis.yml
index 501a0b69..d18b86c0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -4,14 +4,8 @@ language: python
jobs:
fast_finish: true
include:
- - &latest_py2
- python: 2.7
- - <<: *latest_py2
- env: LANG=C
- - python: pypy
- env: DISABLE_COVERAGE=1 # Don't run coverage on pypy (too slow).
- python: pypy3
- env: DISABLE_COVERAGE=1
+ env: DISABLE_COVERAGE=1 # Don't run coverage on pypy (too slow).
- python: 3.5
- python: 3.6
- python: 3.7
diff --git a/appveyor.yml b/appveyor.yml
index 08818069..fc65a9a7 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -9,8 +9,8 @@ environment:
matrix:
- APPVEYOR_JOB_NAME: "python36-x64"
PYTHON: "C:\\Python36-x64"
- - APPVEYOR_JOB_NAME: "python27-x64"
- PYTHON: "C:\\Python27-x64"
+ - APPVEYOR_JOB_NAME: "python37-x64"
+ PYTHON: "C:\\Python37-x64"
install:
# symlink python from a directory with a space
diff --git a/changelog.d/1458.breaking.rst b/changelog.d/1458.breaking.rst
new file mode 100644
index 00000000..3004722c
--- /dev/null
+++ b/changelog.d/1458.breaking.rst
@@ -0,0 +1 @@
+Drop support for Python 2. Setuptools now requires Python 3.5 or later. Install setuptools using pip >=9 or pin to Setuptools <45 to maintain 2.7 support.
diff --git a/pkg_resources/__init__.py b/pkg_resources/__init__.py
index 2f5aa64a..3fa883ce 100644
--- a/pkg_resources/__init__.py
+++ b/pkg_resources/__init__.py
@@ -83,6 +83,7 @@ __import__('pkg_resources.extern.packaging.version')
__import__('pkg_resources.extern.packaging.specifiers')
__import__('pkg_resources.extern.packaging.requirements')
__import__('pkg_resources.extern.packaging.markers')
+__import__('pkg_resources.py2_warn')
__metaclass__ = type
diff --git a/pkg_resources/py2_warn.py b/pkg_resources/py2_warn.py
new file mode 100644
index 00000000..1f29851c
--- /dev/null
+++ b/pkg_resources/py2_warn.py
@@ -0,0 +1,19 @@
+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. 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.
+ """)
+
+sys.version_info < (3,) and warnings.warn("*" * 60 + msg + "*" * 60)
diff --git a/setup.cfg b/setup.cfg
index ecef8609..1e23051f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -35,8 +35,6 @@ classifiers =
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Operating System :: OS Independent
- Programming Language :: Python :: 2
- Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.5
Programming Language :: Python :: 3.6
@@ -49,7 +47,7 @@ classifiers =
[options]
zip_safe = True
-python_requires = >=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*
+python_requires = >=3.5
py_modules = easy_install
packages = find: