Skip to content

Commit af02ef6

Browse files
authored
Merge pull request #371 from jdufresne/doc-drop
Undocument support for EOL Python 2.6 and 3.3
2 parents 58c785c + 37d1d12 commit af02ef6

15 files changed

+33
-115
lines changed

TESTING.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Currently the tests are passing on OS X and Linux on Python 2.6, 2.7, 3.3 and 3.4.
1+
Currently the tests are passing on OS X and Linux on Python 2.7 and 3.4.
22

33
The test suite can be run either with:
44

docs/compatible_idioms.rst

Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ video is here: http://www.youtube.com/watch?v=KOqk8j11aAI&t=10m14s.)
1616

1717
Minimum versions:
1818

19-
- Python 2: 2.6+
20-
- Python 3: 3.3+
19+
- Python 2: 2.7+
20+
- Python 3: 3.4+
2121

2222
Setup
2323
-----
@@ -1188,38 +1188,6 @@ commands / subprocess modules
11881188
standard_library.install_aliases()
11891189
11901190
from subprocess import getoutput, getstatusoutput
1191-
subprocess.check\_output()
1192-
~~~~~~~~~~~~~~~~~~~~~~~~~~
1193-
1194-
.. code:: python
1195-
1196-
# Python 2.7 and above
1197-
from subprocess import check_output
1198-
1199-
# Python 2.6 and above: alternative 1
1200-
from future.moves.subprocess import check_output
1201-
1202-
# Python 2.6 and above: alternative 2
1203-
from future import standard_library
1204-
standard_library.install_aliases()
1205-
1206-
from subprocess import check_output
1207-
collections: Counter and OrderedDict
1208-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1209-
1210-
.. code:: python
1211-
1212-
# Python 2.7 and above
1213-
from collections import Counter, OrderedDict
1214-
1215-
# Python 2.6 and above: alternative 1
1216-
from future.moves.collections import Counter, OrderedDict
1217-
1218-
# Python 2.6 and above: alternative 2
1219-
from future import standard_library
1220-
standard_library.install_aliases()
1221-
1222-
from collections import Counter, OrderedDict
12231191
StringIO module
12241192
~~~~~~~~~~~~~~~
12251193

docs/dev_notes.rst

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Notes
22
-----
3-
This module only supports Python 2.6, Python 2.7, and Python 3.1+.
3+
This module only supports Python 2.7, and Python 3.4+.
44

55
The following renames are already supported on Python 2.7 without any
66
additional work from us::
@@ -14,8 +14,3 @@ Old things that can one day be fixed automatically by futurize.py::
1414

1515
string.uppercase -> string.ascii_uppercase # works on either Py2.7 or Py3+
1616
sys.maxint -> sys.maxsize # but this isn't identical
17-
18-
TODO: Check out these:
19-
Not available on Py2.6:
20-
unittest2 -> unittest?
21-
buffer -> memoryview?

docs/development.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The easiest way to start developing ``python-future`` is as follows:
1010
2. Run::
1111

1212
conda install -n future2 python=2.7 pip
13-
conda install -n future3 python=3.3 pip
13+
conda install -n future3 python=3.4 pip
1414

1515
git clone https://github.com/PythonCharmers/python-future
1616

docs/dict_object.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ call to ``items``, ``values`` or ``keys``.
2727

2828
For improved efficiency, ``future.builtins`` (aliased to ``builtins``) provides
2929
a Python 2 ``dict`` subclass whose :func:`keys`, :func:`values`, and
30-
:func:`items` methods return iterators on all versions of Python >= 2.6. On
30+
:func:`items` methods return iterators on all versions of Python >= 2.7. On
3131
Python 2.7, these iterators also have the same set-like view behaviour as
3232
dictionaries in Python 3. This can streamline code that iterates over large
3333
dictionaries. For example::
@@ -43,10 +43,6 @@ dictionaries. For example::
4343
# Because items() is memory-efficient, so is this:
4444
d2 = dict((v, k) for (k, v) in d.items())
4545

46-
47-
On Python 2.6, these methods currently return iterators but do not support the
48-
new Py3 set-like behaviour.
49-
5046
As usual, on Python 3 ``dict`` imported from either ``builtins`` or
5147
``future.builtins`` is just the built-in ``dict`` class.
5248

