Sunsetting Python 2 Support

Sunsetting Python 2 Support

With the Sodium release, SaltStack is joining the ranks of packages dropping Python 2 support. Python 2 has been a great platform for many years, but it’s time to stop supporting legacy Python.


Why Drop Python 2 Support? Why Now?

With Python 3.5 or later available on all modern distributions, and with Python 2 and Python 3.4 both reaching their end-of-life, many of Salt’s dependencies have long since dropped Python 2 support. Additionally, with Python 2 reaching EOL there no longer exists unpaid support. If we want to take advantage of improvements and bug fixes in our dependencies, including Python, we will need to drop Python 2 support.


Salt, pop-build, and You (or, How Do I Upgrade?)

Modern Systems

If you are on a modern system, you should not see any changes when installing Salt from repo.saltstack.com. With the Sodium (v3001) release, simply installing Salt via package manager (such as yum or apt) should be a seamless experience.

To ensure a smooth transition, we do recommend testing in a lab environment - first installing your current version of Salt, and then upgrading to the Sodium release candidate. If you discover any problems during the RC, please open an issue.

Via pip

If you are installing Salt via pip, you will need to have a supported Python 3 version (3.5 or better) installed on your system with pip available. If you have Salt installed with legacy Python, you will need to stop those services and likely uninstall the older version of Salt.

pop-build Package

With the Sodium release we will be previewing packages of Salt built with pop-build. We will be releasing a single-binary and “onedir” style builds. These pop-build Salt distributions will contain Salt and all core dependencies - including Python. Beginning with the Magnesium release (v3002), Salt packages will all be pop-build packages. Practically speaking, this should be a transparent change - installing from repo.saltstack.com should work the same as it always has.

Systems Without Modern Python

If your underlying system does not yet ship a modern version of Python, it should be possible to build and distribute your own modern version of Python that you can use to pip install Salt. This was demonstrated on Salt Air - Episode 42.


The Future

We are excited for the future of Salt and Python 3! Sunsetting our Python 2 support will allow us to focus more of our time on improving Salt, and allow us to fully take advantage of the new features found in Python 3.


For more information, see the FAQ. For help and discussion join us in #salt on freenode or the Community Slack.