Skip to content

Commit 59052c5

Browse files
authored
Merge pull request #4343 from dstufft/no-2.6
Drop support for Python 2.6
2 parents b005a9b + 16944a6 commit 59052c5

35 files changed

+60
-843
lines changed

.travis.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ matrix:
77
- env: TOXENV=pep8
88
- env: TOXENV=py3pep8
99
- env: TOXENV=packaging
10-
- python: 2.6 # these are just to make travis's UI a bit prettier
11-
env: TOXENV=py26
1210
- python: 2.7
1311
env: TOXENV=py27
1412
- python: 3.3

CHANGES.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
**9.1.0 (UNRELEASED)**
1+
**10.0.0 (UNRELEASED)**
2+
3+
* **BACKWARD INCOMPATIBLE** Dropped support for Python 2.6.
24

35
* **WARNING** pip 9.1 cache format has changed. Old versions of pip cannot
46
read cache entries written by 9.1 but will handle this gracefully by

docs/installing.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ speed), although neither are required to install pre-built :term:`wheels
4646
.. note::
4747

4848
The get-pip.py script is supported on the same python version as pip.
49-
For the now unsupported Python 3.2, an alternate script is available
50-
`here <https://bootstrap.pypa.io/3.2/get-pip.py>`__. For Python 2.6
51-
which will be unsupported in pip 10.0, an alternative script is available
49+
For the now unsupported Python 2.6, alternate script is available
5250
`here <https://bootstrap.pypa.io/2.6/get-pip.py>`__.
5351

5452

@@ -110,11 +108,10 @@ On Windows [5]_:
110108
Python and OS Compatibility
111109
---------------------------
112110

113-
pip works with CPython versions 2.6, 2.7, 3.3, 3.4, 3.5 and also pypy.
111+
pip works with CPython versions 2.7, 3.3, 3.4, 3.5, 3.6 and also pypy.
114112

115-
This means pip works on the latest patch version of each of these minor versions
116-
(i.e. 2.6.9 for 2.6, etc).
117-
Previous patch versions are supported on a best effort approach.
113+
This means pip works on the latest patch version of each of these minor
114+
versions. Previous patch versions are supported on a best effort approach.
118115

119116
pip works on Unix/Linux, macOS, and Windows.
120117

pip/_vendor/html5lib/filters/alphabeticalattributes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
try:
66
from collections import OrderedDict
77
except ImportError:
8-
from pip._vendor.ordereddict import OrderedDict
8+
from ordereddict import OrderedDict
99

1010

1111
class Filter(base.Filter):

pip/_vendor/html5lib/html5parser.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
try:
77
from collections import OrderedDict
88
except ImportError:
9-
from pip._vendor.ordereddict import OrderedDict
9+
from ordereddict import OrderedDict
1010

1111
from . import _inputstream
1212
from . import _tokenizer

pip/_vendor/html5lib/treewalkers/etree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from collections import OrderedDict
55
except ImportError:
66
try:
7-
from pip._vendor.ordereddict import OrderedDict
7+
from ordereddict import OrderedDict
88
except ImportError:
99
OrderedDict = dict
1010

pip/_vendor/ordereddict.py

Lines changed: 0 additions & 127 deletions
This file was deleted.

pip/_vendor/pyparsing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class names, and the use of '+', '|' and '^' operators.
8686
from collections import OrderedDict as _OrderedDict
8787
except ImportError:
8888
try:
89-
from pip._vendor.ordereddict import OrderedDict as _OrderedDict
89+
from ordereddict import OrderedDict as _OrderedDict
9090
except ImportError:
9191
_OrderedDict = None
9292

pip/_vendor/vendor.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ colorama==0.3.7
77
CacheControl==0.12.1
88
msgpack-python==0.4.8
99
lockfile==0.12.2
10-
ordereddict==1.1 # Only needed on 2.6
1110
progress==1.2
1211
ipaddress==1.0.18 # Only needed on 2.6 and 2.7
1312
packaging==16.8

pip/basecommand.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
from __future__ import absolute_import
33

44
import logging
5+
import logging.config
56
import os
67
import sys
78
import optparse
8-
import warnings
99

1010
from pip import cmdoptions
1111
from pip.index import PackageFinder
@@ -14,14 +14,13 @@
1414
from pip.exceptions import (BadCommand, InstallationError, UninstallationError,
1515
CommandError, PreviousBuildDirError)
1616

17-
from pip.compat import logging_dictConfig
1817
from pip.baseparser import ConfigOptionParser, UpdatingDefaultsHelpFormatter
1918
from pip.req import InstallRequirement, parse_requirements
2019
from pip.status_codes import (
2120
SUCCESS, ERROR, UNKNOWN_ERROR, VIRTUALENV_NOT_FOUND,
2221
PREVIOUS_BUILD_DIR_ERROR,
2322
)
24-
from pip.utils import deprecation, get_prog, normalize_path
23+
from pip.utils import get_prog, normalize_path
2524
from pip.utils.logging import IndentingFormatter
2625
from pip.utils.outdated import pip_version_check
2726

