Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

get_terminal_size was removed in click 8.1.0 #151

Closed
petrchmelar opened this issue Mar 29, 2022 · 4 comments
Closed

get_terminal_size was removed in click 8.1.0 #151

petrchmelar opened this issue Mar 29, 2022 · 4 comments

Comments

@petrchmelar
Copy link

petrchmelar commented Mar 29, 2022

Since get_terminal_size function was removed from click and cruft depends on click = ">= 7.1.2, <9.0.0", the cruft create is failing with:

Traceback (most recent call last):
  File "/opt/venv/bin/cruft", line 5, in <module>
    from cruft._cli import app
  File "/opt/venv/lib/python3.8/site-packages/cruft/__init__.py", line 6, in <module>
    from cruft._commands import check, create, diff, link, update
  File "/opt/venv/lib/python3.8/site-packages/cruft/_commands/__init__.py", line 2, in <module>
    from .check import check
  File "/opt/venv/lib/python3.8/site-packages/cruft/_commands/check.py", line 5, in <module>
    import typer
  File "/opt/venv/lib/python3.8/site-packages/typer/__init__.py", line 12, in <module>
    from click.termui import get_terminal_size as get_terminal_size
ImportError: cannot import name 'get_terminal_size' from 'click.termui' (/opt/venv/lib/python3.8/site-packages/click/termui.py)

As suggested in click's changelog, the get_terminal_size call could be replaced by shutil.get_terminal_size maybe.

@petrchmelar
Copy link
Author

Caused by tiangolo/typer#377

@petrchmelar
Copy link
Author

It will be probably fixed by merging tiangolo/typer#375

@tiangolo
Copy link

Hello! I just released Typer 0.4.1 that should handle this. 🚀 🤓

@petrchmelar
Copy link
Author

Thanks, cruft seems to be working now. :) closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants