Python 2.6 reached the end of its life on 29 October 2013. It's about time to drop support for Python 2.6.
This site shows the top 360 most-downloaded packages on PyPI (source) showing which have dropped support for Python 2.6.
Packages that are backports (for example, enum34) or known to be deprecated are not included (for example, distribute). If your package is incorrectly listed, please create a ticket.
This is not an official website, just a nice visual way to measure progress. To see the authoritative guide on wheels and other aspects of python packaging, see the Python Packaging User Guide.
Remove the Trove classifier from setup.py.
'Programming Language :: Python :: 2.6'
Remove Python 2.6 from your CI. For example Travis CI's .travis.yml:
python: - 2.6
And for example from Appveyor's appveyor.yml:
C:\Python26 C:\Python26-x64
And tox.ini:
envlist=py26
Remove old Python 2.6-specific code and documentation. Common files to check:
For example, no need to install or import unittest2 any more. This:
try:
import unittest2 as unittest # Python 2.6
except ImportError:
import unittest
…can be replaced with:
import unittest
Search your code for stuff like:
if sys.version_info < (2, 7):
# Python 2.6 stuff
if platform.python_version == "2.6":
# Python 2.6 stuff
ver = platform.python_version_tuple()
if float('{0}.{1}'.format(*ver[:2])) < 2.7:
# Python 2.6 stuff
try:
# Python 2.6
import something
except ImportError:
# Python 2.7+
import something_else
// In C code
#if PY_VERSION_HEX < 0x02070000
-#endif
Also search for 2.6 and 26.
If you test with coverage, look for code which was tested before removing 2.6 from your CI.
Finally, consider dropping support for Python 2.6 and 3.3, which reached EOL on 2013-10-29 and 2017-09-29 respectively.
See what's new. For example:
Use set literals:
set([1, 2, 3]) # This can be replaced...
{1, 2, 3} # ... with this
Update string formatters:
# These can be replaced...
'%s %s' % ('one', 'two')
'{1} {2}'.format('one', 'two')
# ... with this
'{} {}'.format('one', 'two')
OrderedDict and Counter from collections
Fantastic, a problem found is a problem fixed. Please create a ticket!
You can also submit a pull request.
Thanks to Python Wheels and Python 3 Wall of Superpowers for the concept and making their code open source.