@@ -90,7 +86,7 @@ The memory-efficient (and CPU-efficient) alternatives are:
9086
# Set union:
9187
both = viewvalues(d1) | viewvalues(d2)
9288

93-
For Python 2.6 compatibility, the functions ``iteritems`` etc. are also
94-
available in :mod:`future.utils`. These are equivalent to the functions of the
95-
same names in ``six``, which is equivalent to calling the ``iteritems`` etc.
96-
methods on Python 2, or to calling ``items`` etc. on Python 3.
89+
For compatibility, the functions ``iteritems`` etc. are also available in
90+
:mod:`future.utils`. These are equivalent to the functions of the same names in
91+
``six``, which is equivalent to calling the ``iteritems`` etc. methods on
92+
Python 2, or to calling ``items`` etc. on Python 3.

docs/faq.rst

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Who is this for?
55
================
66

77
1. People with existing or new Python 3 codebases who wish to provide
8-
ongoing Python 2.6 / 2.7 support easily and with little maintenance burden.
8+
ongoing Python 2.7 support easily and with little maintenance burden.
99

1010
2. People who wish to ease and accelerate migration of their Python 2 codebases
11-
to Python 3.3+, module by module, without giving up Python 2 compatibility.
11+
to Python 3.4+, module by module, without giving up Python 2 compatibility.
1212

1313

