pip icon indicating copy to clipboard operation
pip copied to clipboard

Fix: Fix PowerShell completion test for Register-ArgumentCompleter

Open meet-vasita opened this issue 3 months ago • 7 comments

Updates pip’s PowerShell completion and its test to the modern Register-ArgumentCompleter style, replacing the old TabExpansion script.

Closes #12440.

meet-vasita avatar Sep 12 '25 16:09 meet-vasita

Hi @notatallshaw, could you take a look at this PR?

meet-vasita avatar Sep 12 '25 18:09 meet-vasita

@meet-vasita thanks for raising this PR, unfortunately I have next to zero experience with both powershell and completions, so I am unlikely to be able to review this, hopefully another maintainer will pick this up when they have time, otherwise I will try and eventually add it on to my review list.

This PR did make me think we should move this completion scripts out into their own files, so we can at least run some basic syntax checks, and IDEs will better be able support development work on them. But that should be in a separate PR to this one.

notatallshaw avatar Sep 12 '25 18:09 notatallshaw

Thanks @notatallshaw for the update! I understand, and I’ll wait for another maintainer to review.

I agree that moving the completion scripts into separate files sounds like a good improvement for the future.

meet-vasita avatar Sep 12 '25 18:09 meet-vasita

Thanks @notatallshaw, I’ll add the venv to my global git ignore.

meet-vasita avatar Sep 12 '25 19:09 meet-vasita

I use powershell, but I've never used the completion scripts from pip. So I don't have any direct experience with this (and I'm not familiar with the powershell completion APIs). I'll try to find some time to take a look, but it could well be a few weeks before I have any spare time to do so.

pfmoore avatar Sep 12 '25 21:09 pfmoore

Thanks @pfmoore, no worries I appreciate you taking a look whenever you get the time.

meet-vasita avatar Sep 13 '25 07:09 meet-vasita

I created #13593 because this PR doesn't work for me as it registers completions for the wrong command, but that's a more general issue.

I don't have time right now to try to work around the more general bug in order to test this PR.

pfmoore avatar Sep 23 '25 09:09 pfmoore