nbQA-dev / nbQA

Run ruff, isort, pyupgrade, mypy, pylint, flake8, and more on Jupyter Notebooks
https://nbqa.readthedocs.io/en/latest/index.html
MIT License
1.02k stars 39 forks source link

Error when importing nbqa.find_root in v1.6.1 #790

Closed DManowitz closed 1 year ago

DManowitz commented 1 year ago

With version 1.6.1 of nbqa, when importing nbqa.find_root, I get the following error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "...\lib\site-packages\nbqa\find_root.py", line 26, in <module>
    ) -> Path:
  File "C:\Users\manow\miniconda3\envs\py37_ml_TfGpuMain\lib\functools.py", line 490, in lru_cache
    raise TypeError('Expected maxsize to be an integer or None')
TypeError: Expected maxsize to be an integer or None

Looking through the history of this file, it appears that leaving off the parentheses from the @lru_cache decorator for find_project_root is likely the cause of this error.

MarcoGorelli commented 1 year ago

hi @DManowitz - are you using python3.7? python3.8 is the minimum version required. i'll check later anyway,thanks for the report!

DManowitz commented 1 year ago

Then someone needs to at least update conda b/c it shows python >=3.7.0 there.

MarcoGorelli commented 1 year ago

ok it's 3.8.0 here:

https://github.com/nbQA-dev/nbQA/blob/220dacf44e6cc234b8ef87863a31ff9d46dad920/setup.cfg#L35

please report to conda then, thanks!

MarcoGorelli commented 1 year ago

Should be fixed now (I guess I need to cut a new release for it to take effect? I've removed conda from the readme anyway in the meantime)