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

Move minimal supported Python version to 3.11 #148

Closed
5 of 6 tasks
ela-kotulska-frequenz opened this issue Jan 3, 2023 · 8 comments · Fixed by #401
Closed
5 of 6 tasks

Move minimal supported Python version to 3.11 #148

ela-kotulska-frequenz opened this issue Jan 3, 2023 · 8 comments · Fixed by #401
Assignees
Labels
part:docs Affects the documentation part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) type:enhancement New feature or enhancement visitble to users
Milestone

Comments

@ela-kotulska-frequenz
Copy link
Contributor

ela-kotulska-frequenz commented Jan 3, 2023

What's needed?

It would be very nice to be able to use new improvements in Python 3.10/3.11, which introduced some big features and some major improvements to typing:

  • dataclass_transform
  • Self
  • Variadic generics
  • Pattern matching (match statement)
  • Exception groups

Currently we need to use a few hacks to be able to do simple things, like forward declarations (using from __future__ import annoations) or include extra backported modules like typing_extensions or exceptiongroups.

Proposed solution

Move to python 3.11 as the minimum required version.

Blockers

In README there is sentence:
For arm64 only Python 3.8 is supported (due to some dependencies that only support 3.8).

These dependencies was an xgboost package that I've build locally, since we wanted to have gpu support for our nvidia jetson xaviar nx edge controllers
Actually these dependencies were never used anywhere.
It is not build and needed now.

  • xgboost compiled for controllers GPU: not being used right now.
  • Ubuntu shipping 3.11: We can use the official Python docker images (based on Debian/alpine)
  • mypy doesn't support all 3.11 features yet (not a hard blocker though): Python 3.11 tracking issue python/mypy#12840 (is not all done but only very minor and obscure things are missing, so it should not be a blocker)
  • Tensorflow only supports 3.10 for now, but 3.11 is coming: Support Python 3.11 tensorflow/tensorflow#58032
  • Ask @frequenz-floss/datasci-team if there are other required ML libraries needed
  • Disable tests for older python versions in branch protection

Check if a dependency is Python 3.11-compatible

@ela-kotulska-frequenz ela-kotulska-frequenz added part:docs Affects the documentation part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) priority:high Address this as soon as possible type:enhancement New feature or enhancement visitble to users labels Jan 3, 2023
@ela-kotulska-frequenz ela-kotulska-frequenz added this to the v0.17.0 milestone Jan 3, 2023
@christianparpart
Copy link
Contributor

Actually, locally, on all my Linux systems, I am having Python 3.11 installed. Despite a few issues today I had in getting this repo built, I managed to succeed, using Python 3.11. Maybe we can run the tests against 3.10 as well as 3.11 and support both?

@shsms
Copy link
Contributor

shsms commented Jan 4, 2023

Oh, I thought we were already supporting python 3.11. I guess we need to add that to the CI first, then.

@christianparpart
Copy link
Contributor

Oh, I thought we were already supporting python 3.11. I guess we need to add that to the CI first, then.

NB: It's on CI now.

@leandro-lucarella-frequenz leandro-lucarella-frequenz changed the title Move to python3.10 Move minimal supported Python version to 3.11 Feb 7, 2023
@leandro-lucarella-frequenz leandro-lucarella-frequenz changed the title Move minimal supported Python version to 3.11 Move minimal supported Python version to 3.10 / 3.11 Feb 7, 2023
@leandro-lucarella-frequenz
Copy link
Contributor

I renamed this issue because I think it was not about supporting Python 3.10 (which was already supported) but to make it the minimum supported Python version (so we can use more modern features in the SDK itself). I also updated it to Python 3.11, as eventually Tensorflow should support it.

Still, I would be very careful about doing this move, as once it is done there is no (easy) way back. Things I would have in mind before doing this:

  • Check we'll really never, ever need to use a compiled package that it is only supported in Python 3.8 (either because we won't use the package or because it can be compiled with Python 3.10 / 3.11 too).

  • Check the current supported version in the latest Ubuntu LTS (and probably other popular distros). This is a nice to have, but I think making it work out of the box in a Ubuntu LTS is a nice feature. If we decide against this, we have to be conscious people might need to compile their own Python to use the SDK.

I also don't think we need to do this in v0.18.0, so we might consider moving it to a future milestone.

@leandro-lucarella-frequenz leandro-lucarella-frequenz changed the title Move minimal supported Python version to 3.10 / 3.11 Move minimal supported Python version to 3.11 Mar 6, 2023
@leandro-lucarella-frequenz leandro-lucarella-frequenz added the status:blocked Other issues must be resolved before this can be worked on label Mar 6, 2023
@leandro-lucarella-frequenz
Copy link
Contributor

I updated this issue again, adding current blockers to move to Python 3.11. I removed moving to Python 3.10 as an option because I think is too much effort to move to 3.10 first and shortly after to 3.11 again (I assume the blockers will be lifted sooner than later, but we can reconsider if that doesn't end up happening).

@leandro-lucarella-frequenz
Copy link
Contributor

The current tensorflow is compatible with Python3.11, at least it is installable in Python 3.11. It seems like some issues remain with supporting CUDA.

Can we do some testing to see if it is enough for what we need? It would be awesome to make the jump to 3.11, also for all the background task stuff having task groups and exception groups would make everything much easier.

@leandro-lucarella-frequenz leandro-lucarella-frequenz removed the priority:high Address this as soon as possible label Mar 21, 2023
@leandro-lucarella-frequenz
Copy link
Contributor

Now the issue in tensorflow is closed, there is one comment saying cuda is supported. Someone complains there are no binary wheels for mac M1, but I guess that shouldn't be a stopper for us.

@leandro-lucarella-frequenz
Copy link
Contributor

I added a link a web that shows major libraries compatibility with 3.11. It's not perfect because then a project specifies an open ended python version support (like we do), it's not 100% sure it really works, but in general it should: https://observablehq.com/d/eb336fc983fcdf52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:docs Affects the documentation part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) type:enhancement New feature or enhancement visitble to users
Projects
Development

Successfully merging a pull request may close this issue.

4 participants