Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phasing out Python 3.4 support #9328

Closed
balloob opened this issue Sep 7, 2017 · 18 comments · Fixed by #12610
Closed

Phasing out Python 3.4 support #9328

balloob opened this issue Sep 7, 2017 · 18 comments · Fixed by #12610

Comments

@balloob
Copy link
Member

balloob commented Sep 7, 2017

Python 3.5, released in September 2015, brings a lot of improvements and bug fixes compared to Python 3.4, including native support for the async/await syntax. I want to set a timeline to phase out Python 3.4 support and make Python 3.5.2 the minimum required version for Home Assistant.

Let's make the first release in 2018 be Python 3.5.2+ only.

Home Assistant

  • On Windows our minimum requirement is already Python 3.5.2. (the Windows event loop implementation ProactorEventLoop got SSL support in 3.5)
  • On other OSes (Linux/Mac etc) we require currently minimum of Python version 3.4.2.

Operating systems

  • Debian Stretch was released as stable version in June, 2017. This version included Python 3.5 as the default.
  • Raspbian Stretch (based on Debian) was released in August, 2017. Also included Python 3.5.
  • Hass.io users have already been on Python 3.6 for a while now.
  • I am not 100% sure if Hassbian has been updated yet to be based of the new Debian Stretch. @Landrash can you comment on this?

The chances are high that anyone doing a clean install today will end up with Python 3.5 or higher.

Aiohttp

Home Assistant uses the aiohttp framework for HTTP client and server. The aiohttp project has stated (reference) to drop Python 3.4 support in January 2018.

Current installation stats

We currently have 47.5% of the users running Python 3.4.X.

image

@MartinHjelmare
Copy link
Member

Ubuntu 16.04 (the latest LTS release) gives Python 3.5.2, once upgraded. 👍

@emlove
Copy link
Contributor

emlove commented Sep 7, 2017

Is it possible to look up of the people running 3.4, which OS are they using?

Also, if aiohttp is dropping 3.4 support, it's hard to argue for keeping it ourselves.

@Landrash
Copy link
Contributor

Landrash commented Sep 7, 2017

For Hassbian based on Raspbian Stretch I have a pre-release out.
It's currently a work in progress that I could release as is but we will loose some functionality. It's fairly well documented in the #Hassbian channel and in this issue.

Short summary of things that are problematic currently are:

  • Mosquitto. Problems with upstream packages. Install package will remain since it should work after being fixed by creators of Mosquitto.
  • Libcec. Doesn't build properly on anything above python 3.4. Install package will remain since it should work after being fixed by creators of Mosquitto.
  • Tellstick. Being dropped since it's ancient and not being maintained. Doubtful that it will be updated for stretch.

Unsure if Libcec works for our other distributions?

@andrey-git
Copy link
Contributor

Given the usage graph I think we should keep support for 3.4 for as long as we can. At least until aiohttp supports it. I would says at least until we really need a version of aiohttp that doesn't support 3.4

@Julius2342
Copy link
Contributor

We could start displaying a warning. First on log output, later on UI.

@balloob
Copy link
Member Author

balloob commented Sep 12, 2017

Yes @andrey-git, I agree. That's why I suggested January 1, as that's when aiohttp will no longer support it.

I think it is a good idea to start showing a warning starting next release and just announce that we will eventually drop it.

@Landrash
Copy link
Contributor

@balloob Is there any platform that we don't have the possibility to migrate to python 3.5 now?

I would recommend writing a blog post about the drop of 3.4 and having a notification in the next and forward releases of HA where the system is running on Python <3.5.

The more time before it's dropped the less of a flashback mosts likely.

@balloob
Copy link
Member Author

balloob commented Oct 4, 2017

1 month after this issue has been created and people running Python 3.4 has dropped to 39%.

I suggest for now that we don't drop support until aiohttp makes a release that is Python 3.5 only.

@balloob
Copy link
Member Author

balloob commented Oct 19, 2017

aiohttp is discussing their next major version that will drop support for Python 3.4: aio-libs/aiohttp#2343

@Landrash
Copy link
Contributor

Landrash commented Oct 21, 2017 via email

@balloob
Copy link
Member Author

balloob commented Feb 6, 2018

It's 2018 now. We're going to drop 3.4 support once aiohttp releases v3, which is expected soon.

@balloob
Copy link
Member Author

balloob commented Feb 6, 2018

We're going to follow Debian stable and are going to jump to Python 3.5.3 as minimum version

@Julius2342
Copy link
Contributor

@balloob : is there any reason to wait for aiohttp? if you look at their release plan : https://github.com/aio-libs/aiohttp/milestone/17 it looks like there is still a mile to go ...

@andrey-git
Copy link
Contributor

What are the current usage numbers?

@balloob
Copy link
Member Author

balloob commented Feb 6, 2018

@Julius2342 That is a list of things aiohttp would like to have for 3.0, not their release plan (source). Their biggest change was to change to async/await and they already finished that.

Current numbers of impacted users:

  • 13.8% on 3.4.2
  • 7.4% on 3.5.2

Python 3.5.3 was picked because it is in Debian Stable. It also contains a few changes that are nice for asyncio (more info about that here)

@andrey-git
Copy link
Contributor

20% is significant. Should we have a branch with last 3.4-supporting version that can get critical fixes?

@balloob
Copy link
Member Author

balloob commented Feb 7, 2018

Yes. We will tag a certain release as "last 3.4" release and will keep that around for security fixes.

@balloob
Copy link
Member Author

balloob commented Feb 8, 2018

Aiohttp 3 beta has been published to PyPi: aio-libs/aiohttp#2343 (comment)

I will announce in the next release that 0.64 will be the last release to support Python 3.4

@balloob balloob mentioned this issue Feb 22, 2018
3 tasks
@home-assistant home-assistant locked and limited conversation to collaborators May 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants