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

Add click 8.1.0 support #375

Closed
wants to merge 1 commit into from
Closed

Add click 8.1.0 support #375

wants to merge 1 commit into from

Conversation

zanieb
Copy link
Contributor

@zanieb zanieb commented Mar 28, 2022

Some deprecated code was removed in pallets/click#2130 resulting in the failed import of get_terminal_size from click. Per the recommendation in Click's release notes, we can import from shutil instead.

get_terminal_size can probably be dropped from Typer's interface in the future since it's been dropped from Click's, but I'll leave that decision to a future PR. This change is backwards compatible.

See https://click.palletsprojects.com/en/8.1.x/changes/#version-8-1-0
Closes #377

@zanieb zanieb marked this pull request as ready for review March 28, 2022 19:15
@jepler
Copy link

jepler commented Mar 28, 2022

Thanks! This looks like a correct fix.

@genos
Copy link

genos commented Mar 29, 2022

I came to :octocat: after experiencing the aforementioned bug just this afternoon, only to find y'all already had a fix in the works. Thanks!

@Ravi4moreyeahs
Copy link

Traceback (most recent call last):
File "/Users/moreyeahs/CheQ ONE/Dockerized/app/main.py", line 17, in
from bank.default import DefaultPatern
File "/Users/moreyeahs/CheQ ONE/Dockerized/app/bank/default.py", line 2, in
import spacy
File "/Users/moreyeahs/CheQ ONE/Dockerized/venv/lib/python3.10/site-packages/spacy/init.py", line 15, in
from .cli.info import info # noqa: F401
File "/Users/moreyeahs/CheQ ONE/Dockerized/venv/lib/python3.10/site-packages/spacy/cli/init.py", line 3, in
from ._util import app, setup_cli # noqa: F401
File "/Users/moreyeahs/CheQ ONE/Dockerized/venv/lib/python3.10/site-packages/spacy/cli/_util.py", line 9, in
import typer
File "/Users/moreyeahs/CheQ ONE/Dockerized/venv/lib/python3.10/site-packages/typer/init.py", line 12, in
from click.termui import get_terminal_size as get_terminal_size
ImportError: cannot import name 'get_terminal_size' from 'click.termui'

@danielbraun89
Copy link

This is a high priority bug fix! all new installations of typer are basically broken

mweinelt added a commit to mweinelt/nixpkgs that referenced this pull request Mar 29, 2022
In 8.1.0 click removed the deprecated `get_terminal_size` function
in favor of letting downstream projects import it from shutil.

pallets/click#2130
tiangolo/typer#375
@jepler
Copy link

jepler commented Mar 29, 2022

If there's any way Adafruit can help get this merged and a release made, please @ me!

@austinbutler
Copy link

Confirmed working. Anyone using Poetry for their dependencies can use:

[tool.poetry.dependencies]
typer = { git = "https://github.com/madkinsz/typer.git", rev = "b6efa2f" }

@Andrew-Sheridan
Copy link

@tiangolo any chance you could take a look at this?

Thank you

@github-actions
Copy link

📝 Docs preview for commit b6efa2f at: https://6244897abaa0e80081318186--typertiangolo.netlify.app

@codecov
Copy link

codecov bot commented Mar 30, 2022

Codecov Report

Merging #375 (b6efa2f) into master (6d8e954) will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master      #375   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          252       252           
  Lines         5287      5287           
=========================================
  Hits          5287      5287           
Impacted Files Coverage Δ
tests/__init__.py 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6d8e954...b6efa2f. Read the comment docs.

@zanieb
Copy link
Contributor Author

zanieb commented Mar 30, 2022

Requires a black update to pass CI as it's affected by the same bug :)

Closing in favor of #380

@zanieb zanieb closed this Mar 30, 2022
@tiangolo
Copy link
Owner

Thanks for the work @madkinsz! And thanks everyone for the feedback. This was included in #380, and is now released in Typer 0.4.1. 🚀 🎉

@jepler
Copy link

jepler commented Mar 30, 2022

Thank you @tiangolo

mweinelt added a commit to NixOS/nixpkgs that referenced this pull request Mar 30, 2022
In 8.1.0 click removed the deprecated `get_terminal_size` function
in favor of letting downstream projects import it from shutil.

pallets/click#2130
tiangolo/typer#375
mweinelt added a commit to NixOS/nixpkgs that referenced this pull request Mar 31, 2022
In 8.1.0 click removed the deprecated `get_terminal_size` function
in favor of letting downstream projects import it from shutil.

pallets/click#2130
tiangolo/typer#375
mweinelt added a commit to NixOS/nixpkgs that referenced this pull request Mar 31, 2022
In 8.1.0 click removed the deprecated `get_terminal_size` function
in favor of letting downstream projects import it from shutil.

pallets/click#2130
tiangolo/typer#375
risicle pushed a commit to NixOS/nixpkgs that referenced this pull request Apr 3, 2022
In 8.1.0 click removed the deprecated `get_terminal_size` function
in favor of letting downstream projects import it from shutil.

pallets/click#2130
tiangolo/typer#375
mweinelt added a commit to NixOS/nixpkgs that referenced this pull request Apr 7, 2022
In 8.1.0 click removed the deprecated `get_terminal_size` function
in favor of letting downstream projects import it from shutil.

pallets/click#2130
tiangolo/typer#375
mweinelt added a commit to NixOS/nixpkgs that referenced this pull request Apr 8, 2022
In 8.1.0 click removed the deprecated `get_terminal_size` function
in favor of letting downstream projects import it from shutil.

pallets/click#2130
tiangolo/typer#375
mweinelt added a commit to NixOS/nixpkgs that referenced this pull request Apr 10, 2022
In 8.1.0 click removed the deprecated `get_terminal_size` function
in favor of letting downstream projects import it from shutil.

pallets/click#2130
tiangolo/typer#375
mweinelt added a commit to NixOS/nixpkgs that referenced this pull request Apr 12, 2022
In 8.1.0 click removed the deprecated `get_terminal_size` function
in favor of letting downstream projects import it from shutil.

pallets/click#2130
tiangolo/typer#375
mweinelt added a commit to NixOS/nixpkgs that referenced this pull request Apr 13, 2022
In 8.1.0 click removed the deprecated `get_terminal_size` function
in favor of letting downstream projects import it from shutil.

pallets/click#2130
tiangolo/typer#375
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

Successfully merging this pull request may close these issues.

ImportError: cannot import name 'get_terminal_size' from 'click.termui'
8 participants