bczsalba / pytermgui

Python TUI framework with mouse support, modular widget system, customizable and rapid terminal markup language and more!
https://ptg.bczsalba.com
MIT License
2.21k stars 54 forks source link

[BUG] pip install fails on Python 3.7 #71

Closed karolyjozsa closed 2 years ago

karolyjozsa commented 2 years ago

Describe the bug pip installation of PyTermGUI version 4 and above fails on earlier versions than Python 3.8.

To Reproduce Steps to reproduce the behavior:

  1. Have a Python 3.7
  2. pip install pytermgui
  3. error:
    ...pytermgui\terminal.py", line 15, in <module>
    from functools import cached_property
    ImportError: cannot import name 'cached_property' from 'functools' (c:\users\...\python\python37\lib\functools.py)

    pip install pytermgui=3.2.1 is the last that works on Python 3.7

Possible cause functools only introduced cached_property in Python 3.8.

Possible solution Only use this caching if the installed Python is at least 3.8. Or, you can change the docs to indicate 3.8+ instead of 3.7+

bczsalba commented 2 years ago

Yeah, I became aware of this issue quite recently. Install base on 3.7 seems tiny (this pretty large issue has come up twice in the last 3 months), so I'm not sure if it's worth the large amount of extra effort and boilerplate that is needed to keep it supported. EOL is also coming up relatively soon, so I might drop it altogether.

Thank you for the report! Will update this thread if I come to any decision.

bczsalba commented 2 years ago

I've updated pyproject.toml to require 3.8, after a lot of consideration. There is just too many things I rely on having that don't yet exist in 3.7, sadly :(

Version 7.0.0 (upcoming) will be the first to officially require 3.8, but as you said 3.2.1 is the last properly supported version.

Thank you for the report!