1414
Why upgrade to Python 3?
@@ -217,15 +217,15 @@ complete set of support for Python 3's features, including backports of
217217
Python 3 builtins such as the ``bytes`` object (which is very different
218218
to Python 2's ``str`` object) and several standard library modules.
219219

220-
``python-future`` supports only Python 2.6+ and Python 3.3+, whereas ``six``
220+
``python-future`` supports only Python 2.7+ and Python 3.4+, whereas ``six``
221221
supports all versions of Python from 2.4 onwards. (See
222222
:ref:`supported-versions`.) If you must support older Python versions,
223223
``six`` will be esssential for you. However, beware that maintaining
224224
single-source compatibility with older Python versions is ugly and `not
225225
fun <http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/>`_.
226226

227227
If you can drop support for older Python versions, ``python-future`` leverages
228-
some important features introduced into Python 2.6 and 2.7, such as
228+
some important features introduced into Python 2.7, such as
229229
import hooks, and a comprehensive and well-tested set of backported
230230
functionality, to allow you to write more idiomatic, maintainable code with
231231
fewer compatibility hacks.
@@ -257,19 +257,13 @@ Platform and version support
257257
Which versions of Python does ``python-future`` support?
258258
--------------------------------------------------------
259259

260-
Python 2.6, 2.7, and 3.3+ only.
260+
Python 2.7, and 3.4+ only.
261261

262-
Python 2.6 and 2.7 introduced many important forward-compatibility
262+
Python 2.7 introduced many important forward-compatibility
263263
features (such as import hooks, ``b'...'`` literals and ``__future__``
264264
definitions) that greatly reduce the maintenance burden for single-source
265265
Py2/3 compatible code. ``future`` leverages these features and aims to
266-
close the remaining gap between Python 3 and 2.6 / 2.7.
267-
268-
Python 3.2 could perhaps be supported too, although the illegal unicode
269-
literal ``u'...'`` syntax may be inconvenient to work around. The Py3.2
270-
userbase is very small, however. Please let us know via GitHub `issue #29
271-
<https://github.com/PythonCharmers/python-future/issues/29>`_ if you
272-
would like to see Py3.2 support.
266+
close the remaining gap between Python 3 and 2.7.
273267

274268

275269
Do you support Pypy?

docs/futurize.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ This applies fixes that modernize Python 2 code without changing the effect of
2323
the code. With luck, this will not introduce any bugs into the code, or will at
2424
least be trivial to fix. The changes are those that bring the Python code
2525
up-to-date without breaking Py2 compatibility. The resulting code will be
26-
modern Python 2.6-compatible code plus ``__future__`` imports from the
26+
modern Python 2.7-compatible code plus ``__future__`` imports from the
2727
following set:
2828

2929
.. code-block:: python
@@ -151,7 +151,7 @@ method on exceptions.
151151
152152
lib2to3.fixes.fix_set_literal
153153
154-
This converts ``set([1, 2, 3]``) to ``{1, 2, 3}``, breaking Python 2.6 support.
154+
This converts ``set([1, 2, 3]``) to ``{1, 2, 3}``.
155155

156156
.. code-block:: python
157157

docs/futurize_cheatsheet.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Step 0: setup
1313
Step 0 goal: set up and see the tests passing on Python 2 and failing on Python 3.
1414

1515
a. Clone the package from github/bitbucket. Optionally rename your repo to ``package-future``. Examples: ``reportlab-future``, ``paramiko-future``, ``mezzanine-future``.
16-
b. Create and activate a Python 2 conda environment or virtualenv. Install the package with ``python setup.py install`` and run its test suite on Py2.7 or Py2.6 (e.g. ``python setup.py test`` or ``py.test``)
16+
b. Create and activate a Python 2 conda environment or virtualenv. Install the package with ``python setup.py install`` and run its test suite on Py2.7 (e.g. ``python setup.py test`` or ``py.test``)
1717
c. Optionally: if there is a ``.travis.yml`` file, add Python version 3.6 and remove any versions < 2.6.
1818
d. Install Python 3 with e.g. ``sudo apt-get install python3``. On other platforms, an easy way is to use `Miniconda <http://repo.continuum.io/miniconda/index.html>`_. Then e.g.::
1919

docs/futurize_overview.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ use the ``-w`` flag.
5151

5252
For complex projects, it is probably best to divide the porting into two stages.
5353
Stage 1 is for "safe" changes that modernize the code but do not break Python
54-
2.6 compatibility or introduce a depdendency on the ``future`` package. Stage 2
54+
2.7 compatibility or introduce a depdendency on the ``future`` package. Stage 2
5555
is to complete the process.

docs/imports.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ standard feature of Python, see the following docs:
2424
- print_function: `PEP 3105: Make print a function <http://www.python.org/dev/peps/pep-3105>`_
2525
- unicode_literals: `PEP 3112: Bytes literals in Python 3000 <http://www.python.org/dev/peps/pep-3112>`_
2626

27-
These are all available in Python 2.6 and up, and enabled by default in Python 3.x.
27+
These are all available in Python 2.7 and up, and enabled by default in Python 3.x.
2828

2929

3030
.. _builtins-imports:

docs/open_function.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ in which case its methods like :func:`read` return Py3 :class:`bytes` objects.
1313
On Py2 with ``future`` installed, the :mod:`builtins` module provides an
1414
``open`` function that is mostly compatible with that on Python 3 (e.g. it
1515
offers keyword arguments like ``encoding``). This maps to the ``open`` backport
16-
available in the standard library :mod:`io` module on Py2.6 and Py2.7.
16+
available in the standard library :mod:`io` module on Py2.7.
1717

1818
One difference to be aware of between the Python 3 ``open`` and
1919
``future.builtins.open`` on Python 2 is that the return types of methods such

docs/quickstart.rst

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,6 @@ To install the latest stable version, type::
1919
If you would prefer the latest development version, it is available `here
2020
<https://github.com/PythonCharmers/python-future>`_.
2121

22-
On Python 2.6, three packages containing backports of standard library modules
23-
in Python 2.7+ are needed for small parts of the code::
24-
25-
pip install importlib # for future.standard_library.import_ function only
26-
pip install unittest2 # to run the test suite
27-
pip install argparse # for the backported http.server module from Py3.3
28-
29-
Unless these features are used on Python 2.6 (only), ``future`` has no
30-
dependencies.
31-
3222

3323
If you are writing code from scratch
3424
------------------------------------
@@ -40,7 +30,7 @@ The easiest way is to start each new module with these lines::
4030
from builtins import *
4131

4232
Then write standard Python 3 code. The :mod:`future` package will
43-
provide support for running your code on Python 2.6, 2.7, and 3.3+ mostly
33+
provide support for running your code on Python 2.7, and 3.4+ mostly
4434
unchanged.
4535

4636
- For explicit import forms, see :ref:`explicit-imports`.
@@ -101,7 +91,7 @@ to be accessed under their Python 3 names and locations in Python 2::
10191
import socketserver
10292
import queue
10393
from collections import UserDict, UserList, UserString
104-
from collections import Counter, OrderedDict, ChainMap # even on Py2.6
94+
from collections import ChainMap # even on Py2.7
10595
from itertools import filterfalse, zip_longest
10696

10797
import html

docs/standard_library_imports.rst

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Note that, as of v0.16.0, ``python-future`` no longer includes an alias for the
8585
Aliased imports
8686
~~~~~~~~~~~~~~~
8787

88-
The following 14 modules were refactored or extended from Python 2.6/2.7 to 3.x
88+
The following 14 modules were refactored or extended from Python 2.7 to 3.x
8989
but were neither renamed in Py3.x nor were the new APIs backported to Py2.x.
9090
This precludes compatibility interfaces that work out-of-the-box. Instead, the
9191
``future`` package makes the Python 3.x APIs available on Python 2.x as
@@ -129,22 +129,16 @@ HTTPS (as of 2015-09-11) because the SSL support changed considerably in Python
129129
Backports also exist of the following features from Python 3.4:
130130

131131
- ``math.ceil`` returns an int on Py3
132-
- ``collections.OrderedDict`` (for Python 2.6)
133-
- ``collections.Counter`` (for Python 2.6)
134-
- ``collections.ChainMap`` (for all versions prior to Python 3.3)
135-
- ``itertools.count`` (for Python 2.6, with step parameter)
136-
- ``subprocess.check_output`` (for Python 2.6)
137-
- ``reprlib.recursive_repr`` (for Python 2.6 and 2.7)
132+
- ``collections.ChainMap`` (for 2.7)
133+
- ``reprlib.recursive_repr`` (for 2.7)
138134

139-
These can then be imported on Python 2.6+ as follows::
135+
These can then be imported on Python 2.7+ as follows::
140136

141137
from future.standard_library import install_aliases
142138
install_aliases()
143139

144140
from math import ceil # now returns an int
145-
from collections import Counter, OrderedDict, ChainMap
146-
from itertools import count
147-
from subprocess import check_output
141+
from collections import ChainMap
148142
from reprlib import recursive_repr
149143

150144

@@ -158,21 +152,12 @@ available independently of the python-future project::
158152
import singledispatch # pip install singledispatch
159153
import pathlib # pip install pathlib
160154

161-
A few modules from Python 3.4 and 3.3 are also available in the ``backports``
155+
A few modules from Python 3.4 are also available in the ``backports``
162156
package namespace after ``pip install backports.lzma`` etc.::
163157

164158
from backports import lzma
165159
from backports import functools_lru_cache as lru_cache
166160

167-
The following Python 2.6 backports of standard library packages from Python 2.7+
168-
are also available::
169-
170-
import argparse # pip install argparse
171-
import importlib # pip install importlib
172-
import unittest2 as unittest # pip install unittest2
173-
174-
These are included in Python 2.7 and Python 3.x.
175-
176161

177162
Included full backports
178163
-----------------------

requirements_py26.txt

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

setup.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,6 @@
8585
'tests': ['*.py'],
8686
}
8787

