thibaudcolas / curlylint

Experimental HTML templates linting for Jinja, Nunjucks, Django templates, Twig, Liquid
https://www.curlylint.org/
MIT License
239 stars 25 forks source link

`pip install curlylint` does not work due to incompatability with click 8.1.0 #132

Closed jmsmkn closed 2 years ago

jmsmkn commented 2 years ago

Describe the bug

Cannot run curlylint with the latest version of click. This is similar to https://github.com/psf/black/issues/2964. Workaround is to pin click<8.1.0.

Which terms did you search for in the documentation and issue tracker?

ImportError: cannot import name '_unicodefun' from 'click'

Environment

Python 3.8

Steps to reproduce

Install from pip with python3 -m pip install curlylint, observe failure.

 james@gazelle  /tmp/curlylint  python3 -m virtualenv .
created virtual environment CPython3.8.10.final.0-64 in 270ms
  creator CPython3Posix(dest=/tmp/curlylint, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/james/.local/share/virtualenv)
    added seed packages: pip==22.0.4, setuptools==60.9.3, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator

 james@gazelle  /tmp/curlylint  source bin/activate

 james@gazelle   3.8.10  /tmp/curlylint  python3 -m pip install curlylint
Collecting curlylint
  Downloading curlylint-0.13.0-py3-none-any.whl (51 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 51.9/51.9 KB 1.7 MB/s eta 0:00:00
Collecting toml>=0.9.4
  Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting attrs>=17.2.0
  Using cached attrs-21.4.0-py2.py3-none-any.whl (60 kB)
Collecting click>=6.5
  Using cached click-8.1.0-py3-none-any.whl (96 kB)
Collecting pathspec<1,>=0.6
  Using cached pathspec-0.9.0-py2.py3-none-any.whl (31 kB)
Collecting parsy==1.1.0
  Using cached parsy-1.1.0-py3-none-any.whl (6.9 kB)
Installing collected packages: parsy, toml, pathspec, click, attrs, curlylint
Successfully installed attrs-21.4.0 click-8.1.0 curlylint-0.13.0 parsy-1.1.0 pathspec-0.9.0 toml-0.10.2

 james@gazelle   3.8.10  /tmp/curlylint  touch blah.html

 james@gazelle   3.8.10  /tmp/curlylint  curlylint
Traceback (most recent call last):
  File "/tmp/curlylint/bin/curlylint", line 8, in <module>
    sys.exit(patched_main())
  File "/tmp/curlylint/lib/python3.8/site-packages/curlylint/cli.py", line 301, in patched_main
    patch_click()
  File "/tmp/curlylint/lib/python3.8/site-packages/curlylint/cli.py", line 291, in patch_click
    from click import _unicodefun  # type: ignore
ImportError: cannot import name '_unicodefun' from 'click' (/tmp/curlylint/lib/python3.8/site-packages/click/__init__.py)

Expected behavior

Curlylint runs successfully

Actual behavior

ImportError: cannot import name '_unicodefun' from 'click' (/tmp/curlylint/lib/python3.8/site-packages/click/__init__.py)

thibaudcolas commented 2 years ago

Thank you @jmsmkn and @adamchainz :) v0.13.1 is now available on PyPI: https://pypi.org/project/curlylint/0.13.1/.