This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Explicitly cover application migration in the 2->3 guide
Type: enhancement Stage: needs patch
Components: Versions: Python 3.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, ncoghlan, python-dev, r.david.murray
Priority: high Keywords:

Created on 2014-03-01 03:31 by ncoghlan, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (6)
msg212485 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2014-03-01 03:31
A thread on python-ideas made me realised the migration guide is currently missing a section: migrating integrated applications.

This needs to cover:

- "caniusepython3" to check dependencies for compatibility
- if dependencies are ready, and Python 2 compatibility can be dropped completely, the 2to3 based migration path
- if dependencies aren't ready yet, the Python 2 -> 2/3 source on Python 2 -> 2/3 source on Python 3 -> Python 3 migration path
- if dependencies are ready but Python 2 compatibility is still needed, the Python 2 only -> 2/3 source on Python 2 or 3 -> Python 3 only migration path
msg212487 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-03-01 03:44
I'm not sure what your last two points are saying, but my take on both of them is the main codebase should move to shared source Python2/Python3 if possible.  That's what I'm doing for my own projects.  Testing the Python3 compatibility depends on whether or not you can write your tests to not depend on the non-ported components, but often that is possible.
msg212491 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2014-03-01 07:16
Expanded version:
================
For developers of integrated applications that currently still have
some dependencies on Python 2, the preferred migration path is to use
tools like python-modernize or python-future to shift first into the
large common subset of Python 2 and Python 3, and then only later
switch fully to Python 3. This approach permits application developers
to take the following path:

1. Python 2 only (status quo)
2. Python 2/3 compatible on Python 2 (waiting for dependencies)
3. Python 2/3 compatible on Python 3 (dependencies ported or replaced)
4. Python 3 only (drop Python 2 support)

Brett Cannon's "caniusepython3" tool
(https://pypi.python.org/pypi/caniusepython3/) is designed to automate
the dependency analysis to see if all declared dependencies are Python
3 compatible (or have suitable alternatives available). However, if
you're using system packages for dependency management, some data
transformations will be needed to convert them to a form that the tool
understands.
=========================

From https://mail.python.org/pipermail/python-ideas/2014-March/026343.html
msg212508 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2014-03-01 15:54
Something like this should go at the top almost as a tl;dr to get the point across that regardless of the state of your dependencies, start writing Python 3-compatible code **today** and if you must update old code piecemeal. I'll add something next time I have time (should be Friday).
msg212893 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-03-07 17:27
New changeset 2a922153463e by Brett Cannon in branch 'default':
Issue #20812: Add a short opener to the Python 2/3 porting HOWTO.
http://hg.python.org/cpython/rev/2a922153463e
msg212894 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-03-07 17:29
New changeset c83ce2a1841c by Brett Cannon in branch 'default':
null merge for issue #20812
http://hg.python.org/cpython/rev/c83ce2a1841c
History
Date User Action Args
2022-04-11 14:57:59adminsetgithub: 65011
2014-03-07 17:29:33python-devsetmessages: + msg212894
2014-03-07 17:27:45brett.cannonsetstatus: open -> closed
resolution: fixed
2014-03-07 17:27:18python-devsetnosy: + python-dev
messages: + msg212893
2014-03-01 15:54:24brett.cannonsetassignee: brett.cannon
messages: + msg212508
2014-03-01 07:16:49ncoghlansetmessages: + msg212491
2014-03-01 03:59:59ncoghlanlinkissue20813 dependencies
2014-03-01 03:44:54r.david.murraysetnosy: + r.david.murray
messages: + msg212487
2014-03-01 03:31:37ncoghlancreate