Deprecate support for Python 3.3

This commit is contained in:
Donald Stufft 2017-03-21 07:28:22 -04:00
parent 476d297ff6
commit 6b54145783
6 changed files with 16 additions and 29 deletions

1
news/3796.removal Normal file
View File

@ -0,0 +1 @@
Deprecate support for Python 3.3.

View File

@ -6,6 +6,7 @@ import logging.config
import os import os
import sys import sys
import optparse import optparse
import warnings
from pip import cmdoptions from pip import cmdoptions
from pip.index import PackageFinder from pip.index import PackageFinder
@ -20,7 +21,7 @@ from pip.status_codes import (
SUCCESS, ERROR, UNKNOWN_ERROR, VIRTUALENV_NOT_FOUND, SUCCESS, ERROR, UNKNOWN_ERROR, VIRTUALENV_NOT_FOUND,
PREVIOUS_BUILD_DIR_ERROR, PREVIOUS_BUILD_DIR_ERROR,
) )
from pip.utils import get_prog, normalize_path from pip.utils import deprecation, get_prog, normalize_path
from pip.utils.logging import IndentingFormatter from pip.utils.logging import IndentingFormatter
from pip.utils.outdated import pip_version_check from pip.utils.outdated import pip_version_check
@ -185,6 +186,13 @@ class Command(object):
), ),
}) })
if sys.version_info[:2] == (3, 3):
warnings.warn(
"Python 3.3 supported has been deprecated and support for it "
"will be dropped in the future. Please upgrade your Python.",
deprecation.RemovedInPip11Warning,
)
# TODO: try to get these passing down from the command? # TODO: try to get these passing down from the command?
# without resorting to os.environ to hold these. # without resorting to os.environ to hold these.

View File

@ -70,7 +70,7 @@ def test_pip_second_command_line_interface_works(script, data):
# On old versions of Python, urllib3/requests will raise a warning about # On old versions of Python, urllib3/requests will raise a warning about
# the lack of an SSLContext. # the lack of an SSLContext.
kwargs = {} kwargs = {}
if pyversion_tuple < (2, 7, 9): if pyversion_tuple < (2, 7, 9) or pyversion_tuple[:2] == (3, 3):
kwargs['expect_stderr'] = True kwargs['expect_stderr'] = True
args = ['pip%s' % pyversion] args = ['pip%s' % pyversion]

View File

@ -1,4 +1,3 @@
import json
import os import os
import sys import sys
import textwrap import textwrap
@ -449,27 +448,3 @@ class TestUpgradeDistributeToSetuptools(object):
cwd=pip_src, cwd=pip_src,
expect_stderr=True, expect_stderr=True,
) )
@pytest.mark.skipif(
sys.version_info >= (3, 5),
reason="distribute doesn't work on Python 3.5",
)
def test_from_distribute_6_to_setuptools_7(
self, script, data, virtualenv):
self.prep_ve(
script, '1.9.1', virtualenv.pip_source_dir, distribute=True
)
result = self.script.run(
self.ve_bin / 'pip', 'install', '--no-index',
'--find-links=%s' % data.find_links, '-U', 'distribute',
)
assert (
"Found existing installation: distribute 0.6.34" in result.stdout
)
result = self.script.run(
self.ve_bin / 'pip', 'list', '--format=json',
)
assert {"name": "setuptools", "version": "0.9.8"} \
in json.loads(result.stdout)
assert {"name": "distribute", "version": "0.7.3"} \
in json.loads(result.stdout)

View File

@ -54,11 +54,11 @@ def test_simple_uninstall_distutils(script):
in json.loads(result.stdout) in json.loads(result.stdout)
result = script.pip('uninstall', 'distutils_install', '-y', result = script.pip('uninstall', 'distutils_install', '-y',
expect_stderr=True, expect_error=True) expect_stderr=True, expect_error=True)
assert result.stderr.strip() == ( assert (
"Cannot uninstall 'distutils-install'. It is a distutils installed " "Cannot uninstall 'distutils-install'. It is a distutils installed "
"project and thus we cannot accurately determine which files belong " "project and thus we cannot accurately determine which files belong "
"to it which would lead to only a partial uninstall." "to it which would lead to only a partial uninstall."
) ) in result.stderr
@pytest.mark.network @pytest.mark.network

View File

@ -334,6 +334,9 @@ class PipTestEnvironment(scripttest.TestFileEnvironment):
if (pyversion_tuple < (2, 7, 9) and if (pyversion_tuple < (2, 7, 9) and
args and args[0] in ('search', 'install', 'download')): args and args[0] in ('search', 'install', 'download')):
kwargs['expect_stderr'] = True kwargs['expect_stderr'] = True
# Python 3.3 is deprecated and we emit a warning on it.
if pyversion_tuple[:2] == (3, 3):
kwargs['expect_stderr'] = True
return self.run("pip", *args, **kwargs) return self.run("pip", *args, **kwargs)