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

pipx run --spec git+ssh:// hides ssh authentication prompt #1418

Open
cdleonard opened this issue May 20, 2024 · 2 comments
Open

pipx run --spec git+ssh:// hides ssh authentication prompt #1418

cdleonard opened this issue May 20, 2024 · 2 comments
Labels

Comments

@cdleonard
Copy link

Describe the bug

When SSH authentication is requested for an URL pipx will hang indefinitely with a message like ⣾ determining package name from 'git+ssh://....

You can work around this by passing -v which shows the SSH password prompt.

Same effect for SSH password prompt and passphrase prompt.

How to reproduce

Run pipx run --spec git+ssh:// for an URL that requires interactive authentication. Maybe by running ssh-add -d and running some github package.

Expected behavior

pipx should allow the ssh prompt to be seen.

It would also be acceptable to run in batch mode and throw an error.

@Gitznik
Copy link
Contributor

Gitznik commented May 21, 2024

pipx runs all pip commands with the no-input flag, as we expect pipx to be used in automated processes. In your case, this unfortunately means that no prompt is shown.

You should be able to fix your issue, by adding the SSH key to your SSH agent before running pipx. This should prevent the prompts, as pip and your SSH agent have all necessary information.

Alternatively, we could think about adding a flag to pipx, that explicitly enables interactive mode.

@cdleonard
Copy link
Author

cdleonard commented May 21, 2024

It seems that pip --no-input does not suppress git+ssh login prompts. It's likely just for prompts originating from pip itself?

The ssh prompt can be suppressed by GIT_SSH_COMMAND='ssh -oBatchMode=yes'. For other kinds of prompts it might sense to set GIT_TERMINAL_PROMPT=0.

This could be considered a pip bug, but at least when running pip --no-input and it prompts the prompt is actually visible.

I don't particularly see the need for a pipx interactive mode, it would be sufficient for it to fail instead of hang if authentication is missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants