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

Pass --no-input #1029

Merged
merged 4 commits into from
Aug 10, 2023
Merged

Pass --no-input #1029

merged 4 commits into from
Aug 10, 2023

Conversation

Darsstar
Copy link
Contributor

@Darsstar Darsstar commented Aug 1, 2023

  • I have added an entry to docs/changelog.md

Summary of changes

Pass --no-input to Pip.

Fixes #219

This is a breaking change for keyring users. But was it ever properly supported anyway? As someone who needs the artifacts-keyring package to authenticate with our private repo I'm going with the answer being no, you will have to apply hacks if this is important to you. Failing fast is better then hanging forever because the user can't see the prompt asking for a username and password.

pypa/pip#11698 which is released in Pip 23.1 added a section to the documentation how Pipx users who rely on the keyring library can set things up so keyring will be used again: https://pip.pypa.io/en/stable/topics/authentication/#using-keyring-as-a-command-line-application.

Test plan

It should not have any impact when keyring is not required to authenticate with the repository.

Tested by running the test suite.

pipx run --index https://pypi.org/simple/ cowsay no input

@Darsstar Darsstar changed the title No input Pass --no-input Aug 1, 2023
@Darsstar Darsstar force-pushed the no-input branch 2 times, most recently from 8e0e6ba to fdc4967 Compare August 1, 2023 14:53
.pre-commit-config.yaml Outdated Show resolved Hide resolved
src/pipx/venv.py Outdated
Comment on lines 304 to 308
cmd = (
["--no-input", "install", "--no-dependencies"]
+ pip_args
+ [package_or_url]
)
Copy link
Member

@uranusjr uranusjr Aug 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
cmd = (
["--no-input", "install", "--no-dependencies"]
+ pip_args
+ [package_or_url]
)
cmd = [
"--no-input",
"install",
"--no-dependencies",
*pip_args,
package_or_url,
]

We should probably use this chance to change other command-building code as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left some in the form of cmd = [<snip>] + cmd alone instead of changing it to cmd = [<snip>, *cmd].

@dukecat0 dukecat0 merged commit 238ae43 into pypa:main Aug 10, 2023
11 checks passed
@Darsstar Darsstar deleted the no-input branch August 10, 2023 10:29
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.

pipx install doesn't prompt for credentials for private vcs url
3 participants