FS#65349 - [python-pip] Install fish and zsh completions

Attached to Project: Arch Linux
Opened by Phil Schaf (flying-sheep) - Saturday, 01 February 2020, 17:48 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:24 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To David Runge (dvzrv)
Felix Yan (felixonmars)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 1
Private No

Details

You install `pip completion --bash`, but not `--fish` or `--zsh`.
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:24 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/python-pip/issues/2
Comment by Felix Yan (felixonmars) - Saturday, 07 March 2020, 22:39 GMT
I have enabled completion for fish, but unfortunately pip's zsh completion seems not able to autoload (only #compdef style is supported).
Comment by David Runge (dvzrv) - Wednesday, 29 June 2022, 10:08 GMT
@flying-sheep: Thanks for the ticket!

As the zsh completion integration does not work, would you mind opening an upstream ticket for that and linking it here?
Comment by Phil Schaf (flying-sheep) - Sunday, 03 July 2022, 15:12 GMT
There’s already https://github.com/pypa/pip/issues/5364 and https://github.com/pypa/pip/issues/4955

Are those what you mean? Otherwise I think it makes more sense for you to open a ticket in which you specify what you mean exactly
Comment by David Runge (dvzrv) - Friday, 14 July 2023, 10:39 GMT
I'm hopeful for this to be merged soon: https://github.com/pypa/pip/pull/11417
Comment by David Runge (dvzrv) - Saturday, 15 July 2023, 10:11 GMT
Please check if 23.2 in [extra-testing] fixes this for you!
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.
Comment by Chih-Hsuan Yen (yan12125) - Monday, 14 August 2023, 07:07 GMT
Somehow I'm still unable to get zsh completions working out of box with pip 23.2.1. Seems /usr/share/zsh/site-functions/_pip is problematic. If I removed that file and restart zsh, pip completions work fine. In this case, completions are provided by the function from zsh /usr/share/zsh/functions/Completion/Unix/_pip (available since zsh 5.9 [1]) instead the one from upstream pip.

Upstream pip completions may be fixed after [2] is resolved. The script from upstream pip should be more complete than /usr/share/zsh/site-functions/_pip as it calls the pip command to generate completions, but it is also slower.

[1] https://github.com/zsh-users/zsh/commit/b7490d337676b212be881bf692cb0db78ed42bc2
[2] https://github.com/pypa/pip/issues/12166
Comment by Chih-Hsuan Yen (yan12125) - Monday, 13 November 2023, 09:24 GMT
The upstream issue is resolved, while pip completion for zsh is still broken. As per [1], the following line in PKGBUILD

PYTHONPATH="$pkgdir/$_site_packages" "$pkgdir"/usr/bin/pip completion --zsh | install -vDm 644 /dev/stdin "$pkgdir"/usr/share/zsh/site-functions/_pip

should be changed to

PYTHONPATH="$pkgdir/$_site_packages" "$pkgdir"/usr/bin/pip completion --zsh | tail -n+3 | install -vDm 644 /dev/stdin "$pkgdir"/usr/share/zsh/site-functions/_pip

[1] https://github.com/pypa/pip/issues/12166#issuecomment-1646508058

Loading...