balta2ar / brotab

Control your browser's tabs from the command line
MIT License
389 stars 27 forks source link

add Werkzeug version constraint to requirements #109

Closed doctorcolossus closed 2 months ago

doctorcolossus commented 9 months ago

brotab's mediator failed to run for me on Ubuntu 20.04 due to the following error: ImportError: cannot import name 'url_quote' from 'werkzeug.urls' (/usr/local/lib/python3.8/dist-packages/werkzeug/urls.py) in mediator/brotab_mediator.py.

This occurs with Werkzeug >= 3.0. Flask 2.0.2's should therefore specify Werkzeug < 3.0, but specifies only Werkzeug >= 2.0. Unless and until this is fixed upstream, clients of Flask 2.0.2 must specify Werkzeug < 3.0 themselves to avoid this error.

mcint commented 3 months ago

Sharing here since this will be relevant until this PR is merged.

If brotab is installed via pipx, you can just run this:

. ~/.local/pipx/venvs/brotab/bin/activate

test $(pip list | awk '/Werkzeug/{ print $2 }' | cut -d. -f1) == 3 \
  && { pip uninstall werkzeug; pip install 'werkzeug<3'; echo updated; } \
  || echo already ok;

Affecting #105, #37, #80, reply https://github.com/balta2ar/brotab/issues/43#issuecomment-1886621323, mainly included already.