88-
REQUIRES = []
89-
TEST_REQUIRES = []
90-
if sys.version_info[:2] == (2, 6):
91-
REQUIRES += ['importlib', 'argparse']
92-
TEST_REQUIRES += ['unittest2']
9388
import src.future
9489
VERSION = src.future.__version__
9590
DESCRIPTION = "Clean single-source support for Python 3 and 2"
@@ -101,10 +96,9 @@
10196
KEYWORDS = "future past python3 migration futurize backport six 2to3 modernize pasteurize 3to2"
10297
CLASSIFIERS = [
10398
"Programming Language :: Python",
104-
"Programming Language :: Python :: 2.6",
99+
"Programming Language :: Python :: 2",
105100
"Programming Language :: Python :: 2.7",
106101
"Programming Language :: Python :: 3",
107-
"Programming Language :: Python :: 3.3",
108102
"Programming Language :: Python :: 3.4",
109103
"Programming Language :: Python :: 3.5",
110104
"License :: OSI Approved",
@@ -179,9 +173,8 @@
179173
packages=PACKAGES,
180174
package_data=PACKAGE_DATA,
181175
include_package_data=True,
182-
install_requires=REQUIRES,
176+
python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*",
183177
classifiers=CLASSIFIERS,
184178
test_suite = "discover_tests",
185-
tests_require=TEST_REQUIRES,
186179
**setup_kwds
187180
)

0 commit comments

Comments
 (0)