Dropping Python 3.6

@core-devs and everyone in the community.

What is everyone’s thought about dropping Python 3.6? It officially is supported until the end of this year.

By way of context, we dropped Python 3.5 support in version 19.6.2 ahead of its end of life in September 2020. It support was maintained by Sanic only through the LTS 18.12.

I am proposing that we do something similar. First, Python 3.7 saw some new features for the asyncio server that Sanic uses under the hood. Second, I would like to take advantage of some of the typing enhancements as a part of #2006. Third, there is a proposal to add some additional context aware variables that would be much easier to build with constextvars.

Therefore, I think that we should bump the officially support version for v21.3 to Python 3.7. We will continue to support Python 3.6 via the 20.12LTS release.

In the past few days, it looks like there were about 4,704 installs on Python 3.6, which amounts to approximately 0.18% of all installs.

Any objections?

I’m agree, but not now, please give python3.6 more two or one years !
In China, many developers are still using python3.6
Cancelling support for python3.6 now is not conducive to the promotion of sanic
what do you think?
by the way:
For Chinese enterprises, stability is more important than the pursuit of rapid renewal.

Stability is the reason we introduced two year LTS releases. And, we will not continue with new release support after Python drops security fixes. Meaning 21.12 for sure will not include Python 3.6.

So the question is at what point this year can our release not include it? The interim releases of x.3, x.6, and x.9 build up to the LTS.

I am certainly sympathetic, and the continued usage of 3.6 in China is good information to have. Anyone interested in digging into the usage details a little deeper?

RuntimeError: uvloop requires Python 3.7 or greater

See Travis build

I think this answers the question for us. Looks like version 0.15.0 drops support for Python 3.5 and 3.6. Which means we also need to make sure that the LTS versions are properly pinned.

I’m normally the one to argue to keep supporting a particular Python version for as long as possible.
Especially v3.6, because it was/is used as the default Python in Ubuntu 18.04LTS. And Ubuntu 18.04LTS is still used very extensively, and is supported until April 2023.

However, I don’t think that matters in this case. If you need Python 3.6 support, you can continue to use Sanic v20.12. A lot of people deploy in a Docker container these days anyway, where you can easily host a newer Python version to run your code.

So +1 from me to remove python 3.6 support in Sanic 21.3.
It was a good idea, and the uvloop change confirmed it as essentially required, unless we want to pin to uvloop < 0.15.

1 Like

See Remove Python 3.6 support by ahopkins · Pull Request #2036 · sanic-org/sanic · GitHub

1 Like