Skip to content

Python 2 Deprecation #40

@arm4b

Description

@arm4b

There were some sparks and scattered talks around this topic that slip through the cracks. Let's start an async discussion about Python 2 Deprecation to think more how can we do this.

The Problem

Python 2 is old and reached its EOL. It served us a long time, but today per @blag valid point, Python 2 pulls the project down because of CI issues, our pip dependencies are dropping support for py2 and so it makes maintenance hard. Not to forget about the modern Python 3 features we can't use to keep the codebase py2-compatible.

Removing Python 2 support and relying on Python 3 only is the required thing to do. The only questions are When? and How?.

The Plan

1) Communication

We can't just go and remove python 2 in nearest release, breaking users installations. Don't be that software!
This should be communicated beforehand. Make the blog Announcement, describe the transition plan, expectations and migration path so everyone is on the same page. That's why it's important for @StackStorm/tsc to come up with a conclusion about the desired plan, versions affected, roadmap, what needs to be done, when, who's in game and so on.

2) Deprecation Warnings

See StackStorm/st2#4938 for more info. We'll need a Deprecation Warning in st2 to indicate that Python 2 will be fully removed in st2 v3.X (to be decided) version. As you can imagine, there are many users with old python2 legacy packs they wrote before.

So there are 2 aspects we want to cover:

As faster we can decide on this and implement, - earlier we could remove py2 later.

3) Real Work: EL7 and U18 packages on Python 3

After v3.3.0 CentOS 7 / RHEL 7 and Ubuntu Xenial will be the only platforms with py2 st2. The biggest amount and careful work is here, https://github.com/stackstorm/st2-packages packaging and making sure we prepare python3 virtualenv st2 packages. This task needs a technical research and thinking how to handle it better:

  • Can we install python3 as st2.rpm dependency for EL7?
  • Can we install python3 as st2.deb dependency for U16?

4) Follow-ups

st2 repository

  • code cleanups?
  • st2.conf settings which are py2-only?
  • st2 repository makefiles, build system, etc?

Remove Python 2 from the CI build matrix

  • stackstorm/st2
  • st2ci/st2cd workflows
  • StackStorm org repos
  • StackStorm-Exchange org repos

Puppet, Ansible, Docker, K8s, Vagrant

There might be some simple follow-up tasks to update the affected deployment methods for python 3.
I made sure that Docker/K8s is already covered.

Announce that Python 2 was finally Deprecated

As usual, we can announce it via Release Blog post when the py2 breaking change comes into effect. If someone interested to write more dedicated article about Python 2 lifetime and Python 3 plans, - that would be awesome to say "Good bye Python 2" and celebrate that.

Questions

  1. Considering the py2->py3 transition path and deprecation warnings, which release version we want to target for the full py2 removal?

  2. A couple of months ago idea about Python 2 Deprecation Working Group was mentioned. This needs to materialize. Who's involved, who wants to drive, help, contribute, work on these tasks? This is a perfect task to get involved and Contribute.

Please share your ideas, opinions, technical insight or voice for participation.
Removing things should be fun!


Python 2 Deprecation project to be populated with the tasks: https://github.com/orgs/StackStorm/projects/15

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions