Skip to content

Python 2 to Python 3 transition

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

Python 2 to Python 3 transition

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 the 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

Libraries

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

Clone this wiki locally