Skip to content

Python 2 to Python 3 transition

Nick Maludy edited this page Jan 18, 2018 · 5 revisions

Overview

This page details information about transforming StackStorm from using Python 2 to Python 3

StackStorm Code

Find code to modernize

python3.5 -m modernize -x libmodernize.fixes.fix_print st2common/

If you pip install pigments you can pipe the output of modernize through pygments -l diff

python3.5 -m modernize -x libmodernize.fixes.fix_print st2common/ | pygmentize -l diff

Modernize StackStorm Code

Then if you're happy add -w -n it will write the changes (without a backup, since we're using git).

python3.5 -m modernize -x libmodernize.fixes.fix_print st2common/ -w -n

Modernize Libraries

Use these tools to find dependencies that don't support Python 3:

TODO List

  • Unit tests for Python 3 along side Python 2
  • Python 3 packaging (how are we going to install Python 3)
  • Packs (this should probably be its own TODO list)
Clone this wiki locally