@@ -28,15 +28,14 @@ The Short Explanation
2828To make your project be single-source Python 2/3 compatible, the basic steps
2929are:
3030
31- #. Update your code to drop support for Python 2.5 or older (supporting only
32- Python 2.7 is ideal)
31+ #. Only worry about supporting Python 2.7
3332#. Make sure you have good test coverage (coverage.py _ can help;
3433 ``pip install coverage ``)
3534#. Learn the differences between Python 2 & 3
3635#. Use Modernize _ or Futurize _ to update your code (``pip install modernize `` or
3736 ``pip install future ``, respectively)
3837#. Use Pylint _ to help make sure you don't regress on your Python 3 support
39- (if only supporting Python 2.7/3.4 or newer; ``pip install pylint ``)
38+ (``pip install pylint ``)
4039#. Use caniusepython3 _ to find out which of your dependencies are blocking your
4140 use of Python 3 (``pip install caniusepython3 ``)
4241#. Once your dependencies are no longer blocking you, use continuous integration
@@ -67,26 +66,27 @@ Keep those key points in mind while you read on about the details of porting
6766your code to support Python 2 & 3 simultaneously.
6867
6968
70- Drop support for Python 2.5 and older (at least)
71- ------------------------------------------------
69+ Drop support for Python 2.6 and older
70+ -------------------------------------
7271
7372While you can make Python 2.5 work with Python 3, it is **much ** easier if you
74- only have to work with Python 2.6 or newer (and easier still if you only have
75- to work with Python 2.7). If dropping Python 2.5 is not an option then the six _
76- project can help you support Python 2.5 & 3 simultaneously
73+ only have to work with Python 2.7. If dropping Python 2.5 is not an
74+ option then the six _ project can help you support Python 2.5 & 3 simultaneously
7775(``pip install six ``). Do realize, though, that nearly all the projects listed
7876in this HOWTO will not be available to you.
7977
80- If you are able to only support Python 2.6 or newer , then the required changes
78+ If you are able to skip Python 2.5 and older , then the required changes
8179to your code should continue to look and feel like idiomatic Python code. At
8280worst you will have to use a function instead of a method in some instances or
8381have to import a function instead of using a built-in one, but otherwise the
8482overall transformation should not feel foreign to you.
8583
86- But please aim for Python 2.7. Bugfixes for that version of Python will continue
87- until 2020 while Python 2.6 is no longer supported. There are also some tools
88- mentioned in this HOWTO which do not support Python 2.6 (e.g., Pylint _), and
89- this will become more commonplace as time goes on.
84+ But you should aim for only supporting Python 2.7. Python 2.6 is no longer
85+ supported and thus is not receiving bugfixes. This means **you ** will have to
86+ work around any issues you come across with Python 2.6. There are also some
87+ tools mentioned in this HOWTO which do not support Python 2.6 (e.g., Pylint _),
88+ and this will become more commonplace as time goes on. It will simply be easier
89+ for you if you only support the versions of Python that you have to support.
9090
9191Make sure you specify the proper version support in your ``setup.py `` file
9292--------------------------------------------------------------------------
0 commit comments