@@ -123,7 +122,7 @@ def main(self, args):
123122
if options.log:
124123
root_level = "DEBUG"
125124

126-
logging_dictConfig({
125+
logging.config.dictConfig({
127126
"version": 1,
128127
"disable_existing_loggers": False,
129128
"filters": {
@@ -186,14 +185,6 @@ def main(self, args):
186185
),
187186
})
188187

189-
if sys.version_info[:2] == (2, 6):
190-
warnings.warn(
191-
"Python 2.6 is no longer supported by the Python core team, "
192-
"please upgrade your Python. A future version of pip will "
193-
"drop support for Python 2.6",
194-
deprecation.Python26DeprecationWarning
195-
)
196-
197188
# TODO: try to get these passing down from the command?
198189
# without resorting to os.environ to hold these.
199190

pip/commands/download.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ def run(self, options, args):
135135
options.abi,
136136
options.implementation,
137137
])
138-
binary_only = FormatControl(set(), set([':all:']))
138+
binary_only = FormatControl(set(), {':all:'})
139139
if dist_restriction_set and options.format_control != binary_only:
140140
raise CommandError(
141141
"--only-binary=:all: must be set and --no-binary must not "

pip/commands/freeze.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from pip.wheel import WheelCache
1010

1111

12-
DEV_PKGS = ('pip', 'setuptools', 'distribute', 'wheel')
12+
DEV_PKGS = {'pip', 'setuptools', 'distribute', 'wheel'}
1313

1414

1515
class FreezeCommand(Command):

pip/commands/search.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
import sys
55
import textwrap
66

7+
from collections import OrderedDict
8+
79
from pip.basecommand import Command, SUCCESS
8-
from pip.compat import OrderedDict
910
from pip.download import PipXmlrpcTransport
1011
from pip.models import PyPI
1112
from pip.utils import get_terminal_size

pip/compat/__init__.py renamed to pip/compat.py

Lines changed: 3 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77

88
from pip._vendor.six import text_type
99

10-
try:
11-
from logging.config import dictConfig as logging_dictConfig
12-
except ImportError:
13-
from pip.compat.dictconfig import dictConfig as logging_dictConfig
14-
15-
try:
16-
from collections import OrderedDict
17-
except ImportError:
18-
from pip._vendor.ordereddict import OrderedDict
19-
2010
try:
2111
import ipaddress
2212
except ImportError:
@@ -28,30 +18,9 @@
2818
ipaddress.ip_network = ipaddress.IPNetwork
2919

3020

31-
try:
32-
import sysconfig
33-
34-
def get_stdlib():
35-
paths = [
36-
sysconfig.get_path("stdlib"),
37-
sysconfig.get_path("platstdlib"),
38-
]
39-
return set(filter(bool, paths))
40-
except ImportError:
41-
from distutils import sysconfig
42-
43-
def get_stdlib():
44-
paths = [
45-
sysconfig.get_python_lib(standard_lib=True),
46-
sysconfig.get_python_lib(standard_lib=True, plat_specific=True),
47-
]
48-
return set(filter(bool, paths))
49-
50-
5121
__all__ = [
52-
"logging_dictConfig", "ipaddress", "uses_pycache", "console_to_str",
53-
"native_str", "get_path_uid", "stdlib_pkgs", "WINDOWS", "samefile",
54-
"OrderedDict",
22+
"ipaddress", "uses_pycache", "console_to_str", "native_str",
23+
"get_path_uid", "stdlib_pkgs", "WINDOWS", "samefile",
5524
]
5625

5726

@@ -90,14 +59,6 @@ def native_str(s, replace=False):
9059
return s
9160

9261

93-
def total_seconds(td):
94-
if hasattr(td, "total_seconds"):
95-
return td.total_seconds()
96-
else:
97-
val = td.microseconds + (td.seconds + td.days * 24 * 3600) * 10 ** 6
98-
return val / 10 ** 6
99-
100-
10162
def get_path_uid(path):
10263
"""
10364
Return path's uid.
@@ -144,9 +105,7 @@ def expanduser(path):
144105
# dist.location (py27:`sysconfig.get_paths()['stdlib']`,
145106
# py26:sysconfig.get_config_vars('LIBDEST')), but fear platform variation may
146107
# make this ineffective, so hard-coding
147-
stdlib_pkgs = ('python', 'wsgiref')
148-
if sys.version_info >= (2, 7):
149-
stdlib_pkgs += ('argparse',)
108+
stdlib_pkgs = {"python", "wsgiref", "argparse"}
150109

151110

152111
# windows detection, covers cpython and ironpython

0 commit comments

Comments
 (0)