Upgrade from Python 2.2.1 to 3.4 -
we have got legacy application runs on python 2.2.1. need upgrade latest version of python (3.4).
i know few details on upgrade:
- would direct upgrade of associated files? mean libraries have been used in older code have changed make work in latest version?
- how upgrade .py files older newer version?
everywhere talks upgrading 2.6 3 , cover 2.2.1 3. there direct upgrade possible?
to expand on comments, the pyporting docs suggest seven-step process think useful here too:
only worry supporting python 2.7 - easier upgrade 3 if first make sure code runs in latest 2.x branch. if you're lucky, won't require many changes!
make sure have test coverage - crucial major change. if can't sure it's working now, how sure it's working after upgrade?
learn differences between python 2 & 3 - per cdarke's comment, have manual intervention, need know what's changed. in case, may involve learning differences between 2.x versions. can use what's new in python x.x? help.
use modernize or futurize update code - automated tools make code 3.x-ready (the documentation notes can use
2to3
if don't want retain 2.x compatibility).use pylint make sure don’t regress on python 3 support -
pylint
give lots of helpful warnings improve code generally.use caniusepython3 find out of dependencies blocking use of python 3 - ask updates libraries; tool can tell what's 3.x compatible. may need find compatible replacements dependencies; see pypi.
use continuous integration make sure stay compatible python 2 & 3 - whatever versions want support, ci can ensure stay compatible of them modify code.
Comments
Post a Comment