mike-fabian / ibus-typing-booster

ibus-typing-booster is a completion input method for faster typing
https://mike-fabian.github.io/ibus-typing-booster/
Other
226 stars 15 forks source link

drop python<=3.7 support #511

Closed kloczek closed 3 months ago

kloczek commented 3 months ago

According to https://endoflife.date/python python 3.7 has been EOSed almost year ago. Filer all code over pyup[grade --py38-plus.

mike-fabian commented 3 months ago

Unfortunately openSUSE Leap 15.4 and Leap 15.5 still have Python 3.6:

https://news.opensuse.org/2023/06/06/leap-modern-python-stack/

I introduced this to make it work on these openSUSE versions:

if sys.version_info >= (3, 8):
    from typing import Literal
else:
    from typing_extensions import Literal
from typing import Literal

Without that, one gets

ImportError: cannot import name 'Literal'

on openSUSE Leap 15.4 and Leap 15.5.

mike-fabian commented 3 months ago

Your second patch "filter all code over ruff" looks completely fine.

kloczek commented 3 months ago

Without that, one gets

ImportError: cannot import name 'Literal'

on openSUSE Leap 15.4 and Leap 15.5.

typing is standard module which have been evolving since python 3..5.

Which one version of the python is in that distro? 🤔

kloczek commented 3 months ago

From https://peps.python.org/pep-0586/ image So I'm assuming that this SuSE version is using one od the oleder versions which already is EOSed 🤔

mike-fabian commented 3 months ago

Without that, one gets

ImportError: cannot import name 'Literal'

on openSUSE Leap 15.4 and Leap 15.5.

typing is standard module which have been evolving since python 3..5.

Which one version of the python is in that distro? 🤔

openSUSE Leap 15.5 and 15.4 have Python 3.6 as default. There are optional addons for newer Python versions, but they lack some modules.

typing is available since python 3.5, but Literal needs python >= 3.8.

mike-fabian commented 3 months ago

Your second patch "filter all code over ruff" looks completely fine.

I pushed that one to main already.

kloczek commented 3 months ago

https://github.com/mike-fabian/ibus-typing-booster/blob/91c9296341a612f65b5a514f097279d9a6ed05d5/configure.ac#L42-L43 It would be good to update that as well

mike-fabian commented 3 months ago

https://github.com/mike-fabian/ibus-typing-booster/blob/91c9296341a612f65b5a514f097279d9a6ed05d5/configure.ac#L42-L43

It would be good to update that as well

Yes, but not right now because I think I stlll need to keep Python 3.6 compatibility because of openSUSE Leap 15.5.

mike-fabian commented 3 months ago

I have pushed all changes not to main except for the change related to from typing import Literal. That keeps Python 3.6 compatibility for the moment.

mike-fabian commented 3 months ago

Thank you for the pull request!