Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Support for Click 8 #280

Closed
ssbarnea opened this issue May 15, 2021 · 13 comments
Closed

Support for Click 8 #280

ssbarnea opened this issue May 15, 2021 · 13 comments
Labels

Comments

@ssbarnea
Copy link
Contributor

Describe the bug

click 8 was finally released and typer does not support it, at least from https://github.com/tiangolo/typer/blob/master/pyproject.toml#L30 point of view.

@ssbarnea ssbarnea added the bug Something isn't working label May 15, 2021
@languitar
Copy link

Here is one instance of what happens in case click 8 is installed atm:

❯ cruft update -c v1.0.0
Traceback (most recent call last):
  File "/usr/bin/cruft", line 33, in <module>
    sys.exit(load_entry_point('cruft==2.8.0', 'console_scripts', 'cruft')())
  File "/usr/bin/cruft", line 25, in importlib_load_entry_point
    return next(matches).load()
  File "/usr/lib/python3.9/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 972, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 855, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/usr/lib/python3.9/site-packages/cruft/__init__.py", line 6, in <module>
    from cruft._commands import check, create, diff, link, update
  File "/usr/lib/python3.9/site-packages/cruft/_commands/__init__.py", line 2, in <module>
    from .check import check
  File "/usr/lib/python3.9/site-packages/cruft/_commands/check.py", line 6, in <module>
    import typer
  File "/usr/lib/python3.9/site-packages/typer/__init__.py", line 29, in <module>
    from .main import Typer as Typer
  File "/usr/lib/python3.9/site-packages/typer/main.py", line 11, in <module>
    from .completion import get_completion_inspect_parameters
  File "/usr/lib/python3.9/site-packages/typer/completion.py", line 10, in <module>
    import click._bashcomplete
ModuleNotFoundError: No module named 'click._bashcomplete'

@ssbarnea
Copy link
Contributor Author

ssbarnea commented May 17, 2021

Yep, I found it myself but did not had time to investigate. Still we do need tracking ticket for this issue. This can cause real issues for cli authors which expect to install tools outside isolated virtualens (direct affect on those packaging them for linux distros).

Temporary I switched installing my typer based tool using pipx, but I do not expect everyone knowing or being able to the same. At least I am lucky that my typer tools has likely one user only.

@StanczakDominik
Copy link

Just to cross-ref, this is essentially the same as #278

archlinux-github pushed a commit to archlinux/infrastructure that referenced this issue Jun 2, 2021
@johnthagen
Copy link

@tiangolo This is beginning to affect our production apps. Other applications, such as uvicorn will use click 8 and that will be pinned by a tool such as pip-tools in requirements.txt, but then we have some CLI tests in that use typer and pin click 7 in dev-requirements.txt. This makes reconciling them extra work.

@musicinmybrain
Copy link
Contributor

Fedora Linux just updated to click 8.x in the development version (Rawhide). I just added python-typer to the distribution a little less than two weeks ago, but I won’t be able to keep it there if a patch doesn’t surface in the next couple of months—at least a viable PR, if not a release. (It’s unlikely that I’ll have enough time to study both projects and develop the patch myself.)

@postmasters
Copy link

@tiangolo was involved in that change from click pallets/click#1484

@arogozhnikov
Copy link

I think we should just confirm that last commit was a year ago and author just doesn't have time to maintain the package.

@johnthagen
Copy link

I think we should just confirm that last commit was a year ago and author just doesn't have time to maintain the package.

@tiangolo recently tweeted that he was hoping to speed up Typer (and FastAPI) development: #300 (comment)

Hopefully this means he'll be able to devote some time to Typer.

@tiangolo
Copy link
Member

Thanks for the interest and discussion everyone! ☕

I just released Typer 0.4.0, which is compatible with both Click 7 and Click 8. 🎉

@johnthagen
Copy link

johnthagen commented Aug 30, 2021

@tiangolo Thank you! ❤️

@patricksurry
Copy link
Contributor

should be closed?

@johnthagen
Copy link

should be closed?

@patricksurry Yes.

@tiangolo tiangolo added answered and removed bug Something isn't working labels May 1, 2023
@tiangolo tiangolo changed the title [BUG] typer does not support click 8 Support for Click 8 May 1, 2023
@github-actions
Copy link

github-actions bot commented May 1, 2023

Assuming the original issue was solved, it will be automatically closed now. But feel free to add more comments or create new issues.

@github-actions github-actions bot closed this as completed May 1, 2023
@fastapi fastapi locked and limited conversation to collaborators May 1, 2023
@tiangolo tiangolo converted this issue into discussion #589 May 1, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

9 participants