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

Support for Python 3.6? #74

Closed
kopf-archiver bot opened this issue Aug 18, 2020 · 1 comment
Closed

Support for Python 3.6? #74

kopf-archiver bot opened this issue Aug 18, 2020 · 1 comment
Labels
archive question Further information is requested

Comments

@kopf-archiver
Copy link

kopf-archiver bot commented Aug 18, 2020

An issue by GrahamDumpleton at 2019-05-26 05:07:59+00:00
Original URL: zalando-incubator/kopf#74
 

What specific dependencies does the code have on Python 3.7?

Supported major Linux OS distributions such as Red Hat Enterprise Linux still ship Python 3.6 as latest version in most recent OS release, and will for some time. Requiring Python 3.7 will prevent organisations using this which need to have a supported operating system and language stack from a vendor.


Commented by nolar at 2019-05-26 20:19:06+00:00
 

As far as I remember, there are few function calls available in 3.7 only:

  • contextvars module — the only tricky part to back-port (kind of thread-local storage, but for asyncio).
  • dataclasses module — for some new branches (not yet merged; can be worked around).
  • datetime.datetime.fromisoformat() — can be backported/re-implemented.
  • asyncio.current_task() & asyncio.all_tasks() — instead of old asyncio.Task.all_tasks().

And maybe something else.

In fact, the only actual reason why 3.6 is not supported and the 3.7's modules/functions were not back-ported, is that we in our team started with 3.7, and there were no need (for us) to make it run with 3.6:

It is either a local developer's environment, where pyenv & similar tools provide any version of Python on demand, or it is a docker container in the Kubernetes cluster, where we are free to choose any distro (from the list of approved ones) with any version of Python, or to install our own.

As I see, 3.7 is the default Python since Ubuntu 19.04 Disco, so we can expect it to become the default one in LTS 2020.04 in one year from now — not fast though.

I am not educated enough regarding the strict LTS-distro requirements in some organisations to judge on how much 3.6 is actually unavoidable, and whether the effort to back-port the functions/modules is worth the benefit for the next 1 year.

My own focus currently is on the tests & coverage, thus pushing it towards the 1.0 release; and on some missing features for the full & rich experience: silent spy-handlers mostly, and the built-in resources support (i.e. non-CRD) — to expand the Kopf's scope of application.

So, I will probably not be able to add the 3.6-compatibility in the next couple months myself, sorry.

But the code contributions are highly welcome — so if you are willing to make Kopf 3.6-compatible, I will appreciate that, and will help as much as I can. See UPD below.


Commented by nolar at 2019-05-28 19:20:33+00:00
 

UPD: I was thinking on this topic for couple days. And came to the conclusion that it is better to keep Kopf with Python 3.7+, and to not port it to 3.6.

If we convert it to 3.6, all the development should go with the minimum 3.6 compatibility in mind, for years. The "batteries included" philosophy of Python has to be ignored, and the "batteries" should be either re-implemented locally, or delivered via the extra dependencies — which is not good from the software design point of view. It will also require extra effort not only for a one-time conversion, but for any future development of new features since then.

Conversion would be a good trade-off if Python 3.6 brings much wider adoption of Kopf than Python 3.7. Yet it is unclear in which cases the organisations use Kubernetes, but cannot use Python 3.7 under any circumstances (e.g. in containers/pods) — and what is the share of these cases.

I suggest that we keep this issue open, so that it is visible for others looking for Python 3.6 compatibility — they can leave their comments here.

But before making this decision (and before accepting any PRs for Python 3.6 compatibility), I would like to discuss the cases, the reasons, and to understand the context better.


Commented by GrahamDumpleton at 2019-05-28 22:17:41+00:00
 

I think in practice, due to Kubernetes community preferring Go, that an operator framework for Python is going to be a niche. So I think it is probably safe to close this issue as developers for mainstream applications that need an operator are going to use Go anyway. The issue is at least here to provide some context on why only Python 3.7 is supported.

@kopf-archiver kopf-archiver bot closed this as completed Aug 18, 2020
@kopf-archiver kopf-archiver bot changed the title [archival placeholder] Support for Python 3.6? Aug 19, 2020
@kopf-archiver kopf-archiver bot added the question Further information is requested label Aug 19, 2020
@kopf-archiver kopf-archiver bot reopened this Aug 19, 2020
@nolar
Copy link
Owner

nolar commented Sep 9, 2020

Closing as there is no way for 3.6 anymore, too many 3.7+ features are used (and wishing for 3.8+ sometimes).

Python 3.8 is the default in Ubuntu 20.04 (LTS) now: https://packages.ubuntu.com/focal/python3

So, even 3.7 can be dropped soon (unless there are reasons not to do so).

@nolar nolar closed this as completed Sep 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archive question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant