joouha / euporie

Jupyter notebooks in the terminal
https://euporie.readthedocs.io
MIT License
1.54k stars 36 forks source link

ImportError in Python 3.8 #40

Closed Minyus closed 1 year ago

Minyus commented 1 year ago

Hi @joouha ,

Thank you for the awesome tool!

Using Python 3.8, euporie v2.1.1 returns the following error.

$ euporie notebook foo
Traceback (most recent call last):
  File "/Users/ym/opt/miniconda3/bin/euporie", line 5, in <module>
    from euporie.core.__main__ import main
  File "/Users/ym/opt/miniconda3/lib/python3.8/site-packages/euporie/core/__init__.py", line 12, in <module>
    from euporie.core.log import default_logs
  File "/Users/ym/opt/miniconda3/lib/python3.8/site-packages/euporie/core/log.py", line 25, in <module>
    from euporie.core.formatted_text.utils import indent, lex, wrap
  File "/Users/ym/opt/miniconda3/lib/python3.8/site-packages/euporie/core/formatted_text/utils.py", line 18, in <module>
    from euporie.core.border import GridStyle, Padding, Thin
  File "/Users/ym/opt/miniconda3/lib/python3.8/site-packages/euporie/core/border.py", line 6, in <module>
    from functools import cache, total_ordering
ImportError: cannot import name 'cache' from 'functools' (/Users/ym/opt/miniconda3/lib/python3.8/functools.py)

Could you please replace functools.cache with functools.lru_cache(maxsize=None), same functionality supported in Python 3.8, as suggested at https://stackoverflow.com/a/66846753 ?

joouha commented 1 year ago

Hello,

Thanks for reporting this. Not sure why I used cache over lru_cache, or why I didn't test this properly on 3.8!

I've added this fix and made a new release, v2.1.2.

Thanks for your help

Minyus commented 1 year ago

Confirmed the updated version works with Python 3.8. Thank you!