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

Upgrade completion #66

Merged
merged 10 commits into from
Mar 16, 2020
Merged

Upgrade completion #66

merged 10 commits into from
Mar 16, 2020

Conversation

tiangolo
Copy link
Member

✨ Upgrade completion.

Re-implement completion mixing ideas from click-completion and recent updates in Click. Fixing some issues in both and adding extra features.

Add support for modern PowerShell including PowerShell Core (the latest version, installable on Linux). The current PowerShell support in click-completion is obsolete and doesn't work in recent versions of Windows, like Windows 10 😞 . But with this re-implementation it is now supported, including help texts. ✔️

Now click-completion is not an optional dependency, it's all integrated into Typer. That also means Jinja and other click-completion requirements are no longer needed.

Add optional support for shellingham to auto-detect the shell to install completion.

But without installing shellingham --show-completion is now still available and becomes an optional argument that takes the shell for which to show completion. The same with --install-completion.

For it to work it's necessary to still monkeypatch Click, but now in a single place, a single function. It's all done automatically.

Shells supported:

  • Bash
  • Zsh
  • Fish
  • PowerShell
  • Pwsh (PowerShell Core)

@github-actions
Copy link

@codecov-io
Copy link

codecov-io commented Mar 15, 2020

Codecov Report

Merging #66 into master will decrease coverage by 0.05%.
The diff coverage is 99.28%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #66      +/-   ##
==========================================
- Coverage   99.96%   99.90%   -0.06%     
==========================================
  Files         166      171       +5     
  Lines        2925     3313     +388     
==========================================
+ Hits         2924     3310     +386     
- Misses          1        3       +2     
Impacted Files Coverage Δ
tests/test_completion/test_completion_install.py 97.36% <97.36%> (ø)
tests/test_completion/test_completion.py 97.72% <97.72%> (ø)
tests/test_completion/test_completion_complete.py 100.00% <100.00%> (ø)
...est_completion/test_completion_complete_no_help.py 100.00% <100.00%> (ø)
.../test_completion/test_completion_install_source.py 100.00% <100.00%> (ø)
tests/test_completion/test_completion_show.py 100.00% <100.00%> (ø)
tests/test_others.py 100.00% <100.00%> (ø)
typer/completion.py 100.00% <100.00%> (ø)
... and 4 more

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 d651b7d...32dbf49. Read the comment docs.

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@github-actions
Copy link

@tiangolo tiangolo merged commit 1d3337a into master Mar 16, 2020
@tiangolo tiangolo deleted the upgrade-completion branch March 16, 2020 12:22
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.

2 participants