Python 2 is dead! Drag your old code into the modern age
summary
An 8-year-old Django codebase of ~70,000 Python lines migrates from 2.7 to Python 3.6 using 2to3, caniusepython3 and pylint --py3k, plus virtualenvs, tox and CI. The team converts app-by-app, accepts 2to3 diffs, runs tests until green, refactors conservatively and adds manual frontend GIS checks. Dependencies shrink from ~75 requirements with 11 blockers to only a few needing fixes (some replaced or patched). Gotchas include changed rounding, exception.message removal, randomized hash seeds and Python 2 pickle incompatibilities.
AI-written summary · about
chapters (16)
- 0:00Intro
- 2:22WHY UPGRADE? AKA WHY YOU WANT PYTHON
- 4:58THE PROJECT
- 6:21TOOLS
- 6:34CANIUSEPYTHON3
- 8:51ARCHITECTURE
- 9:50#1: LEARN ABOUT DIFFEREI BETWEEN PYTHON 2 AND PY
- 10:14#1: LEARN ABOUT DIFFERENCES BETWEEN PYTHON 2 AND PYTHON 3
- 10:33#2: TESTS
- 11:02DEPENDENCIES
- 14:04FIX THE CODE
- 15:13REVIEW / REFACTOR
- 17:58LINTING
- 20:22GOTCHAS
- 24:17RESULTS
- 25:39RESOURCES
related talks
27mHow We Migrated 3.8 Million Lines of Python 2 Without Interrupting Deve...
45mWriting Python 2/3 compatible code
44mHow to Build a Plan to Migrate to Python 3
26mPython 2 to 3: How to Upgrade and What Features to Start Using
41mPorting a Project from Python 2 to 3
24mJourney to migrate python2 projects to 3
47mPorting Django apps to Python 3
43mPython 3: ten years later
